Focus Stacking with a Raspberry Pi – Focus-Stacker Project Parts List

    I thought it was time that I set down the list of parts that were used to build my focus-stacker. The cost was less than £120. If you live in the USA you could probably do it for the same in dollars – or less!  And it does depend a lot on what you have lying around at home that you can use for this project. I have not included anything to do with lighting or camera equipment other than the IR trigger. Most of the parts were purchased on e-bay with some like the Pi  itself coming from Amazon. You do need to check when purchasing cheap electronic parts on e-bay to make sure they are not coming from Hong Kong if you want them quickly. Shipment from HK  can involve up to a ten week wait for the item to be shipped surface, though sometimes items arrive remarkably quickly. Factor shipment time from HK into you procurement and build schedule if going down that road.

    For the working parts – electronics, motor and rack drive:

    1. Raspberry Pi RBCA000 ARM 1176JZF-S Motherboard 512MB RAM – £ 27.39
    2. 8GB SDHC SD Card pre-loaded with Raspbian “wheezy” Linux operating system – £8.29
    3. iZKA® High Power Micro USB UK Dedicated Mains Power Wall Supply Charger For Raspberry Pi – (5V / 2.1A) – £6.99
    4. 40 wire ribbon cable Male to Female with ends broken out to individual contacts – £4.99
    5. 40 wire ribbon cable Female to Female with ends broken out to individual contacts – £4.99
    6. Arduino 5V 4-Phase Stepper Motor with ULN2003 Control Board – £6.90
    7. SainSmart 2-Channel 5V Relay Module – £8.00
    8. Micsc LEDs, resistors, switches, nylon stand-offs, nylon screws and bolts, solder pins, Veroboard, fibreglass sheet, and project boxes – approx £35
    9. Camera infrared remote control for Sony Alpha – £2.69
    10. Stalk for camera remote IR  – salvaged from flexible USB LED lamp £ 1.98
    11. DVD Rack – salvaged from old DVD player
    12. Misc Lego Technic gear wheels – approx £5
    13. Other miscellaneous electrical components and cable ties – from a box in my shed

    For the chassis:

    1. Aluminium channel 3/4″ x 3/4″, aluminium angle 3/4″ x 3/4″ and 1/8″ aluminium plate – all  from  my shed
    2. S/S and other hardware to hold everything together and three rubber feet
    3. Camera Rack – old Minolta rack lurking in my junk cupboard

    I will cover the software side of things in another post.

    Focus Stacking with a Raspberry Pi – Focus Stacker Circuit Details

    I have finally got round to drawing up the electrical schematic diagram for the focus stacker showing how my Raspberry Pi is connected to the various component that form part of my stacker. Please check very carefully before using any of this information. It works for me but may not for you! The information is shown on this page.

    Focus Stacking with a Raspberry Pi – development modifications

    The rubber band drive has gone, replaced with some lego gearing. I had acquired various sized gear wheels (40, 24 and 16 teeth) and the one that worked best for my installation was the 40-16 arrangement shown here in the picture. I was able to adjust the position of the stepper motor to accommodate this new configuration by means of the adjustable tension arm. This works much better than the rubber band arrangement, and the movement of the stage on its rack is quite smooth and jerk free.

    The new gearwheel drive resplendent with miniature rubber duck. When I have built the dust cover, Mr Duck will sit on a spindle protruding through the cover so that I can see how the motor is behaving.
    The new gearwheel drive resplendent with miniature rubber duck. When I have built the dust cover, Mr Duck will sit on a spindle protruding through the cover so that I can see how the motor is behaving.

    I have also now installed the official rubber duck rotation indicator!

    The motor control software has a soft-start and soft-stop routine so that the rack speeds up and slows down gracefully when it has been motoring at full speed for a long traverse, say, to park the stage. It avoids an abrupt stop which is not ideal. (when incrementing between shots a much slower speed is used). I had noticed that the speeding up was quite gradual to start with and then seemed to make a big jump in speed at the end of the speed up sequence. The routine was running correctly and the motor was doing what it was told – namely to speed up on each 8-step sequence by a fixed amount represented by a reduction in sleep-time between individual motor steps of 0.001s starting at .060s until the target speed was reached at .002s.  After a lot of head scratching I realised that this simple approach was completely wrong as the last two increments effectively double the speed (from sleep time of .004 to .002) hence the jerk. A more sophisticated algorithm was required based on a reducing  percentage of the sleep-time at each 8-step sequence. This was easy to do and works much better.

    The flexible stalk lamps are going to be used to light the backdrop, and I have acquired some IKEA JANSJÖ LED lights for the main illumination of the specimen. These are very cheap (£10 each) and have a clamp at the base, and are mains powered. Just have to work out how to arrange them. I have also obtained some 0.5mm white plasticard sheet to build some light diffusers with – some experimentation is required to get this aspect right as it is quite critical to get even lighting.

    Camera remote control. You can also see the miniature beeper attached to the second relay channel on the Sainsmart relay.
    Camera remote control. You can also see the miniature beeper attached to the second relay channel on the Sainsmart relay.

    The remote camera shutter release  I bought on e-bay is now connected to the rig by means of a two-pin din plug and socket, and enables me to test fire the camera when everything is powered off, or if the GUI isn’t giving me the option.

    I have finally got a warning beeper wired in. The 3.5mm audio out put from the Pi requires an amplifier to drive anything at a reasonable volume so I had ruled that out as just an additional complication. MobaXterm could not provide a solution that would use the laptop audio system. In the end the easiest option was to drive a 5v beeper via the Sainsmart 2-channel relay board on which I had a spare channel doing nothing. The beeper can be seen in the picture hanging onto the relay. Volume control is by piercing a hole in the paper cover over the end of the beeper to protect it from damage during manufacture. Without the label it is too loud. With the label, way too quiet. A small hole just perfect -low tech but effective!!

    A simple program was added to turn on a green indicator LED when the Pi is booted up using the Cron job scheduler, so that I know it’s OK to connect the laptop. It sits in the home/pi directory and is called by a line at the end of the crontab  file:

    @reboot python/home/pi/ &

    The “&” at the end of the line calls for the command to be run in the background. So the green light stays on while other scripts run.

    Shall be ready to take some test shots soon.

What’s it all about?

Here are my jottings about my photographic projects and activities. I have been working on a focus stacking macro photography rig. There are quite a few posts about that. In addition I write about other photographic activities as and when!


Category Specific RSS


Warning: A non-numeric value encountered in /home/public/mhp_blog/wp-content/plugins/ultimate-social-media-icons/libs/sfsi_widget.php on line 238