You Are Here: Home » AVR ATmega Projects » Slaveflash-trigger for digital cameras with Attiny24

Slaveflash-trigger for digital cameras with Attiny24




When flashing with digital compact cameras, the camera usually uses several small flashes before making the actual picture. This is o.k. if the built-in flash is the only flash you have, but if you want to use an external second flash you have a problem: The second flash, also called slave-flash, fires if the master-flash fires. But most of the flashes are to slow to provide three or more flashes in such a short period of time as the digital camera fires them. The digital cameras use not all the energy on the measuring flashes and expensive modern flashes do it the same, but hey we don’t need this over-priced stuff, we built them ourself.

With this device you can chose how many pre-flashes you want to ignore until the slave-flash should fire. So it is suitable for nearly all cameras and all flashes.

With a slave flash you can make really crazy pictures.

But let’s start!

Step 1: What you need

Well this instructable is something between electronics, photography and software. In just the right portions, oh I like it…

You need experience with the Atmel AVR microcontrollers and a possibility to flash them with a programmer. Getting startet with AVRs is really easy because there are a lot of good tutorials on the web. The Arduinios are just AVRs with a special bootloader to make it even more easy to programm them, but the extra bootloader costs some cents extra. So I decided to go for the real thing.

Then you need an old, but still working flash and some small electronic parts like resistors and so on. A soldering iron would be helpful too.

The complete material list is:
Part Value

R1 100k   near the photo-diode
R2 10k    pull reset pin high
R4 300    to the opto-coupler
R5 470    to the LED
R6 1k      to the reset-button (I didn’t use this)
R7 1k      to the hex-switch (I didn’t use this)

C1 2.2n   between the photodiode and the pin PB2
C2 100n  Voltage regulator
C3 100n  Voltage regulator
C4 10u    Voltage regulator
C5 10u    Voltage regulator

IC1 ATTINY24/44/84-PU The microcontroller
IC2 7805TV the voltage regulator

LED1 green the green LED
OK1 MOC3021M an opto-coupler
PHOTODIODE BP104 the sensor

Resetbutton
S1 4bit rotary selector

an female flash-shoe with a tripod connector, no special function needed, take the cheapest you can get.

Step 2: Start with the flash-shoe

 flash-shoe

There are two possibilities to interface a flash:
The first: Open the flash and directly solder small wires to the parts that release the flash. Advantage: Very elegant way to interface the flash. Disadvantage: Most flashes are hard to open and contain really harmful things inside them (a loaded capacitor for instance).

The second: Use an adapter to interface the flash. Advantage: The flash itself is not altered, you don’t lose warranty and you can still use it with you camera. And you can use various flashes with the same slaveflash-trigger, but not at the same time of course.
Disadvantage: It’s a bit of a hustle to get this working.

How is the flash triggered?
If you look at the flash, there are two small connectors in the flash shoe. One on the side and one in the middle.
So we have to get two cables connected there. Look at the picture to see how I did it.

Now you can already test your adapter. If you turn on the flash and mount the flash shoe you should be able to fire the flash when you connect the two wires. If this is not working you have made something wrong.

Step 3: Start with the circuit

the circuit

Before I start to solder such a circuit I usually test it on a breadboard.

If you provide a voltage of 5V and below from a battery then you can skip the part with the 7805-voltage regulator and directly source the microcontroller. The whole circuit uses 2mA in standby, so a small coin cell would be empty very fast, that’s why I chose to power the flash and the controller from the same source, making it less complex.

I cant’t help with the circuit itself, because everybody has other parts in different sizes and you have to figure out which pins you need to connect by yourself.

A funny thing actually happened when I tested the device. When working with the breadboard I usually did tests in the evening under rather dim lightning conditions. But I soldered (and tested) the board under a bright lamp at my workbench. So it turned out, that it didn’t recognize any flash I made, even when I flash it directly in front of the photodiode. It took me a while to find out, that the photo-diode was much so sensitive and I had to cover up some of it. So I used some sticky tape and painted it black, and voilá it worked!

Step 4: Program the micro-controller

Now that the controller and the board is ready it is time to program the micro-controller and add it to the board. As you can see there is no way to program the microcontroller inside this circuit. But because I tested the software on the solderless breadboard before I don’t need this, and it makes the device much easier.
You can either use the provided code or write your own, it’s not that hard.

How does it work?
The main part is the photo diode which is used as a sensor here. When there is no light or only a little bit, the diode will block. But when a flash-light hits the diode it will become conductive for a short period of time. Together with the 100k resistor it forms something called an voltage divider.
So while the diode blocks, its resistance is much higher than 100k and the pin PB2 will have nearly ground potential.
When a flash is detected its resistance becomes much lower than 100k for a short period of time and pin PB2 will recognize a high signal. This triggers an input-interrupt in the software.
The capacitor is necessary to decouple the pin from the diode. Without the capacitor the small current delivered by the diode during the flash would not be sufficient to trigger the interrupt. Maybe someone has a better explanation for this effect. Anyway it works.

When a flash is recognized by the micro-controller, it is counted and if the number of flashes counted equals to the number of flashes needed, then the slave-flash fires.

The number of flashes needed is read in after start-up from the 4bit rotary switch, with it we can set up to 16 preflashes.

The opto coupler is needed because flashes often have more than tens of volts at their connectors. and this would surely kill our small micro-controller. It is in principle another photo diode together with an LED in a closed housing. If you light up the internal LED, the diode gets conductive and shortens the two outputs which then fires the slave-flash.

As an extra bonus a timer/counter was enabled to reset the whole device if more than one second without a flash is recognized. This has the following reason: If you take pictures at a party and other people take pictures and flash, your flashcounter gets preloaded and doesn’t flash at the right time. After some flash just wait for 1s and the flashcounter is reset.

For more details, click: Slaveflash-trigger for digital cameras with Attiny24

 

 

Leave a Comment

You must be logged in to post a comment.

Read previous post:
LED pulsing
Apple-style LED pulsing using a $1.30 MCU using ATTiny85 microcontroller

The Atmel ATTiny85 chip is an 8-pin MCU that is totally awesome.  If you've been programming with the bigger boys...

Close
Scroll to top