Flash trigger with power control

Thanks to Strobist I was looking for a cheap power-controlled flash because the ancient Vivitar 728 Zoon N in my collection is a dedicated unit that can only fire at full power on a non-Nikon camera. Buying another flash was certainly an option, but the strobist-way is to solve problems by thinking instead of throwing equipment and money at then.

So let's just emulate a Nikon camera (and add an optical trigger while we're at it)!

Flash with a small circuit on top
EOS-20D, 1/250s f/8.0 ISO 100, internal Flash -1EV, external flash on lowerst power

I have no idea if this little project will work with any flash other than my particular one, so the ususal disclaimer applies:

May or may not work for you. If any of this destroys/damages your flash, camera, remote trigger, house, life, etc/ruins a once-in-a-lifetime photo opportunity/gets you arrested for carrying around something that looks like a bomb/etc. it's your own fault and not my problem. You have been warned. Please to not try to build your own version of this without a basic knowledge about electronics and programming. I don't have the time to hand-hold anyone through building this.

All the code below is licensed under the GNU General Public License Version 2:

Nikon hot shoe pinout

This is the pinout when looking at the bottom of the flash:

|o    |
|2 3  |
|  O  |
|4   5|
|o   o|

The actual functions are most likely more complicated than this (and will certainly include a digital protocol between camera and flash to transfer the lens/shutter settings), but this was enough for my flash and this project:

You might notice that I added my own connector to the base of the flash in the picture, but it is just a more convenient way for me to get at the pins I need - a hot-shoe with Nikon contacts would've been much more expensive.

Random notes

The circuit was created from parts I had lying around already, the ATmega88 is actually a much larger controller than required. The code could easily be ported to an ATtiny24 which is half the size of the m88 physically (14 pins instead of 28).

Usage of the DIP switches:

1-3 - Power level
Binary-encoded power level, switch 1 is the LSB. All-off is the lowest setting.
4 - No preflash
With switch 4 off the optical trigger input ignores the first flash because many digital cameras use a pre-flash to measure exposure. To trigger on every flash, set switch 4 to on. If the second flash doesn't occur within about 0.25 seconds the code will assume that it was just a stray impulse and wait for another pre-flash.
5 - unused
Reserved for future expansion
6 - Power on/off
I was unable to open the flash completely and I didn't want to have yet another wire to the battery door, so the circuit is powered by a coin-cell battery.

If you compare the circuit diagram and the photo you'll notice that the diagram has a connector for external triggering that isn't in the photo. That's because I couldn't find any usuable ones in my collection of junk.

The flash still works on-camera (on a Canon, TTL on a Nikon may differ), but power control is only possible if it's triggered through the controller. If I really need it adding a sync-cord from the camera and isolating the center pin should work.