Monday, March 24, 2008

Darkroom Timer & AVR

My darkroom timer died. Unfortunately it died in the middle of processing the first two test shots from my 4x5 KAP camera. Luckily it died in a way that I could tell it died, so I finished out the rest of the processing by counting in my head. I over-developed, but I wasn't after exposure so much as information on focus. (Focus was off.) The next two shots I timed by having my wife read time through the door to me. She would've rather been reading. (She said so... but I really did figure it out for myself, first.)

To finish matters off, it started working again some time in the middle of the night. I was very thankful that my wife only shoved it into my hands at 1:30am rather than ramming it down my throat. It woke her up. I figured "never again" would be a good motto to adopt at this point.

In case you're wondering, my darkroom timer has been a Timex Ironman wrist watch with the timer set up as a Countdown and Repeat. Every sixty seconds it beeps for ten seconds, and keeps counting. I keep count of the beeps, and that tells me how many minutes have gone by. Since my developing times are almost invariably 8min developer, 1min stop, 10min fixer, (lights on) 10min rinse, 1min photoflo, sixty second resolution isn't bad.

I looked at commercial timers, but they all seem to be made for paper, which is not panchromatic. So they glow! Glowing kills my film! Besides, I couldn't afford any of the ones I saw. So I made a new one.

I wanted something that didn't emit light, something that replicated what the Ironman watch did, but that was smart enough not to wake people up in the middle of the night. Besides, the alarm on my watch is ear-splitting. I wanted something a little more muted since I do most of my developing once people are in bed.

I hemmed and hawed around the problem for a while, but finally hit on the solution yesterday: An AVR Butterfly!

The AVR Butterfly is a demo board for the ATmega169, an 8-bit microcontroller from Atmel. The Butterfly has a 169 running with an internal oscillator at 8MHz, and also has an LCD display, a temperature sensor, a 32.768kHz crystal, a small joystick, a buzzer, and if you have one of the older ones it has a CdS light sensor on it as well. All for under $20 US. Can't beat it!

In a way this application is an insult to the Butterfly, which has loads of capacity. One really cool application I've seen turns the Butterfly into an AVR programmer. You load your .HEX program file onto it, and you can plug it into the ISP port of any AVR processor and it'll load the code without being tethered to a PC. Perfect if you're mass-producing an AVR-based product.

But all I wanted was a darkroom timer...

The application is a free-running real-time clock using the 32.768kHz watch crystal to generate a system interrupt once every second. The CdS light sensor is used to tell if the darkroom lights are off or on. If they're off, the buzzer operates once every 60 seconds. If the lights are on, it's silent. The joystick is used to reset the timer to zero. There really isn't much to it.

So what about night-time? The AVR Butterfly has a button cell mounted on the back of the board. Take out the button cell. It's off. No power, no clock, no noise. And it saves your battery to boot. No more midnight wakeup calls!

Here's the best part: The AVR Butterfly was originally designed to be handed out at embedded processor conventions, so (true to geeky form) it's got a jewelry pin on the back so you can pin it to your shirt. Yeah, you can imagine how goofy it would look to see hundreds of people wearing LCD displays on their shirts. Don't laugh! I've done this, and even had a scrolling message rolling across it! (It was a kids' festival, and I was promoting our robot club... cut me some slack.)

So to use the timer you just install the battery, pin it to your shirt, set up your darkroom while the timer just counts quietly to itself, and when you're ready you turn off the lights, unload your film holders, wait for the first beep, and slip the sheets into the developer tray. You're off!

I doubt there are more than a handful of people out there who would use one of these. But if you find yourself in the same situation I was in (busted darkroom timer, furious spouse ready to ram things down your neck, and an AVR Butterfly sitting on the shelf) I'll happily upload the .HEX file for you to load on your own Butterfly. And if you're really interested, I'll happily share the source as well.

Tom

No comments: