Sourcing electronic parts from China: life after Digi-Key and Mouser

Most of the parts that go into our products we buy from either Digi-Key our Mouser.  We always check Arrow because often their prices are way better than anyone else.  For some industrial/electromechanical things we go to Allied.  We also search with Octopart to find components.

However, when things start moving into production it’s really hard to ignore the prices on parts directly from Chinese distributors.  For example, we’ve found that connectors from 4Ucon are sometime 1/10th to 1/12th the cost of similar connectors from Samtec.  We’ve also had luck getting things like pogo pins from UXcell.

The websites are not as professional as those from Digi-Key and Mouser, but that’s easy enough to get over.  And while things like integrated circuits can be spoofed, for things like connectors the risk is pretty low.

The minimum order quantity and lead time are things you don’t want to overlook, but with DHL shipping we usually get the parts here in about 2 days.

So what great sites have you found for getting parts?

Photographing electronics

I will admit that I’m not a seasoned photographer, so take everything I say with a grain of salt.  It could be all wrong…

When we started the web site, none of us were very good photographers.  We started out using a Canon Ti, but this was only because it was what we had around the shop.  We thought anything SLR would be good enough to take product shots, but it turns out that there is more than that to photography.  We’ve learned a lot in a little amount of time…

These days we have a Canon T3i, which was recently discontinued in favor of the new Canon T5.  I can’t speak directly to the T5, so what follows is about the T3i.  Compared to the original Ti, the T3i is so much more productive.  The Ti did not allow you to preview shots in the LCD screen before snapping the picture.  With the T3i you can see the image in the LCD screen, go 10x on the zoom, and know that your shot is going to be in focus.  You can also do “auto-bracketing”, which tells the camera to take multiple shots with slightly different settings so that you’re more likely to get one with the right lighting.

Like most folks we thought that megapixel count was everything when we started.  We were way off.  For our first lens we got a Canon 50mm prime lens, and it is razor sharp.  There is also a cheaper alternative that you might want to consider as well.  We never use the lens that came with the camera anymore.  I highly recommend this lens because you’re pretty much guaranteed excellent shots with it.  I have taken picture of my kids with it and you can see detailed reflections in their eyes when you zoom in.  The only down side is that it’s not a zoom lens, so you will have to walk closer or farther away from your subject to get everything in frame.  The quality is unbelievable and you’ll never use the lens that came with the camera again (maybe you’ll be smart and just get the camera body and a good separate lens).

Once you have the camera and the right lens, the next trick is learning how to take the right shots.  For crisp pictures you need a tripod and to lock the camera in ISO 100.  Just push the ISO button and select “100” instead of “auto”.  This will help eliminate any graininess from your shots and let you zoom in and still have detail.  Then, you’ll want to put your camera in “aperture priority” mode.  This is “Av” on your mode selection dial.  With such a low ISO setting the camera will have to hold the shutter open for a few seconds, typically.  This is why you need the tripod: bumps = blurs.

Now you’re almost ready.  Most of the time you’ll want to have all of your product in focus at the same time.  To do this, you’ll have to use a large f-stop.  The 50mm prime lens can do f/1.2 but this will put a only a tiny section of the shot in focus with other sections are left out of focus: a photography technique called bokeh.  This is cool if you want to bring attention to a specific section of your shot, but probably not the best choice for a product photo.  So turn the dial next to the shutter button to change the f-stop to f/8 or even more.  f/22 will put a lot of the shot in focus, but as you go higher in f value the shutter will have to stay open even longer.  Again, a tripod is a must.  There is no harm in going as high as you can with the f-stop.

Put the camera on a 2 second timer (or get a kit with a wireless shutter control) to make sure that you don’t accidentally budge the camera while the shutter is open.  Then, take your shot.  If you want something a little brighter you can adjust the exposure by holding the Av button down while turning the dial next to the shutter button.  This is similar to adding “fill light” in tools like Google Picasa.  This will extend the time the shutter has to stay open, too.

With these techniques I think you’ll be able to take some great product shots, but sometimes you will want to be able to take extreme closeups or get shots of small items.  You can get a macro lens to do this, or you could use inexpensive extension tubes.  These just snap in between the camera and the lens to put the lens a little farther away.  The more space between the lens and the camera, the more magnified your shot will be.

Here’s an example of a shot of a penny with all three extension tubes used at the same time.  Click on these pics to see them close up!

penny

penny close

The first shot shows how wide the field of view is.  WordPress has a 2MB limit on the files I can add in, so I added a second shot.  The second shot shows a cropped down portion of the full image but maintains the full detail of the original shot.

