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 – New Light Box and Backlight Display

    Green Bottle Fly
    Green Bottle Fly

    I have made great strides in the last week, having devoted a serious amount of time to fine tuning the set up. And now I have been able to produce an image of a green bottle fly that I am reasonably happy with. (see picture on left).

    This was taken using a Nikkor 50mm f2.8 enlarger lens reversed onto a Minolta 135mm MD lens using an NEX7 camera with the new light box and display.

    The focus stacker system
    The focus stacker system

    I am really pleased with backdrop arrangement that I now have operational. It was much easier than I thought. I have had this old PC monitor lying around for some time and now it has a purpose in life!

    I have made a series of colour jpeg images in Photoshop – some flat and some grads. These are in a folder on the desktop and when opened using the windows photo viewer, I have it set up to provide a backdrop of roughly the right size. I can scroll through them to see what gives the best effect and adjust the size of the displayed window to suit the magnification I am using and get the gradient where it needs to be.

    Looking inside the light box
    Looking inside the light box

    The new light box was constructed and tested over an afternoon earlier this week week. It is about half as big again as the original one and is doing a much better job at diffusing the light. Inside there are some removable baffles to limit the back lighting.

    Stacker arrangement with new light box and pc display
    Stacker arrangement with new light box and pc display

    The light box extends further forward than the original one, and so can throw more light on the front of the subject. There are still a few hot spots and I am thinking about an inner diffuser made of white tissue paper like a tunnel over the specimen, to give more diffusion. This is also likely to demand a longer exposure so it will require some compromise.

    Nikkor enlarger lens reversed onto Minolta 135mm MD lens
    Nikkor enlarger lens reversed onto Minolta 135mm MD lens

    Also on my list was to play around with different focus increments on the same subject with the same lens configuration. The jury is still out on that, as it is quite a lengthy process to take the images, then process them and try to evaluate sharpness etc. I am getting there.

    I think that the rig is now 95% of where it needs to be – There are some minor changes required to the software for the Raspberry Pi that would help to speed things up a bit between shots and deal with a few bugs (software variety!) – nothing serious and a job for a rainy winter day.

    Stacker arrangement showing light box platform and lights - set up for double fly shot
    Stacker arrangement showing light box platform and lights – set up for double fly shot

    What now needs sorting out is my ability to prepare the specimens – particularly cleaning, and arranging the legs but there are other things too which I will cover at a later date. I am also looking at optical jacks that come in very small sizes for making minute adjustments to the height of the specimen when on the rig, for accurate framing. There are some relatively inexpensive ones available in the USA (of course) but the required postage to the UK is prohibitive.


    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