If you ever tried to make macro photography you noticed that it is hard to focus 3D objects. Only at some depth you get clear view where other areas stay blurred. Of course there are expensive equipment available that helps expand field of depth, but who would want to spend money for non professional purposes. David found another solution to solve this problem. And this only cost a Raspberry Pi. His experiment consists of camera, old flatbed camera and Raspberry Pi.
So he took scanner top and placed camera on a rail so it could move along. Connected RasPi to motor through stepper motor driver using four GPIO pins. Another pin he used to control camera shutter. The rest secret lies in Python script where wiringpi library is used to access I/O pins. The stand takes 42 stacked images at 6 fps rate. Each image is taken while camera is moving slowly towards object with fixed focal length.
So in all taken photos the object is covered with correct focal length at different points. After pictures are taken, they are combined using CombineZM software.
We recommend EasyEDA for circuit design and PCB prototype