Setting off a Flashgun with an Arduino

So it might not be obvious why one might want to do such a thing – but it could come in useful. I have a Yongnuo YN560 “manual” flash (no TTL metering, so one had to set the flash power and focal length on the lens itself) which I wanted to control manually to generate multiple flashes – which could come in handy for strobe photography. I chose to use the Arduino, since I’m well familiar with it.

As this is a modern flash, the voltage on the hotshoe pin is about 3.0-3.3v with respect to the shoe itself which is ground. On older flashes, vintage ones especially, the voltage on the hotshoe pin can be hundreds of volts – be very careful. Once this pin is grounded, the flash fires. Simple.

The Yongnuo came with a stand, however, accessing the hotshoe terminal proved to be a bit of a pain. So came the Prontor-Compur port (PC Sync) on the side, which basically had the same characteristic as the hot shoe, but is accessible when the flash is mounted in its stand.

Someone who would do this properly would get a nice PC port plug and do some isolation of the flash signals from the Arduino – but I went cheap and nasty. I used a snippet of code like so (where x is the pin number that’s connected to the hotshoe pin):

pinMode(x,INPUT);
digitalWrite(x,LOW);
pinMode(x,OUTPUT);
pinMode(x,INPUT);

Also noting that in setup(), I would have had at least pinMode(x,INPUT);

This is important – as this flash only puts out ~3.3v logic high, and expects it to be grounded (either current or voltage triggered). Applying a 5v logic high to the pin might hurt the flash! One could use some zener protection, a level-shifter or a MOSFET to try and isolate the logic output from the Arduino to the logic of the flash unit.

But lazy me decided to take another approach. By setting the pinMode to INPUT, this causes it to go Hi-Z, allowing the flash to pull the hotshoe pin up to 3-3.3v. Then I choose to write a LOW, and then toggle the pinMode which causes the hotshoe pin to briefly transition to ground, then back to Hi-Z – firing the flash. As long as the grounds were common, and we took some care – this arrangement shouldn’t hurt anything.

Indeed it didn’t. Using my spare DFRobot Arduino Mega 1280 clone, and some crappy solid core wire, contorted to fit loosely into the PC Sync port – we got it to fire.

A bit more code later – I had a program which could fire of x repetitions of flashes at y millisecond intervals – with the figures provided by a Bluetooth Serial Module (hence, I could type in the settings from a phone/tablet wirelessly). I’ll leave the coding to you guys though – there’s a joy to coding (as opposed to being given the solutions) which I think people should do.

One thing to note was that the YN-560 can only flash at 200ms intervals (5Hz) at powers 4/10ths or less. It won’t go faster than that. Above that, it will flash erratically if commanded to flash at 5Hz as it fails to recharge in time for the next flash, causing “missed flashes”. At full power, you will very quickly run into the overheat protection – locking out the flash entirely for a minute or two.

About lui_gough

I'm a bit of a nut for electronics, computing, photography, radio, satellite and other technical hobbies. Click for more about me!
This entry was posted in Electronics, Photography and tagged , , . Bookmark the permalink.

3 Responses to Setting off a Flashgun with an Arduino

  1. Interesting. I would go and start studying Arduino.
    However, I am basically a dumb in the electronic field. But I have a problem I hope you can advise me on which way to go.

    I would need to fire a flash gun by sound. I know there are Sound Triggers, but as far as I understood they release the shutter. I don’t want the shutter to be released. I don;t need any interaction with the camera in fact.

    It doesn’t matter if the flash is manual or not. Focus and zoom don’t matter and it doesn’t matter if the flash is of a new generation or vintage ones, as long as they can emit a recordable light on command.

    My camera is recording video, so it is in Movie mode and the shutter released already depressed (thus it is recording). I need to have some visual markers at certain times.

    I have a app that does a task and it can ‘beep’ (44Khz noise) at that certain time. I tried to use that as marker, but that is useless as microphone is far away from the camera and there are lots of other sounds that I needed to be recorded as well, so either I cannot record the beep or it is not clear in the middle of so many other sounds.

    So, is there any way to command the flash gun to fire by the beep (or the signal from the headphone jack, so we can avoid the speaker sound altogether). That is sticking an audio cable into the headphone that goes into a device that somehow triggers the flash gun.

    My intervals are more than 10 seconds,

    Is there any thing you can suggest, considering I don’t know electronics and circuit boards? (so simple plain English for a dummy please!)

    • lui_gough says:

      I’m afraid you will have to learn some electronics and build some things yourself if you want something like that to happen. Or you might be able to use a different approach altogether, say flashing the screen on a phone or the LED on a phone to use as your “signal”.

      An Arduino might not be necessary at all. Instead, I would suggest you take the output from the headphone jack (which will have an AC voltage of about 0.7v on it when a tone is being played at high volume) and filter this through a resistor-capacitor combination (to build a stable positive voltage). This can be used to input to an opamp (acting as a comparator) which will output a higher voltage when it detects this voltage on the input. (Say, compare with a low voltage of ~ 0.2v derived by voltage divider.) If you then use the output of the Opamp to drive a N-type MOSFET that shorts-across the hot-shoe or PC trigger port of a *low voltage modern flash gun*, then it should work fairly well.

      But you will have to design and build your own circuitry. I’m not sure on what products might be presently available on the market, but if you don’t want to learn and build, you might have to come up with a different way.

      – Gough

  2. Robin Rex says:

    Exactly what I wanted. A hundred thanks to you! 🙂

Error: Comment is Missing!