Introduction: Arduino High Speed Photography
In this instructable I will show you how I made an Arduino controlled high speed photography rig to be able to take pictures of liquid splashes. This rig can also be used to photograph other time sensitive things without modifications (like glass breaking) but I haven't done that yet.
This instructable assumes that you have a few skills like knowing how to read an electronics schematic (a very basic one!), know how to solder very small electronics, know how to upload firmware to an Arduino board and have basic studio photography skills. You don't need to know about programming an Arduino as I have already done that and will give you all the code you need.
A year before putting this together I didn't know a single thing about electronics so don't be discouraged if this looks overly complicated. Do your research and in very little time this will become very easy to understand. Also, two months before building this I didn't know a single thing about studio photography either. As I was building this I was nearing the end of an eight lesson studio photography workshop. Some of the photography gear you will see in the pictures (like the umbrella, stands, and some flashes) was borrowed from the New England School of Photography (NESOP).
Step 1: Understanding the Electronics
If you are interested in building this yourself you will definitely benefit from understanding what a "breadboard Arduino" is. Basically, its an Arduino with the minimal amount of components to make it work. So you won't get the connectors nor the extra "magic" that comes with the Arduino boards. This makes it very cheap to build your own Arduino based projects at the expense of ease of use. Uploading code to a breadboard Arduino is not as easy as programming a regular Arduino.
Here's how the circuit works in layman terms:
You connect your flash and your camera to the circuit so that it will be able to take a picture without your intervention. There is a laser tripwire much like the ones you see in movies where the thieve tries to steal the diamonds from a museum. Let's say you set up your laser above the opening of a glass containing water. When you drop an ice cube the circuit will trigger the camera and the flash and take a picture at the exact time of the splash. If you use it this way, you'd be using the laser and photocell to detect the ice cube but there is another way that you can use this circuit. You can forget about the laser and set the microphone threshold so that when you make a loud noise (like hitting a glass with a hammer) triggers the flash and camera.
I've included a PDF of the circuit schematics just in case the JPG is not readable enough. In there you will be able to find all the necessary parts. Note that as far as electronics go there are no fancy parts and everything you need you will be able to get either from SparkFun or Adafruit.
Apart from the electronic components you will need two extra cables that you can buy at your photography store of choice. These cables are the flash trigger cable and the camera's remote shutter release cable. Both depend on what brands you use but they all work the same. Note that you will need to cut these cables so make sure you buy the cheapest ones possible. No image data goes through these cables so image quality is not dependent on their quality.
You will need to connect the camera remote to the circuit but since the cable has a very specific connector you will need to cut it and install an 1/8 inch audio jack instead. That's what I chose but you can of course use something else. In my case I'm using a Canon 7D which has a very bizzare connector (N3) that you cannot buy stand alone so I had to buy this cheap trigger on eBay. After splitting the cable you will end up with two new cables. One has an 1/8 inch audio connector on one end and the N3 connector on the other. The other cable has the actual remote shutter release button on one end and bare wires on the other (which you screw directly to the circuits terminal blocks.
Making this is extremely simple. Just take your flash's remote cable and attach an 1/8 inch audio connector on the other end. I'm using a Phottix Strato II remote trigger which actually has an 1/8 inch connector so in my case I took some spare generic speaker cable I had around and soldered an 1/8 inch connector on each end.
Except for the camera shutter release cable I already had all these parts around when I made this project. A lot of these I bought for other projects, some individually and some in bulk. I strongly suggest buying this stuff in bulk (if you are into this hobby of course) from Chinese manufacturers who sell on eBay. In my experience their shipping methods are slow but they are much cheaper than buying single items locally. Having said that, it is sometimes very hard to find what you are looking for if you don't know the part's number or some technical description. With that in mind, I will include a parts list with prices (as of today) and links to popular online shops. These might not be the cheapest around but buying through those stores will guarantee you quality products, great customer service and good community support forums. No eBay seller can top this!
1x Serial Enabled 16x2 LCD - Red on Black 5V (optional) $24.95
This is by far the most expensive part of all and yet it is completely optional. In the LCD panel (I'm sorry but I don't have close up pictures of this) you will see the audio threshold and delay settings. That's it. I thought I was going to use this more but in practice I didn't look at this at all. Just adjusting the trimpots with minimal trial and error got me to the perfect settings in less than 2 minutes.
1x Piezo Element (optional) $1.50
Again, this just makes a soft buzz when you arm the circuit. It gives an audible confirmation that the circuit is in armed mode but that's it. It does make a different noise when the circuit is set to audio trigger mode.
2x Audio Jack 3.5mm $1.50
1x SparkFun Electret Microphone Breakout (optional) $7.95
You don't need the microphone if you will only be using the laser to trip the mechanism. Even if you do use the microphone, ou don't necessarily need the SparkFun breakout for this. Any microphone will do though you will most likely need to add a capacitor and a resistor to use it with this circuit (someone more experienced in electronics might need to confirm this). I think SparkFun sells the microphone piece without the breakout too for a lot less money. But again, I'm not particularly clear how to use the mic without the breadboard so Google around for an answer.
1x ATmega328 with Arduino Optiboot (Uno) $5.50
If you already have an Arduino (any kind) you don't need this but as you can see this is much cheaper. Note that programming this will be a tad more difficult if you don't add a few extra headers in your board and use an FTDI cable. You can always program the chip in your Arduino, pulling it out, and then pushing it back in to the circuit.
2x 4N35 Optoisolator $2.17 for 10 units
These here are extremely important to protect your photography gear. You spent a lot in your camera and your flash to have some electrical snafu damage them. By using these optoisolators you are actually separating your gear from your circuit so even if there is a spike in our circuit you won't damage either the camera nor the flash.
2x Trimpot B10K with Knob $0.95
2x LED (any size) ~$0.35
Resistors and capacitors
You will need a bunch of these and most electronic kits come with a good assortment. If you don't have any then don't go buying just the ones you need for this project. I think you'll be better off getting a pre-made kit. These will last a long time and you will have pretty much any resistor/capacitor value you need. I suggest you look at the kits sold by Joe Knows. http://www.joeknowselectronics.com/
1x Photocell $2.22
The most common photocells are very small for this project. I used one (you can see it in the pictures) and then regretted it. The reason is that you will need to point a laser to the photocell. If the cell is too small, a tiny bump in your circuit, cell, setup, and your circuit will no longer trigger the pictures. I held my laser with putty and still after a few minutes the putty would slowly change shape and the laser would miss the photocell. I strongly suggest you buy a BIG photocell like the one in the link I provided as it will make working with this much much easier.
1x Laser diode $5.95
I bought mine from a Chinese vendor for $1 but any laser will do just fine. I did minimal testing with a focused flashlight and it worked too but not with 100% reliability like the laser did.
2x Terminal Block - 2-pin 3.5mm $2.95 for 5 units
I use these terminal blocks a lot. Again, you don't need to use this particular model and you can even skip these altogether (and solder the cables straight to the solderable breadboard).
2x Terminal Block - 3-pin 3.5mm $3.95 for 5 units
1x 5V 1.5A Linear Voltage Regulator 7805 $0.75
Since I'm using an voltage regulator I can safely power this with a power source ranging from 7 to around 23 volts and the regulator will make sure the circuit gets a steady supply of around 5v.
1x DC Barrel Power Jack/Connector $1.25
I like this barrel a lot as it allows me to power the circuit with a power adapter or batteries.
Hook-Up Wire - Assortment (Solid Core, 22 AWG) $16.96
Again, hookup wire costs around $3 per roll and if you are reading this then you already have some most likely but if you don't this bundle has different colors and is of good quality.
1x 830 tie-point solderable breadboard with power rails $6.50
Before buying this make sure that you lay out your prototype and measure it well. Mine fit incredibly tight in this one and I kind of regretted using it. Having said that I love breadboards that have power buses as it saves from having to solder all the power and ground connections (and of course you can use the buses for whatever you like though in this project that's what I used them for).
Building the circuit
Before you attempt to solder everything in a permanent fashion take your time to build each component on a breadboard first. I can't stress this enough. This will allow you to test and make sure everything is working properly. If something doesn't work then maybe there is a problem with what you put together, something that I messed up while writing the schematics, or maybe the problem lies in a faulty part. The best way to debug problems is by going bit by bit and testing each part separately. You cannot do this if you build it all at once. A good side effect of taking the time to build and test each part separately is that by doing so you will become familiar with the circuit and will most likely tweak something to your liking. Maybe you don't need something that I put in my circuit or maybe you would like to have another functionality.
Note: There is a small mistake in the schematics but only in the image version on Instructables. The downloadable PDF does not contain this mistake. The LED1 and LED5 were positioned incorrectly.
Step 2: Arduino Code
There isn't much to say about the Arduino code as it is pretty straight forward. I've tested this with the Arduino IDE v1.6. Note that you will need three open source libraries to make this work but I've included them in the included zip file so you don't need to download anything else.
Note that before compiling this sketch you will need to install these libraries in your Arduino environment and restart it. There is a nice tutorial in the official Arduino page on how to install libraries.
I would only like to explain one thing that might seem odd at first sight but it is crucial to understand how to make this work properly. In the code you will see that as soon as you "arm" the circuit by pressing the remote release shutter, the camera's shutter will open. You might be thinking "wait, I want to take the picture when the laser is tripped not when I press the shutter myself". And you'd be right, except that the picture is actually "taken" by the flash, not by the camera. If you don't know much about how flashes work this might be a little odd. Just make sure that when you are taking these pictures you are in complete darkness or (very close). If you are in complete darkness, no matter how long your exposure is, the image will be black. The only time you will get an acceptable exposure is when the flash fires. But again, why do I open the camera's shutter so early? The thing is that the camera takes some time to push the mirror out of the way and move the lens' blades. To the human eye this is imperceptible. If I did this as the marshmallow was tripping the laser, by the time the camera finishes moving up the blades and pushing the mirror up, the marshmallow is already in the milk and the "best" of the splash is already gone.
I did exaggerate a little when I said "complete darkness". You can do this perfectly well with some light in the room. Let your photography experience guide you on this or just do trial and error.
Step 3: Putting It Together
After I had the electronics all assembled it was time to take it for a spin. I decided to make milk splashes by dropping marshmallows and gummy candy in the milk.
I took a photo developing tray and poured some milk in it. I had to chose a big tray so that I would get as much white on my pictures as possible. The only problem I found was that after I poured all the milk in the tray I realized that it wasn't nearly enough milk in it so that the candy would actually splash like I wanted so I had to rush to the convenience store next door and buy an extra gallon of milk. Note that these trays usually contain nasty chemicals used to develop photographs in the dark room so once the milk touches the trays it is not safe to drink.
As you can see in the pictures, I set up my Speedlite bouncing off an umbrella. It is very important to set the Speedlite to the lowest possible power setting. This is the key to getting a crisp image with no motion blur. If you set the flash to a high power mode then the actual power is exactly the same but it will stay on for a longer period of time thus blurring the image slightly. All flashes work like this even the most expensive studio units.
As you can see I didn't end up using the laser diode I attached to my circuit but an external one. The reason for this is that the laser cable I had was really short and had I wanted to use it I would have need to bounce the beam off a mirror on the other end. This is what I will ended up doing on my second try (keep reading to see this in action). Setting up the laser is very simple. There is an LED in the circuit that lights up when your laser hits the photo cell, so I placed the laser in some putty to hold it still and aimed it at the photo cell. I used regular putty first but it kept slowly melting so I had to switch to "museum putty" which is much harder and holds very still.
The process to take the pictures is very simple. First set the camera to BULB mode so that you can control it via our circuit. Then push the trigger on the camera remote release shutter that is connected to the circuit. This puts the circuit into "armed" mode. Then drop the item (in my case a marshmallow) so that it trips the laser beam on its way down. The first time you do this, you haven't calibrated the delay yet so the camera will take a picture and trigger the flash most likely at the wrong time. This means that when you see the picture the object might be either too early in the fall or too late. The delay trim pot adjusts the time that the circuit waits to shoot after the laser is tripped. This requires some trial and error but once you set it right you most likely don't need to set it again.
In my case I was shooting tethered to Capture One. This is an awesome software that has very nice RAW image processing. It is expensive as hell and I only used it because I had it for free (it came installed in the notebook the photography school lent me). You can also do this with Adobe Bridge or Lightroom. Note that you don't need to shoot tethered; you can do this with just your camera with exact same results. Shooting tethered has nothing to do with this technique but with general studio workflow and for this project I liked to do it as I could instantly see my shots in a big screen and check my focus and histogram very easily.
Step 4: Milk Splashes
I had done this before without this circuit and in two hours work I ended up with just two good pictures. The main problem was releasing the camera's trigger at the right time. This is insanely difficult and results in a lot of frustration. With this circuit I took around 50 shots and almost all of them ended up just perfectly timed. This circuit allowed me to concentrate on the artistic aspect of the shoot rather than the boring and mechanical "getting the timing just right".
The images you see here have been edited with Lightroom to make them snappier. The only things that I edited were exposure, contrast, color balance, crop, and I added a nice texture overlay in one of them. Nothing else has been either added or removed or "Photoshopped". This is what came out of the camera.
I added a pink and orange tint to a couple of the photos. I think these are really cool shots and ironically they are mistakes! My wife was helping me drop the marshmallows while I handled the camera and computer. Since we were doing this in the dark it was very hard for her to know exactly where to drop the marshmallows and sometimes she missed the laser. In these two pictures, she reached for the marshmallows in the tray and as she was pulling her hand out she accidentally tripped the laser with her hand. So what you see in these images is the milk flying up as it followed her hand! Really cool!
What you see in the last picture is... 2 gallons (7.5 liters) of spilled milk. As I was cleaning up and tearing down I grabbed the developing tray and what I thought was just a small crack on the side of the tray turned out to be a deep crack that ran pretty much all the way to the middle of the tray. This made the tray almost snap in two and made me spill almost all of it's contents. As I was balancing myself trying to put the tray back in the table, I managed to spill milk all over myself and the circuit. Fortunately I had already packed everything else. Amazingly the circuit wasn't damaged at all. What you might not realize is that dried milk leaves a really nasty smell, and my circuit now emits a very distinct putrid odor. A special thanks goes to the guy working the supply room that helped clean all the milk on a Sunday evening!
Step 5: Water Splashes
In this next setup I had some help lighting the white background. I asked my teacher Bruno Debas (check him out, he has an incredible portfolio!) to give me a hand as I had never successfully lit a white background. As it turns out there is a trick to getting a perfect background: it has to be around a 1/3 of a stop brighter than the subject, that's it! So after some time setting up we were ready to shoot.
Notice that in this setup I used the laser attached to my circuit so I had to bounce it from a mirror across the subject. This ended up being a royal pain as the slightest movement would result in the laser beam not hitting the photo cell. From this experience I bought a bigger 10mm photo cell and replaced the regular one I used.
This time instead of milk I used a $1 clear plastic glass, some fake ice cubes the school had, and food coloring to tint the water. At some point I attempted to add a lemon wedge (a real lemon) but I had to add an extra speedlite to light it and it didn't end up looking that great.
This was a really fun and rewarding project. Hopefully you will give this a try and create beautiful images like I have!