Archive for May, 2010

Shutter timing arduino code

This is a follow-up to last weekend’s video about using an arduino to time camera shutters.

Here’s the source, in its diminutive glory:
Continue reading

Benchmarking camera shutters

Happy Saturday, here’s my nearly incoherent video about timing camera shutters with electronics. I never script these. Consequently, when editing, I often wonder precisely what the hell I’m talking about.

I naively thought this project was going to be a one-nighter. The setup seemed pretty straightforward, but I was surprised at the inaccuracy of arduino’s built-in micros() function. After I got the photo diode and laser working correctly, I noticed that the value returned by micros() was sometimes much higher than it should have been. Maybe it was just my code?

In this case, a better way of getting moderately high-frequency timing from an Arduino is to use an interrupt to count the pulses of an external oscillator. In this video, I’m doing it pretty old-school, with a beloved 555 timer. With some trimmer resistors I think I was able to get the frequency fairly close to 10,000 hz, as confirmed by the oscilloscope. I guess the accuracy of this setup will wander with ambient temperature, but that’s fairly easy to control.

Of course, the laser is totally unnecessary. You could do this with any bright light, so long as you can keep the photodiode in shadow when the camera shutter is closed.

The resistors I used for the (reverse biased) photo diode were about 500k and 50k. In my house, with these resistors and with my light source, the arduino’s analog input reads the PD output at ~20 in the dark and at a hard 1023 when illuminated.

The 555 timer components were ~4400 ohms for R1, ~5000 ohms for R2, and .01 microfarads for the cap.

EDIT: Source code now available after the jump.
Continue reading

Just sayin’

Left: a 100-ton steel cap BP hopes will temporarily contain the leaking oil well. Right: the crumbling concrete sarcophagus Soviet officials hoped would contain the radioactivity at chernobyl.