Super Simple Camera Flash Trigger

In this project we will be making a trigger for a camera’s flash. This flash trigger will be controlled with a microcontroller like Arduino. Today, I’m just covering how to trigger a camera flash with a microcontroller. Most likely you will also want to attach a sensor to a different port on the microcontroller and use that sensor to activate this flash trigger.

Some people might claim that using a microcontroller is overkill for a project like this, but I don’t think so. There are several advantages to using a microcontroller over one of a circuit like this. First I think using a microcontroller is easier to implement. Second you can modify the code to use multiple sensors or add in any delays you want. It’s just a more robust system and it doesn’t cost that much more. You can get an Arduino microcontroller for around $35.

Here is an article I wrote describing different sensors you can use with this flash trigger circuit.

The first thing you need (besides a microcontroller which I assume you already have) is a female hotshoe to use with your flash. I bought this one for $20. It was cheap and it uses a standard 1/8 inch jack. This is much better than the flash sync cables that are notoriously unreliable, but any hotshoe should work so if you have one with a standard sync cable use it. All that needs to be done to trigger the flash when it’s in the hotshoe is to short the two wires or contacts. I used a optoisolator (here’s the datasheet)as a switch. Optoisolators have the added benefit of protecting my Arduino board from any voltage spikes that might occur on the flash.

The software for this project is very simple. I just send a high signal to the optoisolater for 1/10 of a second when the spacebar is pressed. This triggers the flash.

// Maurice Ribble
// 4-9-2008
// http://www.glacialwanderer.com/hobbyrobotics

// This code just lets you turn a digital out pin high for a short time.
// That's all that is needed to verify the flash circuit is working.
// Press the space bar to trigger the flash.

#define CAMERA_FLASH_PIN 4

void setup()
{
  pinMode(CAMERA_FLASH_PIN, OUTPUT);
  digitalWrite(CAMERA_FLASH_PIN, LOW);
  Serial.begin(9600); // open serial
  Serial.println("Press the spacebar to trigger the flash");
}

void loop()
{
  int cmd;

  while (Serial.available() > 0)
  {
    int cmd = Serial.read();

    switch (cmd)
    {
    case ' ':
      {
        digitalWrite(CAMERA_FLASH_PIN, HIGH);
        delay(100);
        digitalWrite(CAMERA_FLASH_PIN, LOW);
        break;
      }
    default:
      {
        Serial.println("Press the spacebar to trigger the flash");
      }
    }
  }
}