Of course there are some downsides to using extension tubes instead of a real macro lens.  I don’t have a real macro lens (though if you buy me one, I’ll take real good care of it!) but my understanding is that the macro lens will allow you to focus from close up all the way to infinity.  With extension tubes there is only a small band where the shot will be in focus, so you’ll have to adjust the distance from your camera to your subject to get within that “band of focus”

Anyhow, I will say that we learned a lot about technique going through this process but I think our pictures have really improved and it has helped to show off the attention to detail we have for our products.

Surface mount electronics at home

Most of the coolest electronics parts are only available in surface mount (SMT) packages these days.  What is a modern maker to do?

I guess some folks start out with breakout boards and try to keep using their breadboards with SMT parts.  At some point, however, you’ll be ready for the next step.  And that involves designing your own circuit board and building your project.

When I was in college I used EAGLE for my electronics projects.  Even when I worked at Boeing we used EAGLE in our group, even though it wasn’t Boeing’s preferred package.  However, now I use KiCad and while it took a little getting used to, I love it.  Some of the features are way better than EAGLE and KiCad is free so how cool is that?

After your design is done you will want to have your boards fabricated, and I would recommend OSHPark.  Perfect…purple…prompt.  The cost is excellent for the quality and the delivery times keep getting shorter.  Awesome!

With boards in hand it’s time to start making!  We cut our own stencils in-house with a Silhouette Cameo.  With the Cameo and the gerber2graphtec code on GitHub you’ll be able to make your own stencils in no time.  We use 4mil Mylar as our standard for stencils.

The solder paste can be a little pricy, but if you don’t need much you can get a small tube of solder paste from Digi-Key.  Squeeze out a blob, smear with an old hotel key-card, and you’re ready to lay those tiny parts down.  To move the parts around by hand we use a set of vacuum tweezers.  The tips for the SMT parts are a bit pricy, so we just took the tip off of a mechanical pencil and use it as a tip.  Also, I highly recommend you watch the following for some awesome assembly tips:

After the parts are down, it’s time to put them in a convection toaster oven and get the paste to reflow.  Try to follow the reflow profile provided by the solder paste manufacturer.  You can monitor the temperature with a non-contact thermometer or with an Arduino and one of our RTD shields.

In minutes you’ll have your board made!  With just a few readily available tools, which really aren’t too expensive, you too can make professional circuit boards at home!

If you do decide to go this route, I would recommend getting a SMT hot air rework station as well.  Some of those SMD parts are expensive and if you need to do any rework, the hot air station will quickly pay for itself.  We use the Kendal rework station linked to above and it works great.  We don’t make much use of the soldering iron though so you might want to look for a station without the attached iron.

So?  What are you waiting for?  Go make something with surface mount parts!

Learning to solder electronics old-school style and PCB cleaning

Building electronics is awesome!  A big part of the building process involves soldering.  Most of the work that we do now uses surface mount components, we try to use surface mount parts everywhere we can, but the some components are still through hole parts.

Yesterday I watched this awesome, retro video series by Pace on proper soldering techniques.  If you’re starting out in electronics it’s definitely worth a watch.

These days when I have to hand solder I use the water soluble, lead-free variety from American Iron and Metal (AIM).  I usually use the 0.020″ diameter version but I also have a spool of the 0.032″ version for (slightly) larger work.

Some folks prefer and recommend no-clean solder, but I don’t like it because I find it very hard to clean the residues off of the circuit boards and even though you don’t technically “have to” clean the residues off of your circuit boards, who wants tacky red-brown goo all over their latest creation???  I went through a lot of laboratory grade isopropyl alcohol (IPA) back when we were mainly using no-clean solders.  I’d clean it with the IPA, douse it with deionized water, then shoot it with compressed air.  I’d have to go through the cycle several times and the boards usually ended up looking chalky or still be sticky after cleaning.

Yes, you must clean off the water soluble flux left behind from the AIM solder mentioned above, but the great thing is that it’s water soluble: it just comes off with water.  To aid in the process we have an ultrasonic cleaner that we use to clean our boards before we quality test them.  The heater built into the cleaner aids in dissolving the residues.  It’s not perfect though.  We still end up using an old toothbrush at the end to make sure everything got cleaned.  Some folks warn about cleaning electronics with ultrasonics, so read about it before you try it and decide for yourself.  Our technique involves leaving the boards in the ultrasonic bath with just the heater turned on (no ultrasonics) for about an hour.  Then, we’ll rub them with the toothbrush and run through an ultrasonic cycle.  I should also mention that we use type II deionized water in the cleaner.

The smell of the AIM solder is a little funkier than other solders, but I think water soluble is definitely the way to go.  And my iron of choice is the Weller WES51.

RTD Sensors and Thermal Mass

Our RTD shield for Arduino is super precise.  Almost too much so.

