May 29, 2014

DIY USB soldering microscope

I've been looking for a decent and cheap USB microscope for SMT soldering. Many of these 50-100$ Chinese microscopes have quite poor working distance, resolution and image quality so I thought to try make one by myself.

A webcam should work quite nicely as a camera sensor because they should work almost everywhere without fiddling with drivers or viewing programs. Logitech C270 is quite inexpensive and it have 1280x920 resolution. A bit of googling also revealed that it doesn't have any too fancy autofocus features that could cause problems later. Estimating the delay between camera and monitor from internet reviews was quite hard but it seems to be in tolerable level.

The lens is maybe the most critical part of the system because it defines the working distance and the amount of light that gets to image sensor. I came across the 50mm F1.4 CCTV lens from which seemed to be quite good for this project. 50mm may not sound like much enough for proper zoom level but this 50mm is with 2/3" image sensor. If the sensor is smaller, also the effective focal length gets greater because of cropping factor. I estimated that it should correspond something like couple of hundreds millimeters focal length with C270's image sensor. Minimum focus distance of this lens is ~30cm. It's a bit too long but focusing range can be modified by moving the sensor closer or further away from lens. The lens have adjustment rings for aperture and focus so finding the best configuration shouldn't be too hard. The lens package contained a threaded macro adapter so now theres also complete lens mount for my camera casing.

Click to enlarge

After taking apart the webcam and checking that everything works as planned, I got small black plastic case from local electronics store, drilled coule of holes, glued macro adapter to it's place and installed 1/4" tripod threads to case.

3. 85x55x30mm WCAH2855 plastic case

Total: ~ 63€ / 86$

Image quality, depth of field and delay is certainly good enough for typical hobbyist-level SMT soldering but I found that I'm still using bare eye for soldering because it's just more handy unless parts are 0402's or smaller. For after inspection and troubleshooting this is very useful. And if not else, it's still quite nice toy!

Click to enlarge
I've tried couple of softwares that are capable of showing webcam view. VLC had horrible delay, VirtualDub works fine but it doesn't allow real time effects like flipping the image horizontally and vertically (handy if the object is between you and camera as in the picure above). Open Broadcaster Software have also webcam input and it allows real time image flipping so I ended up using it in preview mode.

Edit 1: VirtualDub manages also real time effects! See instructions in comments below.

Edit 2: As one of the readers pointed out in the comments section, I forgot to mention that removing or covering the green led on the PCB might improve the image quality (reduces the amount of unwanted scattered light inside the box).  

 *A few glitches in video are caused by recording software, not the camera itself.