Soldering of electronic components is a common task in DIY robotics. Due to the small size of most components, a magnifying glass becomes necessary. A more comfortable solution is to use a soldering microscope. This is what most soldering professionals use nowadays, however most are quite expensive. An alternative is to build one yourself, using commonly found parts. In this post I will provide a brief tutorial on how to make a DIY microscope using a Raspberry Pi, a macro camera and a LCD display.
Materials for the Microscope
Disclaimer: The following are all affiliate links to product listings on eBay or Amazon. Please read our Affiliate Link Policy for more information.
- Raspberry Pi 2 or 3 – $35.91 on Amazon / $37.88 on eBay
- Macro Camera –
Around $12.64 on eBay(no longer available)
- Raspberry Pi 7” LCD Monitor – $26.99 on eBay
- A square plastic profile and a couple of plastic corner profiles.
The total cost is around $75. The items listed above are what I have found to work best in my case. If you already have equipment such as monitors with a HDMI input laying around, you may use it instead and drive the cost even further down!
In my workplace I have an overhead shelf used to store stuff, and the easiest way to mount the microscope was to hang it from this shelf. This configuration essentially consists of a straight plastic profile onto which I attached three corner profiles: One for supporting the entire assembly, one for supporting the Raspberry Pi and the LCD display, and one for supporting the macro camera. The overall setup can be seen below.
There is a ribbon cable running between the Pi and the camera connecting them, which I was able to fit the cable inside the rectangular profile by cutting two slots on the point where the Pi and the camera are located.
The lateral corner profiles are fastened using double-sided tape and cable ties for long-term fastening. A cable tie also secures the Raspberry+display in place, although this can be improved to a more sturdy solution. The camera itself attaches on the profile by means of a velcro strip, which makes it secure and also removable if needed.
As an alternative to the hanging configuration, one could use shorter plastic profile pieces and mount them into a “cross” configuration and secure it to a base so that it stands.
To make our microscope as user-friendly as possible it would be ideal to have it display the video stream from the camera as soon as the device is turned on. This is actually very simple and only requires to have the
raspivid program run on boot.
As a first step we need to install Raspbian by following the official instructions. Having successfully set up a working image on the Pi, we need to enable automatic login for the
pi user. This is done through the
raspi-config application as follows:
Use the arrow keys to enter the “Advanced” menu, then the “Boot Options” submenu, and there enable “Console Autologin”. Exit
raspi-config and reboot.
Next, you will need to edit the .bashrc file that is located at your home directory:
Scroll to the end of the file and add a new line with the following:
Ctrl+O), exit (
Ctrl+X) and reboot. Upon reboot you should see the camera video stream popping up. If your image is rotated upside-down, you can add the option
-rot 180 to the command above to have it rotated. That’s it!
Below is a video of the microscope in action. In this video I am cleaning off some residue from an ESC and using a solder wick to remove old poor quality solder from a PDB.
This project barely scratches the surface of what is possible with the DIY soldering microscope. A few directions for development below:
- Make a 3D printed stand and case for the display and camera
- Make a mechanism to allow adjusting of camera height.
- Allow gracefully shutting down the Pi using e.g. a button connected to GPIO
- Enable recording of video at the touch of a button
- Implement assistive functionality using OpenCV (e.g. tracking of components, image enhancement).
- Wireless image transmission (e.g. to external monitor etc.).
In this post I presented s brief tutorial on how to make an affordable DIY soldering microscope using a Raspberry Pi, a macro camera and a LCD display. Having a powerful computer at the core, the resulting tool can be powerful and extendable yet affordable.