Home Projects Arduino Flash trigger with Arduino
20 | 05 | 2012
Flash trigger with Arduino

This article describes how to create a device that is triggers an external flash when an object passes through a beam of light, thus making it possible to take pictures of objects (or events) that are otherwise too difficult to capture because of their speed.

The device uses an Arduino microcontroller board which is ideally suited for prototyping, and a handful of general purpose electronic components that are fairly cheap. They are also not critical, meaning that they can be easily substituted by equivalent components.

A separate article has been written on how to set up and use this device. 

Some of the photographs I made with it are posted in the Photography section.

I wanted to capture the splash that objects make at the moment they fall into a liquid, but this is pretty hard to do if you operate the camera yourself. The drop itself only takes a few milliseconds and you have to take into account the delay of the camera, light, etcetera. I figured there would have to be too much luck and too much time involved, doing this without electronic assistance. So I took to the drawing board and used a combination of hardware and software to help me out.

The principle of operation is easy:

  • set up the camera (use a tripod), flash, a bowl of liquid and the objects you want to drop into it
  • create an optical 'gate' consisting of a small laser directed at a photo transistor
  • darken the room
  • open the camera shutter
  • drop the object through the laser beam
  • trigger the flash at the right time with the Arduino and associated electronics, capturing the drop
  • close the shutter

The time it takes for the object to travel from the point it interrupts the laser beam till it drops in the liquid depends on the shape of the object and the material it's made of (think: drag) as well as the distance between the beam and the surface of the liquid, so it should be easily adjustable. It should also be easy to align the laser and the photo transistor, without triggering the flash unnecessarily.

Electrical schematic

Here is the electrical schematic (click it for the full size version), created with Eagle. I shall discuss its parts below.

Schematic

Laser and detector

The laser is a DLU02 red laser module which needs just 7-18 mA to operate, so it can be driven from a digital output. Resistor R2 is used to limit the current through the laser.   DLU02 laser module

The detector is a BPW40 'Silicon NPN Epitaxial Planar Phototransistor'. This think looks just like an LED, so don't throw it in with the other unsorted parts because you will not be able to distinguish it anymore...Initially I thought about using an LDR,but I had my doubts since they appear to react a little sluggishly. Moreover, my electronics vendor told me that LDRs are on their way out because of the Cadmium used in manufacturing.

The phototransistor is hooked up to analog input 1, which is held low by R4 when the phototransistor is not illuminated. When illuminated, analog 1 will go high because the phototransistor conducts. This is the  normal situation. When an object interrupts the beam, analog 1 goes low, which is detected by the Arduino software.

Flash control

The external flash is controlled through a 'hot shoe' adapter which I modified to bring out the leads to the flash contacts. Modified flash hot shoe The voltage on my Bauer E436 flash contacts is much to high to switch it with the Arduino directly: 260 Volts. To keep the high voltage as far away as possible from the Arduino, I separated it electrically using a TIL111 optocoupler. Basically, a control signal fro digital pin 8 switches on an LED inside the optocoupler. The light from the LED hits a phototransistor (also inside the optocoupler) which then creates a path for the +5V from the collector (pin 5) to the emitter (pin 4). Pin 6 of the optocoupler is not used.

The TIL111  cannot deal with the high voltage of the flash either, so it in turn switches on the TIC106D thyristor. The thyristor conducts, the flash is triggered, and when the voltage over the thyristor is zero (flash ended), it isolates again.

TIC106 come in various versions (the 'D' can switch 400 V), pick the one that works best for your flash voltage.

Drop delay

To counter for the time between an object crossing the laser beam and it appearing at the proper position in front of the camera's lens, a delay function was built into the software. Because it's not very convenient to change and upload the software any time a delay adjustment needs to be made, I added an external potentiometer, R9. Its wiper is connected to analog input 0 and the other contacts to 0 and 5 V, so the voltage on the wiper is proportional to its position and varies between 0 and 5 volts. In the software this is then mapped to a delay that varies proportionally between predefined minimum and maximum values.

ARM switch

I want to be able to mess with the laser beam without triggering the flash all the time. For example to align the laser and the phototransistor and to determine where an object must be released to cross the laser beam.