Some of our customers have asked questions and had concerns when the RTD shield they purchased from us shows +/- 2 degree fluctuations when exposed to ambient air.  It seems that people have been conditioned with slow moving temperature sensors that take ages to update.

If you think about it though, it should really not come as a surprise that there actually are large temperature gradients everywhere.  For example, when you exhale the temperature of your breath is (often) at a much different temperature than the ambient temperature.  This heat doesn’t instantly disappear into the environment.  Breath is just one example though: body heat, air conditioning, fans, clouds, and so on all affect the temperature.  They all radiate out and make the temperature change over large distances. These temperature differentials are actually physically present all around us.

However, folks usually see these swings as errors or noise.  They call in to question the performance of the shield and ask if other settings could make the results more “accurate”.  The first thing to do is to prove that the electronics on the shield are über-stable.  We don’t want our customers to just take our word for it.  Luckily, the shield can be easily validated by using a fixed resistor in place of an RTD sensor.  Wire one end of the resistor to the + terminal(s) and the other end of the resistor to the terminal(s) and then take readings with the shield.  The RTD is just a temperature controlled resistor.  Using a fixed resistor eliminates almost all of the temperature dependance (sure, most resistors have a little thermal dependance: like 200ppm, but this is good enough to validate the shield).  A Pt-100 RTD sensor measures 100-ohms at 0 degrees Celsius.  So using a fixed resistor around this value or a little more is a good choice as this is the most popular type of RTD sensor.  Using this setup our customers are able to validate the precision of the shield as reported here.  In fact, this approach is how we test the shields after production.

Some applications require the ability to quickly measure temperature changes.  However, many don’t, and I typically give the following list of suggestions:

  • Average the data coming from the RTD shield
  • Increase the thermal mass of the RTD sensor
  • Add a small capacitor to the screw terminals of the RTD shield

Averaging the RTD readings is pretty self-explanatory.  Collect a bunch of data and compute the mean of the data, or even better do something like what’s in the smoothing example to quickly find the average of a circular buffer of data.

Another approach is to increase the system’s thermal mass.  The idea here is analogous to inertia.  Something with a lot of thermal mass doesn’t change temperature easily.  Something with little thermal mass changes temperature very easily.  Ambient air has very little thermal mass: you can blow on the RTD sensor and see the change.  If you take an RTD sensor and immerse it in a liquid, then the liquid will add thermal mass and make it harder to change the temperature readings: if you blow at the liquid it probably won’t affect the RTD readings.  You could also shield the sensor from stray breezes by using a box or use thermal insulation around your sensor.

Adding a little capacitance is effectively the hardware approach to taking an average.  The capacitor makes it a little more difficult for the RTD sensor to change the signals on the inputs of the RTD shield’s analog-to-digital converter.  I would suppose that the capacitor to use could be calculated by determining the desired RC time constant, but I’ve never actually used this approach.  It’s pretty easy to just average values.

So maybe it’s time to trash all of those slow moving thermometers you have and buy one of our awesome RTD shields?

First project with the BeagleBone Black

The Old Milling Machine

cam_chuck_bbb

The next product we’re going to launch is a stepper motor controller.  We are going to use a few of them on a 3-axis table-top gantry mill that I built as part of the machine shop class at Washington University in St Louis way back in, gosh 2003 was it?  All of the other kids were making stainless-steel shot glasses, and I was making parts for a CNC mill…

The mill is pretty much done mechanically, but I never added the electronics to the system: the stepper motors yes, but nothing beyond the motors.  I’m going to try to run Machinekit as a way to get LinuxCNC running on the BeagleBone Black.  I also got a Logitech C920 and hope to play with OpenCV to add machine vision to the LinuxCNC system: a big task, but what fun!

First Steps

The BeagleBone Black (BBB) looks really cool in terms of specs, but I needed a bunch of accessories to really get started.  Here’s what I ended up getting:

I tried to connect the 10 port hub to the BBB and then the Logitech

mouse and keyboard receiver to the 10 port hub, but the BBB didn’t see the mouse or keyboard when I did this.  And yes, I did plug them in before turning the power on.  The mouse and keyboard did work when plugged in directly to the BBB.  So I tried another USB hub that I got from DigiKey and voilà, it worked.

I went with the 10 port hub because it said it could supply 3 amps, wow!  The DigiKey USB hub has no power supplied to the peripherals, so I’m hoping that the power from the BBB’s 5V barrel jack is enough to keep the camera going without issue.  I suppose I could cut the red wire on the 10 port hub as described here, but I’m only going to go that route if the C920 has issues.

It was cool to see the BBB boot up as I haven’t had time or a project to use it on since I bought it almost a year ago.

side

If you have an interest in this project, you might want to check out the following video demonstrating the BBB and OpenCV with the C920: