Drops of water

OK, this isn't very innovative, but it's still a fun weekend project. The setup starts with a transfer pipette, with a tiny hole made on top so that any water inside will slowly drip:

This is followed by a jury-rigged optointerrupter: a fairly standard IR diode, a matched phototransistor, two 5 mm nylon spacers, top half of a polypropylene beaker, and copious amounts of hot-melt glue. The diode is connected to +5V through a 220 Ω resistor; the phototransistor uses a 10 kΩ one, in the usual topology. That's good enough to detect the light that gets refracted by a passing drop of water:

Next up is a clear plastic box (recycled packaging from an electronic gadget of some sort) and ATmega48P running at 20 MHz with an eight-line program that monitors the phototransistor, waits 80 milliseconds (chosen very empirically), and then turns another pin on for approximately 50 microseconds (ditto):

The MCU is hooked up in a textbook fashion, the only external components being a 20 MHz crystal and a low-ESR capacitor. The program is just this: while (1) { while (!(PINC & 1)); _delay_ms(80); PORTB = 1; _delay_us(50); PORTB = 0; _delay_ms(100); } A camera is placed on a tripod in front of the whole contraption. The exposure is manually set to several seconds, with all lights turned off. When an event is registered by the phototransistor, a power MOSFET connected to the output pin of the microcontroller will eventually light up a bank of 100 lumen LEDs operated at roughly five times their rated current (this doesn't kill the LED in low-duty, short-pulse applications). The LEDs momentarily illuminate the scene for 1/20,000th of a second, and the camera captures an image:

One of the nice things about LEDs is that they have rise and fall times of under a microsecond. That's considerably shorter than traditional camera flash, which lights up for around 1-2 milliseconds at high power (and goes down to about 50-100 microseconds only at lowest settings). In principle, LEDs could rival the motion-stopping powers of more exotic air-gap flash units.

All right, so that's it, let's showcase some photos (with a macro tube attached to Canon 50/1.8). There's enough light to shoot at f/11. Here's the moment of initial impact - I found this interesting because I don't think I have ever seen such a picture before:

Here's are two of the more conventional takes, taken within the next 5 milliseconds or so:

And these are from earlier experiments with longer exposures (1/5,000) and fewer LEDs - still OK, but a bit more blurry:

After about 10 miliseconds, the pretty part is over, and all you can see is a series of waves spreading away from the site of impact.

Contact

Questions? Comments? Ping me at lcamtuf@coredump.cx. Oh, and if you liked this, how about a mirror, too?

Your lucky number: 16075620