10 Comments »

  1. nick.teel said,

    November 12, 2008 @ 1:59 am

    Hi, my name is Nick and I am a Houston performance artist looking to put on a show soon that will incorporate sound and strobe lights. Essentially I will have a 2.5 min. wav. track of applause and cheering that will rise and fall in volume. I want to translate these “waves” of sound into a similar wave of strobe lights, so that as the cheering grows louder so do the strobes frequency. My question for you is: How would you hook up a strobe light to the Arduino instead of a camera flash, seeing as the strobe is controlled by a pot? I read your article on triggering a flash with sound thresholds so I think I will be able to handle the input of the wav. track. My hang up is how to get the Arduino to communicate with a string of strobe lights. If you could possibly point me in some direction I would greatly appreciate it, im pretty lost right now. Thanks. NICKTEEL.

  2. Glacial Wanderer said,

    November 12, 2008 @ 7:56 am

    I’m not familiar with the strobe you’re talking about, but it seems like you use a pot to adjust how frequently you want the strobe to be activated. So all you need to do is use the audio to adjust a resistance. Using a voltage controlled resister would handle this. I’ve never used one, but a search yielded this page: http://freespace.virgin.net/ljmayes.mal/comp/vcr.htm. I’m sure there must be premade circuits that make this easier if you search around.

    Another solution would be to just use a stepper motor or servo to adjust the pot. While not as elegant this would be easier for me since I have done this sort of thing before.

  3. chris said,

    January 24, 2009 @ 2:37 pm

    I’m trying to make the basic flash circuit and having some problems. I ordered the optoisolator from spark fun and I’m using a Vivitar auto 215 flash. I don’t have a 50Kohm resistor, but I’m using a 47K and three 3K resistors, which may or may not be a problem. Other than that I believe the circuit is built correctly.

    The flash only goes off once when the alligator clips are being connected. If I remove a clip and put it back on it will fire when the alligator clip touches it but then remain unfired. It’s almost as if the circuit is staying closed all the time rather than osciallting back and forth.

    Not sure if any of that made sense, but I’d appreciate any help you could give me. Any ideas?

  4. Anonymous said,

    February 8, 2009 @ 8:30 am

    Chris,

    I believe the diagram calls for a 50 Ohm resistor, not 50 Kilo Ohms… :-)

  5. Ryan said,

    February 21, 2009 @ 11:02 pm

    Hi,
    I built the circuit with the correct resistor values but I have the same problem as Chris above. Maybe it is the brand of flash I am using (Promaster 1700) but when the flash is fully charged the voltage across the terminals is approx 270 volts and I have blown an couple power mosfets testing stuff out and the optoisolator you say to use. Am I doing something wrong or is there a component swap you could suggest.
    Thanks.

  6. Glacial Wanderer said,

    February 22, 2009 @ 7:10 am

    I believe 270 Volts should be ok since the whole point of the optoisolator is to isolate voltage spikes. Try adding the 100 ohm resistor from pin 3 to ground shown in this diagram to see if that fixes it. Also make sure the flash isn’t attached in reverse causing large negative voltages. It would be great if you could report back if any of this fixes your problems.

    http://www.sparkfun.com/datasheets/Components/PS2532-Example.jpg

  7. Ryan said,

    February 22, 2009 @ 11:34 am

    I added the resistor that the sparkfun schematic suggested earlier this week when it doesn’t seem to help. The flash triggers sporadically like maybe 5% of the time like if the flash has had more than 30seconds to recycle and if the batteries are really new. I have been trying really hard with this circuit the past week for a time sensitive project. I am not an expert but I think maybe the internal circuitry may vary from flash to flash and influence how effective the optoisolator is. Let me know if you have any ideas. Thanks.

    I am thinking about trying this circuit also
    http://www.flickr.com/photos/mcveja/2279980403/
    but I would have to wait for the parts I would like your way to work because I already have them.

  8. Tia Sok said,

    April 10, 2009 @ 5:11 pm

    Hello,

    I am station in Hohenfels, Germany. I am looking for a laser trigger for my Canon D1 Mark II, Can you tell me of how I am able to get one. Can you build me one?, I am going to use it to shooting while life photography for school. please email me back if you can help me. Thank you.

  9. Ben said,

    August 18, 2009 @ 2:13 am

    You are one awesome guy!

    I’ve just put together both your flash trigger and the lightning trigger and both have worked as described!

    I couldn’t get a hold of the optoisolator in your description where I live and used an MOC3021 Triac Coupler which seems to do just fine with my flash (Starblitz 250BAZ).

    The pin configuration for theMOC3021 Triac Coupler was:
    1 – positive
    2 – ground
    6 and 4 for the flash leads.

    Thanks for all you work and tutorials!

  10. Ellen said,

    September 15, 2009 @ 5:19 pm

    I find this project to be extremely interesting. Thanks for sharing it with us. But I know very little about electronics so I am having a bit of trouble understanding how the circuit works. I’ve googled till I’m blue in the face but haven’t been able to find anything that helps me understand. Can I impose upon you folks to give me the Idiots Guide to Optoelectonics?

    How does an optocoupler such as the PS2532 used here work? I’ve been looking at the datasheets for this one and many others and have seen them in various flavors… transistor output, darlington output, triac output, base connected or not. Does it matter which type one selects for an application like this, so long as one always connects the flash to the collector and emitter outputs? And of course select one with sufficient voltage handling for your flash. Speaking of which, would that be the Vceo specification in the datasheets?

    I think I understand enough of what I see here to know that the Arduino program is setup up to send voltage/current to pin 1 of the coupler. But what I don’t get is what is happening at the flash side of the coupler. I’ve read information that leads me to belive that the optocoupler is acting like a switch. So does that mean that when voltage/current is sent in on pin 1, that the electrical switch inside the device closes and essentially shorts the center contact of the flash to ground, thereby triggering it to fire? And the isolating properties of the optocoupler keep the input and output sides… well, isolated? In this application to keep the sometimes extremely high flash voltage from getting into the Arduino and frying it?

    I apologize profusely for the noob questions. But I’d be grateful if someone could help me learn what’s happening with this very cool project.

    Thanks in advance

RSS feed for comments on this post · TrackBack URI

Leave a Comment