Main Content

Arduino+Stepper microscope Z-stage + keypress emulation

Automation of a microscope Z-stage by Arduino + stepper 28BYJ48, controlled by serial dialogue, with emulated keypress after each movement.

To understand the meaning of this project, you should be confident with the concepts of focus stacking in macrophotography or photomicrography, with an image capture application, and you should own a mechanical Z-stage, the kind with a small protruding knob that usually is moved manually, grabbing it between the thumb and the index finger.

A few years ago, as an alternative to costly motorized macro-rails, I developed a simple Arduino UNO project where, thanks to a small “coupling sleeve” made from easily available plumbing accessories, a small stepper could control via serial dialogue the knob of the Z-stage of a microscope, ensuring the small, equal increments needed for photographic Z-stacking.

The solution is based on a small stepper driving the knob of a mechanical Z-stage, in the same way that one would do with his/her fingers. Thus, the mechanical coupling between motor and knob must be made with a small sleeve of suitable size. The sleeve will be fixed to the stepper thanks to a Pololu Universal Aluminum Mounting Hub for 5mm Shaft.Needless to say, any attempt at the automation of a Z-stage requires that it is mounted in the lowest position, under the X and Y stages - otherwise its position may vary unpredictably. But having the Z-stage in direct contact with the microscope stand does not necessarily mean that its knob keeps a fixed position: we cannot take for granted that our stepper can be fixed and keep a static position when activated.That would be the case of the more sophisticated Z-stages, based on worm gears, where the knob remains static while the mechanical stage is raised or lowered. But the solution proposed here deals with the worst scenario, where the knob gets longer or shorter when turned in each direction. Inelegant as it may seem, the need to follow the knob requires that the stepper is dragged back and forth by the knob.Consequently, we need an assembly that can hold the motor firmly, yet slide freely on the surface of the table stand, and heavy enough to resist the modest torque exerted by the motor when turning the knob. The easiest solution is provided by a right-angled metal brace.”

Link to article