If you’ve ever played around with macro photography, you’ve likely noticed that the higher the lens magnification, the less the depth of field. One way around this issue is to take several slices at different focus points, and then stitch the photos together digitally. As [Curious Scientist] demonstrates, this is a relatively simple motion control project and well within the reach of a garden-variety Arduino.
You can move the camera or move the subject. Either way, you really only need one axis of motion, which makes it quite simple. This build relies on a solid-looking lead screw to move a carriage up or down. An Arduino Nano acts as the brains, a stepper motor drives the lead screw, and a small display shows stats such as current progress and total distance to move.
The stepper motor uses a conventional stepper driver “stick” as you find in many 3D printers. In fact, we wondered if you couldn’t just grab a 3D printer board and modify it for this service without spinning a custom PCB. Fittingly, the example subject is another Arduino Nano. Skip ahead to 32:22 in the video below to see the final result.