Digital input pin 2 is normally kept logically high through R5, but when the switch P1 is pressed momentarily it goes low. This triggers a software interrupt in the Arduino, which 'arms' the flash circuit. Now when the laser beam is interrupted, the flash will fire. After that the circuit is disarmed automatically.

Status LEDs

LED1 (green) and LED2 (red) serve to indicate the status of the system.

When LED1 is on, the laser and the phototransistor are aligned properly. If the beam is interrupted, LED1 will be off.

When LED2 is on the system is armed for operation: beam interruption will cause the flash to fire. LED2 can only come on if LED1 is already on: proper alignment is a prerequisite for the circuit to operate.

Hardware integration

I gambled that all components would fit onto a proto shield - a circuit board that rides piggy-back on the Arduino and onto which I had glued a mini bread board. I almost won the gable: the potentiometer for the trigger delay had to move because there were not enough free rails. The resulting prototype looks like spaghetti... 

The flash's high voltage wires are loosely stuck into the bread board and I did not want the risk of one of them coming loose and frying the circuitry. So I bound the Arduino to a bigger bread board with some rubber bands and run the external wires (flash, laser, phototransistor) from there. This is also where the potentiometer has to live due to the lack of real estate on the proto shield.

The code

The code to go with the hardware was written for arduino-0013. It can be downloaded here. This so-called sketch is a .pde file, a plain text file that can be opened in any text editor and which your browser should be able to open as well. 

The comments in the code should be sufficient to understand what is going on. 

 


  
Comments (6)
  • Bruno

    Great job, thank you for sharing it! One question: when using a newer flash unit with a lower voltage, do I still need the optocoupler?

  • Martijn

    Hi Bruno,

    Thanks, I'm glad you like it.

    It's actually the thyristor that triggers the flash, and the optocoupler that switches the thyristor. Since I don't know whay kind of voltages and currents we're talking about here, I'd rather be safe than sorry and go with the optocoupler/thyristor combo. They are common parts and not expensive - much cheaper than an Arduino, in any case ;)

  • TG  - Thanks

    Hi!

    Thanks for sharing this....nice device :cheer:

    One question since I am playing around with the same phototransistor you are using! What size (Ohm) is resistor R4? ...and what reading do you get of the analogRead for the phototransistor?

    Mine is always on 1023 and with a 1mW (650nm) Laser pointed directly to it, it only drops to ~900.
    I suppose you use 1MOhm, right? Please tell me, would save me a lot of experimentin!!

    Greetings,
    TG

  • Martijn

    Hi TG,

    R4 is 2k2 Ohm, in other words: 2200 Ohm (red/red/red).

    I'm sorry but I don't know the illuminated-value for the photo transistor - I took this thing apart some time ago to build something else ;)

    I found that one has to aim the laser quite accurately on the photoresistor in order to drop the resistance the most. Also, think about the distance between them: in my setup the laser and photoresistor were approx. 60 cm. apart. The bigger the distance between them the lower the laser intensity will be.

    Finally, it could pay off if you'd use another phototransistor of the same type, depending on the tolerances between individual transistors...

    Martijn

  • TG

    Thanks for the reply!

    It works fine with a 1k resistor and I feel incredibly stupid for the mistake I made :pinch:
    I had the transistor the wrong way!!!
    Would have worked in the first place if I had read the Datasheet more carefully :lol:
    I just figured that it had to be the resistor because of the small difference...

    The aiming is no problem since both laser and resistor will be in fixed places. I got it to work from a distance of ~5meters (with a shitty old laserpointer) so that's way more than enough :cheer:

    Anyways...thanks a bunch for your help!

    Have fun,
    TG

  • Martijn

    I'm glad it works now, and that you did no damage to the phototransistor :)

    I don't have the datasheet around, but with a 1k resistor the current through the 'tor is about 4 mA when it's fully conducting. You may want to check the maximum allowed, but I don't think it's a problem.


    Greetz,

    Martijn

Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):S
Security
Please input the anti-spam code that you can read in the image.
Last Updated on Thursday, 14 May 2009 13:34