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");
      }
    }
  }
}

38 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

  11. Ernie Hatt said,

    February 22, 2010 @ 10:56 pm

    I also had trouble with the opto’s and changed it for a fast triggering SCR EC103D, this also fires the Camera as well. With my camera Olympue E520, it also focuses the camera as well. Ernie

  12. Norman Todd said,

    March 7, 2010 @ 9:40 am

    Would appreciate advice on arranging for a strobe (e.g., Vivitar auto 215) flash when a 65msec signal trigger is delivered to the audio output of a PC.

    Thanks

  13. Getting into Arduino said,

    September 11, 2010 @ 10:18 pm

    [...] Camera Flash with Arduino (Thanks to Hobby Robotics) – This site describes how you can use the Arduino microprocessor to trigger your camera’s flash. I went ahead and purchased a female hotshoe mount for my Nikon SB600 flash. That cost me around $20. Basically, you use an Arduino digital output and the optical isolator to short the two leads from the hotshoe cable. This causes the flash to… well… flash. When you press the space bar, the Arduino sees this and outputs a digital high signal. This causes the LED in the optical isolator to light up which causes the optoisolator of the isolator to short the output pins (3 and 4). Shorting these pins causes the flash to fire. [...]

  14. Joy D said,

    November 8, 2010 @ 6:08 pm

    Hi
    I am having the same issues as several of the posts above. I believe I have the pins in all the right places, but cannot get the flash to trigger with the space bar. This is my first time trying a DIY project so I have no idea when it comes to the technical lingo. If I looked at the image above and simply counted the holes on the breadboard to try and match your image, would that work or am I missing something critical? Any advice would be helpful!!

  15. Mike said,

    January 27, 2011 @ 10:20 pm

    Hi,

    I have also built a circuit similar to this, triggered by an IR emitter/detector. Like Ben, I have used the MOC3021 and it works fine with one flash that produces 85V across its terminals. when I try it with another flash that produces only 9V across its terminals, it doesn’t fire. I also tried a 4N32 optocoupler but had not success at all. I am also a noob at electronics, so reading the data sheets is like reading Greek to me.

    Why would the MOC3021 work with the first flash and not the second? What are the key elements in the data sheets that would help with this?

  16. Martin Hutchinson said,

    February 20, 2011 @ 6:20 am

    I was having the same problem as a few of the other guys in the comments. I got it right on the third time. The first time the opto wasn’t big enough – my flash pushes out ~230V when fully charged. The second opto had a high gain darlington output (the same as the one linked to in this post) but my flash didn’t like that. Finally I got an opto with a TRIAC output and I’ve got it working:

    http://memoryofafish.blogspot.com/2011/02/flash-of-inspiration.html

    Hope this helps you guys. Glacial Wanderer – good blog :-)

  17. Brett Levine said,

    July 10, 2011 @ 5:08 pm

    I bought a cheap (ish) flash from Target and found that although the 2532 optoisolator didn’t work, this MOC3031 Fairchild Triac did: http://www.fairchildsemi.com/ds/MO/MOC3042-M.pdf and it’s available from US suppliers like digikey.com. Just connect the flash to pins 4 and 6. Pins 1 and 2 are the same as Mike shows above. Thanks to Martin for the Triac idea.

  18. Blaise - Wedding Photographer said,

    August 9, 2011 @ 2:44 pm

    Hi,

    I am having the problem that the flash only fires once – I then need to disconnect everything for it to work again. The flash is blocked after the 1st flash.

    I use a opto MOC 3023 and a 47 ohm resistor South side (between opto out and ground).

    I tried this project using a LED instead (with its own Arduino power source) and it worked perfectly.

    I don’t have another opto to try – but I did try several flashes (I’m a pro photographer) with always the same results.

  19. Maurice Ribble said,

    August 9, 2011 @ 3:10 pm

    Blaise, this is a known issue with SCRs and modern flashes. The problem is the the modern flash has a low, but constant amount of current which prevents the SCR from resetting. While I haven’t looked up the MOC3023, my guess is that it is SCR based and that this is your issue.

  20. Blaise - Wedding Photographer said,

    August 9, 2011 @ 3:17 pm

    More information on my research:

    I’ve tried adding a resistor North side, ie between what you have as pin 3 (but on the MOC 3023 is pin 6) and the flash.

    Still the flash only works once – then I need to disconnect one of the 2 North side leads.

    Up to 220 ohm the flash fires once. At 1K and above the flash does not even flash once.

    I then tried changing the resistor South side. (between pin 2 and ground). At 220 Ohm it did not fire at all, at 18 ohm it fired once – like at 50 ohm.

    I have to disconnect one of the flash pins after each flash for it to work…

  21. Blaise - Wedding Photographer said,

    August 9, 2011 @ 3:32 pm

    Maurice – thanks for the quick response. Much appreciated. Not sure what a SCR is but that’s probably a characteristic of an optoisolator. Before you replied I had thought about something similar and this is what I tried to do:

    I tried to insert a LED and a 220 ohm between the equivalent of your pin 3 and the flash to create a one-way street but that did not work at all (no flash, no LED)

    I then removed the LED / resistor and changed that with a Diode 1N4007. I have ultra limited electronics experience but I was under the impression that diodes allow electricity to only flow in one direction. Even tried it in both directions – exactly the same result: the flash always fired, but only once.

    My final finding: after firing the flash once, the flash is completely blocked. I cannot access any on-camera flash controls. I need to disconnect one of the leads. What’s stranger, is that even if I remove the power source from the arduino the flash remains blocked! Yes – even without electricity the opto remains closed.

  22. Maurice Ribble said,

    August 9, 2011 @ 4:19 pm

    Yes, the SCR is a characteristic of the optoisolator. You can look up SCR on wikipedia to learn more.

    The electricity that keeps an SCR locked is coming from the flash not the arduino and that is why the SCR doesn’t turn off when powering down the Arudino. If you have an older high voltage flash that will work find with an SCR. The problem is modern flashes keep a trickle of constant current which makes an SCR get stuck open and that is why it only flashes once.

  23. Blaise - Wedding Photographer said,

    August 10, 2011 @ 12:56 am

    Thanks Maurice.

    More experiments waking up this morning. I had set the diode wrongly in the 1st experiment: now it works as designed, ie, flash will not fire when set up in the “wrong” way and only fire once when set up in the right way.

    I tried the following brands of flash:
    - Canon 580 exII
    - Vivitar 285 HV
    - Sigma EF-530 DG Super
    - Yongnuo YN460
    - Yongno YN560

    All are low voltage.

    All worked in the same way, ie only 1 flash except the Sigma – no flash at all.
    On the Canon and the YN 560 I tried both a hot shoe connection and a PC Port.

    So simply changing the opto to the PS 2532 should do the trick?

  24. Blaise - Wedding Photographer said,

    August 16, 2011 @ 4:44 am

    Hi Maurice,

    I am waiting for a different type of optoisolator, but tried to use a transistor instead while waiting. Triggering the flash is simple in real life: just connect + and ground – FLASH! No external power involved. I’ve measured and there’s a continuous current of 2 mA and a voltage of 3.2V when the flash is idle and waiting between + and ground.

    I’ve decided to use a NPN 2N3904 transistor as a switch:
    http://www.datasheetcatalog.org/datasheet/fairchild/2N3904.pdf

    1K ohm Resistor connected to the transistor’s base, emitter connected to ground of the arduino and the ground of flash and collector connected to the + of the flash.

    Works very well – a few flashes… After that the other components on my arduino (LCD Screen) start misbehaving very badly (the flash still triggers – no problem). I remove the flash from the circuit and everything behaves normally.

    So clearly there is something I really did not understand about transistors. I’m sure it’s not too happy that the flash is emitting 3.2V but what should I do about that? Let me try to draw my circuit:

    Pin 6 — 1K ohm resistor — Base
    Emitter —- Arduino Ground
    —–Flash ground
    collector —- Flash +

    When I tried connecting a 100K resistor I immediately got a garbled LCD screen.

    Is there any chance I can have this working with a transistor? Or is the optoisolator really necessary?

  25. Blaise - Wedding Photographer said,

    August 16, 2011 @ 4:45 am

    Repost of the schematics:

    Pin 6 — 1K ohm resistor — Base
    Emitter —- Arduino Ground
    —–Flash ground
    collector —- Flash +

  26. Daniel said,

    October 8, 2011 @ 8:13 pm

    Hi Blaise,

    I was looking to do the same thing and got the same optoisolator as you (3023) Figured out a way to make the flash fire more then once, got the idea using your NPN (3904) trials.

    First you trigger with the opto using its pin but instead of pluging directly the wires of the flash, I put
    the ground (or negative) side of the wire to the E ot the transistor. Then on the C goes the positive side. The trick now is to boost the signal to turn it on using the B pin, to do so I put in parallel of C I put the pin 6 of the opto, then pin 4 of the opto goes to B.

    So when the opto is on, it opens up the NPN, and current flows, triggering the flash but without going to the Opto itself, so it doesnt lock up and you dont get some weird current reaching your Arduino and messing it up!

    here is a diagram..
    Arduino opto NPN FLash cable
    PinN—-200ohm—-1 4————B————Positive
    Ground————-2 6–2Kohm—-C
    E————Negative

    I didn’t put any resistance at first between 6 and C and it worked fine but I guess some resistance there is not a bad idea (I’m pretty much a neophyte in electronics as well)

  27. Daniel said,

    October 8, 2011 @ 8:17 pm

    Damn diagram came out ugly hopefully this will be better..
    Arduino~~~~~~~~opto~~~~~~~~~NPN~~~~~FLash cable
    PinN___200ohm___1 4______________B_________Positive
    Ground____________2 6_2Kohm_____C
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~E_________Negative

    Ignore the tildes just used them so it doesnt get squished up..

  28. clankill3r said,

    November 30, 2011 @ 2:48 pm

    I got a very old flash from 1980 the ‘national pe-2556′ if i put it on a slave drive and connect the 2 parts of the jack with a wire then i get a flash.
    I also have a ‘sigma em-140 dg’, if i try the same thing there then nothing happens, anyone know why that can be?

  29. noob said,

    January 18, 2012 @ 6:52 am

    and here comes the lamest question among all these smart comments and questions,

    where do i press the space bar? where in my input console that lets me enter the space bar in arduino, much apologies for the nooby question

    thanks a bunch

    sam

  30. Isaac Braun said,

    February 15, 2012 @ 2:50 pm

    I cant find the chip PS2532-1, I understand this is an old post so this chip may have a new name. I found the chip PS2501-1 that looks to be the same with 4 prongs. If you know where I can find the chip you used or if the one I found works that would be great.

    Thanks,
    Isaac

  31. High Speed Photography Workshop with Arduino : The Edge | Digital Culture Centre said,

    February 27, 2012 @ 9:26 pm

    [...] and PC-synch cable to fire the flash automatically according to the laster-gate. Check out this tutorial on how to control a flashlight through an Arduino, and further schematics and Arduino sketch to fire sensor triggered flash events. The video below [...]

  32. Kris Jacobs said,

    April 6, 2012 @ 10:08 pm

    I’m tinkering with this, I like it – thanks!

    Question: Sadly, I do not have an optoisolator on hand – I do have a lot of digital ICs in my box though – I wonder if a NAND gate would be fast enough? Two Arduino digital outputs go HIGH when the laser beam is broken, that will make the output of the gate go LOW, triggering the flash.
    I’ll give it a try…

  33. Kris Jacobs said,

    April 6, 2012 @ 10:17 pm

    Just found a TI datasheet on this SN74LS00N I have, switching time is rated at <20 nanoseconds typical.

  34. High speed foto’s maken met Arduino - Mancave said,

    November 19, 2012 @ 5:11 am

    [...] zijn helemaal uitgewerkt inclusief schema’s. Over de trigger voor de flitser heeft hij een apart artikel geschreven. Wees niet bang, je hoeft zelfs de software voor de Arduino niet zelf te schrijven. Die [...]

  35. How to: High Speed Photography using the Arduino – Wammed said,

    January 8, 2013 @ 12:02 pm

    [...] laser pointer. Since I’ve already described how to do the actual firing of a camera’s flash here I won’t focus on that part of this project [...]

  36. Chikaya said,

    July 17, 2013 @ 8:46 am

    Do you have an idea how I could wake up the Flash with Arduino, when it goes idle or goes to sleep?

  37. Scott said,

    September 1, 2013 @ 10:08 pm

    Remove the OptoIsolater and install a simple Model: 275-232 | Catalog #: 275-232

    Compact 5VDC/1A SPST Reed Relay from radio shack. The opto is going to stay turned on via the scr junction due to the flash has a very small amount of current after it flashes. The flash is meant to be fired from a switch not a semiconductor.

  38. Maurice Ribble said,

    September 2, 2013 @ 4:38 am

    Scott, that is not true. Camera’s and flashes are meant to be triggered by a device meeting the trigger specifications from the manufacturer. As an example Canon and Nikon cameras don’t use relays to trigger a flash. As for camera triggers Canon’s TC80N3 remote uses a solid state trigger. The junction issue is more of a problem with modern flashes and SCR’s which is why I didn’t use an scr. That said if you want to use an scr there are well documented ways of making them work. Using relays is too slow for many uses.

RSS feed for comments on this post