Building a Modular Electric Microscope with Raspberry Pi and LEGO

Building a Modular Electric Microscope with Raspberry Pi and LEGO

━━━━

I come from the IBM European Research Center located in Zurich, Switzerland. Our team’s primary work is to develop microfluidic technology for medical applications. Two years ago, I was tasked with providing high-quality photos and videos of our microfluidic chips for a large technical event. I borrowed a 4K camera from a colleague, added a macro lens, and created a dedicated light diffuser using an LED matrix and polyester film, then used a high-end tripod and several micromanipulators to position all components. When the liquid filled the microfluidic channels, I captured very appealing videos. I knew this should set a new standard for quality and style in publications and various displays. However, my photography setup took up half of the lab’s workbench and required several hours of meticulous adjustments to take a single photo.

IBM European Research Center has a tradition of developing microscopes. In 1981, Gerd Binnig and Heinrich Rohrer created the scanning tunneling microscope here. As a DIY enthusiast, I quickly began working on creating better equipment. The result was a modular electric microscope worth $300, incorporating three of my favorite things as an adult: the Arduino microcontroller, Raspberry Pi, and LEGO.
Taking photos of microfluidic chips is not easy. These chips are often too large to fit entirely within the field of view of a standard microscope, yet their fine features cannot be resolved with a regular camera. Since the chips are often made of highly reflective or transparent materials, uniform lighting is also critical. Looking at publications from other research groups, it is clear that this is a common challenge. To address this, I designed a multifunctional compact laboratory instrument in my spare time that could capture macro photos from almost any angle.
Building a Modular Electric Microscope with Raspberry Pi and LEGO

My first prototype was a Raspberry Pi camera module, mounted on a base platform that used a linear stepper motor mechanism from an old CD-ROM drive to achieve movement in three dimensions. The Raspberry Pi camera was an ideal choice, allowing manual adjustments of key parameters such as ISO settings and exposure time. Carefully removing the plastic casing of the fixed lens revealed the complementary metal-oxide-semiconductor (CMOS) image sensor, and I designed fine mechanical parts to fine-tune the forward and backward movement of the lens to capture high-magnification macro photos. This device worked normally for a while, but it was very fragile. Several times, I accidentally pushed the moving parts out of their maximum range, damaging the lens mechanism and image sensor.

So I decided to change my approach. I removed the entire lens from the Raspberry Pi camera, then took the objective lens from a cheap USB microscope and mounted it on another CD-ROM linear actuator, allowing the objective lens to move back and forth along the optical axis of the Raspberry Pi camera. I built a housing out of LEGO bricks to protect the exposed camera sensor.
However, this attempt only made me realize the expensive price of linear translation stages for microscopes. The stroke of the CD-ROM actuator was too short to achieve high magnification.
I then switched to a screw mechanism used by 3D printers. I replaced the commonly used 8mm diameter screws, shafts, and bearings with 3mm diameter components to make the structure more compact. Additionally, moving the objective lens caused issues when eliminating stray light, so I decided to move the camera sensor instead. I built a platform that allowed the subject to move and rotate along the x-axis and y-axis. I used six micro stepper motors with gearboxes to move the platform, adjust the tilt of the microscope, regulate the distance between the microscope and the subject, and focus the image.
Building a Modular Electric Microscope with Raspberry Pi and LEGO

To achieve a more compact structure, I often design my own Arduino circuit boards. This time, I designed an 18mm x 18mm circuit board equipped with an ATtiny84 microcontroller and a DRV8834 stepper motor driver. The image quality of this device is stunning, capable of capturing beautiful chip images and observing features as small as a few micrometers, and even serving as a digital goniometer for measuring contact angles. I initially undertook this project to meet specific needs, but I gradually realized it could also become a multifunctional imaging system that could be assembled and used at home or in schools.

IBM and my manager supported me in openly sharing the assembly instructions. However, when I was ready to publish the assembly instructions, I encountered a series of problems. During the production process, I used state-of-the-art 3D printers and a fully equipped machine shop. Moreover, small stepper motors are expensive and hard to find in general electronics stores. Programming the ATtiny84 with a dedicated ISP programmer is certainly not as easy as programming a commercial Arduino board via USB. So, I went back to the drawing board and redesigned everything with common components, such as the Arduino main board, Adafruit Industries’ stepper motor driver, and the 28BYJ-48 stepper motor, which can be purchased for just a few dollars anywhere. To be more DIY-friendly and lower costs, I also replaced the LED matrix light source with an LED backlight module bought from Adafruit for $3 and connected it to a high-power LED. The intensity is slightly lower than the original LED matrix, but the uniformity of illumination for both reflected and transmitted light microscopes is excellent. As for the new linear drive mechanism, I designed a rack and pinion combination using FreeCAD’s gear toolbox, assembled it with LEGO’s “sliding” block, and printed it with my Creality Ender 3 printer. The new design performed well compared to the previous version, even without improvements.
There may still be plenty of room for improvement, and I hope this prototype can inspire other DIY enthusiasts to try better new ideas. Is it possible to replace laboratory microscopes? Perhaps not, but it is an excellent solution for budget-constrained schools, so we have open-sourced the instructions for everyone to access and enjoy the fun of hands-on work.
Author: Yuksel Temiz
Building a Modular Electric Microscope with Raspberry Pi and LEGO

IEEE Spectrum

“Technology Review”

Official WeChat Public Platform

Building a Modular Electric Microscope with Raspberry Pi and LEGO
PreviousRecommendations
How Semiconductors are Changing the World
Four Ways to Handle More Qubits
New Particle Acceleration Technology Under Testing

Leave a Comment

×