Introduction: High-Speed Droplet Photography With an Arduino
This Instructable is meant to be a supplement to a video I made on the same topic, which can be found here:
I recommend watching the video for a summary, and to see some interesting stop-motion impacts, and then use this guide for details on how to build your own setup.
High-speed droplet photography is an awesome convergence of science, photography, and art. The main idea is to capture the complex fluid dynamics that occur when droplets impact surfaces of water, each other, the splashes of other droplets, the films of soap bulbs, and many more interactions. It sounds nerdy, but for some idea of what results can be obtained, even for a complete novice like myself, take a look at the photos above.
If you're not convinced, check out these photos taken by people experienced in the art of droplet photography:
The goal of this Instructable is to introduce people with some experience in photography and electronics to the wonderful world of highspeed droplet photography. The information presented here is enough to get you started without having to buying expensive equipment (products do exist for this kind of thing).
Step 1: Things You'll Need
The goal of highspeed photography is to freeze, well, highspeed motion. The shutters in even the best cameras aren't always quick enough to stop the motion of things that happen on very short timescales, like the impact of two water droplets. Moreover, camera shutters, at least in DSLRs, typically sweep down the height of the sensor. This means that weird artifacts may appear as a result of how the sensor is exposed.
The key to highspeed photography is to expose the scene with light, rather than with the camera's shutter. To accomplish this, we need a flash source that will operate at very fast speeds. Any off-camera flash, or "speedlite", will suffice. The important thing is to make sure it is adjustable, because it is the lowest flash settings we'll need to use to achieve pulses short enough to freeze the action. If you use the brighter settings, then the flash pulses are long enough that your fast-moving object will appear blurry.
According to http://speedlights.net/speedlite-test-details/, the brightest flash point (highest setting) lasts about 4ms (1/250s) and the shortest about 50 nanoseconds (1/20,000s).
Parts list (not all items are required)
Here are a list of items that I used for my high-speed droplet photography setup:
- Altura Photo off-camera flash (https://goo.gl/Ii4g1w)
- Arduino (An arduino starter kit has most of the components you'll need (https://goo.gl/qgKeUx) -- That said, I personally used an Arduino Leonardo, with components I already had laying around.
- A solenoid valve. This isn't the same solenoid that I used, but it's cheap, 12v, and has simple 3/4" threaded adapters (https://goo.gl/STQ9Wn)
- A camera with a manual mode. My camera was a Canon 70D, but any camera with manual control should work (https://goo.gl/17ga72)
- Extension tubes -- expensive ones (https://goo.gl/IrlGyp)
- OR Extension tubes -- cheap ones (https://goo.gl/kRGa7o)
- Sync cable for the flash units (https://goo.gl/1atGSb)
- A lens, preferably ~100mm focal length. Mine is 24-105mm EF F/4 lens I used: (https://goo.gl/Hega3O)
- 2x NPN Transistors
- 1x N-channel MOSFET
- 3x 10K resistors
- Jumper wires
- Appropraite input/trigger cable for your camera
If you're not a photographer, but you're thinking this might be a good project to whet your appetite, then here are a few affordable-ish entry-level DSLRs
- Nikon D3400 with two lenses ($596) (http://amzn.to/2jS69jk)
- Cannon EOS T5 refurbished (359) (http://amzn.to/2j7xNVr)
You might also be able to trick an existing camera into shooting long exposures. If there's no manual mode, and you shoot in a dark room, cameras will either bump up the sensor sensitivity, or lengthen the exposure.
Here are some other items that can be improvised, but that you'll need:
- A stand of some sort to hold your droplet source (whether it be a solenoid coupled to a water bottle, or a ziplock back with a hole punched in the bottom). My stand is obviously very improvised (see photos).
- A dark container, with little or no brim to serve as a splash zone. It should be deep enough to allow a splash to fully develop (2-3cm is good for small droplets), and ideally be matte black to prevent unwanted reflections and increase contrast.
- A tripod, or some other improvised stand. The tripod I used can be found here: https://goo.gl/yu5d1m.
- Nozzles, plastic or bronze (if your using a solenoid valve).
- Colored paper, or white paper, to bounce light off of and create cool effects.
A note about extension tubes
If you have a macro lens, use that. They're designed for this kind of thing, and will serve you much better. However, these can be expensive. Extension tubes change your plane of focus by moving a lens away from the camera. The effect is that the lens is able to focus much closer than it'd normally be able to. The great thing about extension tubes is that they're cheap. They're just empty tubes. The bad thing is that the severely reduce your depth of field, and possibly reduce the sharpness of your image through aberration effects, but I don't have data on this.
Step 2: Setting Up a Droplet Apparatus
You have broad discretion on how you choose to setup your droplet apparatus, and how complicated you want it to be. Here are two methods that I used in my own testing.
Easiest and cheapest method:
The easiest and cheapest way to get your feet wet (pun intended) in water droplet photography is to just with a simple ziplock bag suspended from a height, and then just a poke a small hole with a thumbtack in the bottom. Then all you need is your camera and a flash unit. Set your camera to a long exposure, high f-stop, and low ISO. then open the shutter, and then fire flash manually when you think the timing is right. You'll end up with a lot of photos that aren't very interesting, but you can also get some very good results this way. The bigger issue with this method is that it would be very difficult to get a droplet to collide with the splash of a previous droplet.
The more-complicated, but much cooler method:
This method introduces precision control of the droplet release, opening of the camera shutter, and firing of the flash. This is done by using the solenoid to release the droplet(s), and then referencing all other actions from this moment. For example, a sequence of events might look like this:
prep: Fire camera shutter (1 or 2s window)
0ms: Release first droplet (10ms release time)
60ms: Release second droplet (10ms release time)
165ms: Fire flash
after: shutter closes
What that means is that you can:
- Do cool things like have droplets collide with the splash of previous droplets
- Sequence images by repeating the same series of events, but change the delay in which the flash fires -- this allows you to create some pretty cool stop-motion animations of the droplet falling, splashing, colliding, or whatever other actions you may be initiating. See the video in the video int he intro for examples.
- Be repeatable -- once you dial in the right numbers by trial and error, you can very reliably reproduce and tweak an event, which gives you more time to be creative
Setup up for the more-complicated, but much cooler method:
The setup is nearly the same, except that you'll replace the ziplock bag with a solenoid valve, and wire up your camera and flash units to a control device (see the next section for details on the electronics and programming). To feed water to my solenoid, I used some clear tubing, and a empty bottle full of water placed at a higher point relative to the solenoid. This way, the water is fed via gravity to the solenoid (assuming you prime the tubing first, much like you would when siphoning a liquid out of a tank). This isn't a great method, as it's complicated to change up working fluids. A better method might be to have a small container directly screwed into the solenoid, with an open top. With such an arrangement, it'd be easy to exchange fluids (dyed water, oils, coffee, cream, etc).
The rest of the magic happens in the electronics and programming, so on to the next section!
Step 3: Electronics and Arduino Code
The electronics for this project are extremely simple, and that's because the majority of the work is happening in-code. I'll talk about the hardware and software separately.
I've provided a breadboard hookup schematic, which represents my setup exactly. I'm using an Arduino Leonardo, but any Arduino board will work. I used 2 NPN transistors, 1 each for the flash and camera, and an N-channel MOSFET for the 12v solenoid. I used a computer power supply for my 12v source, but that's just because it was convenient. There are pull-up and pull-down resistors, each 10K. I allowed the Arduino to provide 5V to the 5V side of the breadboard, and had the Arduino connected at all times to a computer so that I could play with timings over the serial port (Arduino's interactive serial monitor).
Each NPN transistor is connected to the two wires coming from either the flash unit, or camera. For the camera, I wired up a jack appropriate for my camera. This jack has 3 connection points. A ground, a focus/meter, and a shutter. I connected the ground and shutter, and the NPN transistor closes this circuit for ~50ms when I want to trigger the shutter. It's a similar story for the flash units, except the flash units have only two connections. You can either connect alligator clips to the jack that comes from a sync cable to some jumper wires, or you could solder up some wires to your flash unit. Note, the latter method will surely void your warranty.
The MOSFET is connected from my load (the 12V solenoid with +12V power connected) to ground. This circuit is closed when the MOSFET pin is puled high.
Note: Be sure to connect your grounds when using an external power supply for a separate part of your circuit.
The software is very basic, and hasn't been designed in an elegant way, but it gets the job done. For the purposes of this article, it has two main operating modes.
The first mode is interactive. Meaning that nothing will happen, other than a test routine, until it receives user input from the serial port. If you provide 4 comma separated values via Arduino's serial monitor, it'll execute a sequence of events. The 4 values are:
(all in milliseconds)
- Time, from the release of the first droplet, you'd like the flash to fire
- Time the solenoid should remain open -- this controls the size of the droplet)
- Time, from the release of the first droplet, you'd like the second droplet to release.
- # of times you'd like to repeat the sequence -- there's some chaos involved, so sometimes you can get a variety of results, especially with splashes.
0ms: Release first droplet for (10ms)
60ms: Release second droplet for (10ms)
245ms: Fire flash
The camera shutter is assumed to be set >= 1s, and will be triggered before these events.
This mode is enabled by setting the bDoAnimation flag to true.
// stop motion settings
boolean bDoAnimation = true; // Do a timelapse sequence
int startI = 245; // start time
int endI = 260; // end time
int incr = 1; // ms increment to take shots between start time and end time for animation
The start time value is the time, in ms, that the flash will fire the first time around. The incr value, is the time step to use between frames. The end time is the time at which the sequence will be terminated. So the number of frames is (end time - start time) / incr.
The code is messy and has features included related to some other experiments I did. These are not discussed here in detail, and I will try to provide an improved version of the code soon.
Step 4: Tips for Taking Photos
I think photography is a process of iteration, so you should experiment and see what kind of results you get. I'll just provide a few tips that I learned through my own experimentation to give you a head-start:
- Shoot for 1-2 second exposure durations -- remember, it's the flash that freezes the action, not the camera's shutter
- Shoot at a high f-stop, especially when working with macro lenses and extension tubes, as your depth of field is already severely reduced.
- Shoot at a low ISO if you can afford to do so.
- Because of (1), shoot in dark room.
- Add backdrops, e.g. different colored pieces of paper, magazine clippings, etc, and position these around your water tray. Bouncing light off of these can create some cool effects!
- Use more than one flash unit, and experiment with placement. However: Be sure that the flash units are synced by having them all connected to the same circuit. Using the sync modes (S1, and S2) is far too slow for high-speed photography. I even had issues using RF triggers.
- Use a low setting on the flash unit, as this will give you the shortest duration pulses of light, and therefore the sharpest images.
Step 5: Taking It Further
The classic thing to do with droplets is smash them into the rebounding splash of a previous droplet. But there's much more that can be done, so go experiment! I won't discuss too much detail here, but if you watch the video, you'll see that I used my setup to karate chop falling droplets in half with a propeller blade spinning at over 1500rpm.
I've also experimented with dropping droplets through soap films and bubbles, and there's a lot of potential here. So I'll be pursuing this further. I've included a short 4K video in this section as a preview:
Go out there and see what you can do! If you do something cool or have a suggestion, please share it with me!
Runner Up in the
Arduino Contest 2016
tmilouz made it!