Automated Microscope Focus with an Arduino Pro Micro

YouTuber “smbakeryt” had a small problem — or perhaps you might call it a large annoyance. Either way, his microscope camera setup has an…

Jeremy Cook
5 years ago

Dr. Scott Baker had a small problem — or perhaps you might call it a large annoyance. Either way, his microscope camera setup has an auto-focus feature that — while sometimes helpful — becomes inconvenient when it auto-focuses on his iron instead of the board on which he’s working. The camera’s picture is displayed on a monitor via a computer program, allowing him to swap things around as needed with a mouse, but not directly using a keyboard.

When soldering, he naturally didn’t want to mess around with a mouse and menu system, so he instead devised a custom control board based on the Arduino Pro Micro. The ATmega32U4 chip enables it to work natively as a keyboard or mouse, and since the menu system doesn’t accept keyboard shortcuts (as far as he can tell) his script includes a sequence of coordinate system inputs, pauses, and mouse clicks to accomplish the necessary focusing tasks. While it sounds involved, when shown in action towards the end of the video below, everything happens quite quickly, without excessive lag.

Physically, the device takes the form of a PCB, with Cherry MX keys for a nice “clicky” mechanical input — two of which are modified to accommodate LEDs. It even includes a foot pedal jack that’s used to refocus then switch back to manual, providing convenient hands-free operation.

Jeremy Cook
Engineer, maker of random contraptions, love learning about tech. Write for various publications, including Hackster!
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles