Arduino Camera Flash Control
Intro: Arduino Camera Flash Control
This is a simple method for controlling a camera flash using an Arduino. The nice thing about this method is that it uses an optoisolator to separate the Arduino from potentially high voltage spikes produced by the flash. I choose to use and optoisolator instead of a relay because the response time is much quicker, which is important when dealing with split second camera timing. Being able to control a camera flash in this manner is not only useful for Photography, but can come in handy for making a haunted house display (and miscellaneous hijinks).
STEP 1: Go Get Stuff
You will need:
- Arduino
- Camera Flash (with input jack)
- Breadboard
- MOC3021 optocoupler (Triac)
- 220 ohm to 1K resistor
- 3/32" mono plug
- Solid core wire
- Arduino
- Camera Flash (with input jack)
- Breadboard
- MOC3021 optocoupler (Triac)
- 220 ohm to 1K resistor
- 3/32" mono plug
- Solid core wire
STEP 2: Wire the Plug
Open the casing for your plug and solder a red wire to the center terminal pin and a black wire to the outer terminal.
Reassemble the casing.
Reassemble the casing.
STEP 3: Wire It Up
Connect pin 13 from the Arduino to one leg of a 1K resistor.
Connect the other leg of the 1K resistor to pin 1 of the chip (this is the pin next to the dot).
Connect ground from the Arduino to pin 2 on the chip.
Connect the red wire from the 3/32" plug to pin 6 and the black wire to pin 4.
Connect the other leg of the 1K resistor to pin 1 of the chip (this is the pin next to the dot).
Connect ground from the Arduino to pin 2 on the chip.
Connect the red wire from the 3/32" plug to pin 6 and the black wire to pin 4.
STEP 4: Plug It In
Insert your plug into the trigger port on the electronic flash.
STEP 5: Program and Go
Program the Arduino with the following code:
/* Camera Flash Based on basic Blink example This example code is in the public domain. */ void setup() { // initialize the digital pin as an output. // Pin 13 has an LED connected on most Arduino boards: pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); // Trigger the flash delay(10); // Wait for a 1/100 second digitalWrite(13, LOW); // Turn off the flash delay(7000); // Wait 7 seconds for flash to recharge }Assuming that your flash is turned on, it should now be triggered every 7 seconds.
22 Comments
marthe 1 year ago
randofo 9 months ago
popwar 6 years ago
randofo 6 years ago
If so, can you trigger the flash over and over by manually touching its contacts together? If this works, it is not the flash unit that is latching, but the optocoupler.
The next step after this would be to check the wiring really carefully against the data sheet.
If it is still not working, maybe the optocoupler itself is faulty and you just need a new one, or, you need to get a different model (for some reason).
popwar 6 years ago
The flash unit was working great.
I was using the same make and model of the optocoupler, went through the wiring with a fine tooth comb and tried the extra I had purchased but was still unable to get it to work properly. Not quite sure what I was doing wrong.
I ended up just using a solid state relay (the "clicking" sound worked out great for my purposes).
popwar 6 years ago
It is definitely the optocoupler.
I am using the same model number, it is the one from your link. I ordered a few of them and have attempted 2 different optocouplers. My resistance is dropping the voltage to a safe level for communication to the optocoupler. I have read through the datasheet for the unit, and have everything wired to the correct pins. It just seems that the internal gate between the two main terminals (pin 6 and pin 4) is failing to close on at least the two units that I have tried so far.
I'm going to give it one more try and see if I can get it to work with a fresh opto. I have made it work using a relay, but want to figure out how to get these optos working.
PabloF8 6 years ago
How fast can go the flash? 1 per second? 10 per second? Is it there a limit?
randofo 6 years ago
It depends on the reset rate of your specific flash unit. I have not use this specific flash in a while, but I imagine it around every one or two seconds to give them capacitor a moment to recharge
Kay O.S 7 years ago
Hi Randofo! Thanks for this tutorial. I've been thinking of making some complicated photo flash setups and this might just be the ticket to making them happen.
One question, as I'm a super noob when it comes to Arduino, how many flashes could one control from one Arduino? Assuming I want independent control of each.
P.S.: Noticed you got the flash from the store I work at. ;)
randofo 7 years ago
13 - 18. If you get an Arduino Mega, then you can control about 50.
You could also get other chips to interface with the Arduino such as a shift registers, and this would allow you to control even more. However, this is a bit more of an advanced topic.
malixlizard 11 years ago
randofo 11 years ago
malixlizard 11 years ago
randofo 11 years ago
dannye90 11 years ago
randofo 11 years ago
dannye90 11 years ago
randofo 11 years ago
randofo 11 years ago
dasigi 12 years ago