Focus Stacking with a Raspberry Pi – Design Refinements

    focus stackerThe parts for making the lighting control box arrived and I was spurred into action before Christmas to modify the rig to accommodate the revised lighting controls and to build the light control box itself. In the end it took a whole day as I decided to take the opportunity to remove some redundant wiring and to reallocate the push buttons on the sledge mounted control box. I also updated the wiring diagrams to keep track of what I had done.

    Focus stacker light control box
    The focus stacker light control box and the “STOP” remote

    So now I have a lighting control box that sits behind and below the camera; there is also a momentary switch to operate the camera shutter so that I can make a blank exposure between stacks very easily.

    The remote camera shutter is now a remote stop button for the stage which makes it much easier to control the set up of near and far focus points, eyes on the camera and remote in hand.

    focus stacker electrical connections
    Focus stacker electrical connections

    The lights are plug and socket connected to the sledge as is the control box, for easy dismantling and storage. When I need to work on the main module I can quickly disconnect it from everything, and there are no trailing wires getting in the way.

    The redundant 6v lights switch on the sledge mounted control box has been replaced by a push button to operate the camera shutter – mainly to put something useful there instead of having a hole!

    Focus Stacker
    The light diffusion box – now with removable top and back – much better.

    The light diffusion box has also been modified to enable the top and back to be taken off leaving the front and the camera/lens set-up undisturbed. This makes it much easier to tweak the specimen during set up and after successive stacks.

    I am still not totally satisfied with the light diffusion box and may make yet another one, even bigger. I am finding it fiddly to get at the lab jack even with the removable top and back, and the lights would ideally be sited a bit further away from the subject to allow for more diffusion and baffling.

    I have forgotten to manually enter the time and date on at least one occasion, and have given up on the software solution to updating Pi time as too difficult, and so I recently obtained an Adafruit real time battery operated clock module (RTC). It is very compact and is supplied with its battery. It sits neatly in the junction box under the rack where the two wires that need to connect it to the Pi are already present and unused having been taped back originally at the time of build “for a rainy day” – there was a stroke of good luck!  It also needs Pi 5v and GRND which were both there too. The assembly and installation was easy. Modifying the config files on the Pi was not difficult. Installing the drivers for the RTC was impossible………. why, because…… need the Pi to be connected to the internet. If it was connected to the internet I wouldn’t need the RTC, would I?  The driver goes by the name of i2c and enables one chip to talk to another.  There is, apparently, no reliable way to download the correct version of i2c (there are many and various!) and install it without being connected to the internet, which is a bit daft. There are plenty of people wanting to do this judging by the forum talk on the web, but the experts issue dire warnings of workarounds messing up your PI configuration big time. Later versions of Debian whatever, have the drivers in the supplied library. But not mine. Back to square one for the time being.

    focus stacker
    Overall set-up
    focus stacker
    focus stacker- the new light control box handily located behind the camera.

    Focus Stacking with a Raspberry Pi – Specimen Adjustment for Easier Framing and Composition

    Focus stacker
    Focus stacker without light box. The lab jack visible beneath the specimen.

    Over the past month I have made some further improvements to make life easier to set up the specimen and to take the stacks.

    Finally a simple manual lab jack arrived from China which will give me 5mm of vertical adjustment. This is so small that it fits neatly on the stage, having a footprint of just 25mm x 25mm and weighing next to nothing.

    On top of this I have mounted a thin steel plate. All my plastic specimen mounting cards now have a very thin button magnet glued to them, which holds them tightly to the top of the jack while allowing rotation in the horizontal plane and z-y movement.

    lab jack
    lab jack

    At the camera end of the business there is now a second rail mounted laterally which allows fine adjustment in this direction to frame the image. This came from one of the many suppliers of such things on Ebay. It is not a precision item like the lab jack, but will do the job required at very reasonable cost.

    There is an additional light fitted at the front which is used to illuminate the stage while setting-up and provides enough light for the camera to see the specimen and to enable fine tuning of the camera and specimen positions. The main lights are now fixed to the equipment chassis and not the underframe which makes adjustment of the equipment chassis position relative to the camera much easier.

    macro rail
    macro rail

    More software changes have been incorporated to speed up and automate certain functions. For example, there are now three options that can be pre-selected to decide what happens at the end of the shot sequence – stay put, go back to park, or return to the first image. And there is now no need to go back to the park position to commence a shoot. I had put that into the software so that it would force a reset of the counter to allow for errors in positioning, however I have found the setup to be repeatable in this respect and so that precaution was unnecessary and just time consuming.

    All that remains is to make the control of the lights easier from the working position behind the camera, which entails a little more construction work and some wiring alterations. Then we will be done (perhaps!).

    By now you will have guessed that I get as much fun out of the construction of the rig as I do from taking pictures!

    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.

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