An Arduino Triggers A Flash With Sound

To capture an instant on film or sensor with a camera, you usually need a fast shutter. But alternately a flash can be triggered with the scene in the dark and the shutter wide open. It’s this latter technique which PetaPixel are looking at courtesy of the high-speed class at Rochester Institute of Technology. They’re using a cheap sound sensor module and an Arduino to catch instantaneous photographs, with students caught in the act of popping balloons.

The goal here was to keep things as simple as possible. All you’ll need in addition to the Arduino (or really, any modern microcontroller) is the sound sensor — which are often sold as “microphone shields.” To trigger the flash while still providing electrical isolation is a reed relay. The write-up notes that higher performance systems would be better off with an optoisolator, but this provides a low-cost alternative to get started with.

We rather like the technique, and perhaps it’s a thing to try at a future hacker camp. Unsurprisingly it’s not the first flash trigger for water balloons we’ve seen.

37 thoughts on “An Arduino Triggers A Flash With Sound

    1. I wonder what is actually used when something like this is needed.

      For example shot timers for sports like 3gun which starts, split and stop based on detected shots.

      I don’t think a 555 would be satisfying as it would need some sort of AGC to avoid constantly firing or missing.

        1. Great find and Nice circuit I imagine it would be very finnickity to tune but can’t imagine an alternative that doesn’t introduce latency.

          I wonder if there could be some sort of signal analysis (not digital or taking a time domain signal) but even just tuned RCs to detect frequencies and determine a bang versus a shout? Probably unnecessary.

    2. I remember in the early days of usenet, someone describing in detail about how they made a custom PCB and developed their own assembler for the Apple ][ so they could write a program to adjust the delay between when a sound was detected and a strobe light was triggered to take photos like this. I laughed hard when the first comment was “Why didn’t you just use a 555?”

  1. wow, electronics are so abstracted now, lets overbuild because someone cant build with $4 in parts,555, mic,resister, cap.

    Who knows maybe people use an ESP with embeded os because they cant blink and led and read an adc at at same time lol

    1. Is there a word for this so-smart-it’s-dumb thing Hackaday commenters do, where they think you should use production designs and hardware to build one-off experimental devices?

      Yeah, let’s order a stack of 555s, resisters and caps so we can spend all day swapping them out and mangling the wires tuning the response to the mic. That makes so much more sense than spending an extra dollar on a cheap arduino compatible and doing it in software.

      1. If it were an electronics design course instead of a software course, then doing the hardware would make sense.

        “order a stack of 555s, resisters and caps so we can spend all day swapping them out and mangling the wires tuning the response to the mic. ”

        That looks like a really poor way to tackle the problem. About as bad as asking a chatbot to write your code.

        You take measurements of the signal from the microphone. From the measurements, you calculate the gain and levels needed for triggering. You use a potentiometer to fine tune the trigger level.

        That last would have been a good addition to the Arduino solution, by the way. Add a potentiometer to adjust the trigger level instead of modifying the program code.

        Since the course involved was a programming course, using an Arduino makes sense.

      2. Utter BS. A 555 with a couple of potentiometers is perfectly up the task, and it was done this way for decades before microcontrollers went cheap as fart.
        Many, many analog photographers did it this way and produced high-quality spot-timed photos.

      3. My response to this project is nuanced. I’ll start with my default reaction… a bit of applause for anyone who builds something, as opposed to a person who does not. It’s not inconsequential that simple projects like this can inspire a young person to pursue an engineering career, so there’s that, too. The balloon popping pictures are cool.

        Furthermore, as an engineering professional, I’ve used Arduinos and Arduino-like microcontrollers for many dozens of investigations and projects, and there is no shame in it. Introducing some cheap computing power between input and output provides a layer of abstraction into which you can introduce an arbitrary transfer function, calculations, and adaptive behavior.

        That said, I don’t see the point of the Arduino here at all. Adjustable threshold? You could implement that with a comparator and a pot ( and I think the author even said one sensor version already has threshold detection built- in.) Maybe they wanted to introduce a programmable delay? (If they did, I missed that in my scan-through of the story. in any event, a 555 or simple RC network with a pot would add that functionality more easily.)

        Somebody justified the Arduino by saying the project is part of a programming course… not a good excuse. You don’t teach a student effective hammer technique by leading them to believe that every fastener they’ll ever encounter will be a nail. Introducing a computer into system easily managed with a handful of discrete components is as “cave man,” as throwing dozens and dozens of discretes at a problem better addressed with a single microcontroller.

        But that’s my experience. Your mileage may vary.

        1. Well, as you said – “you can introduce an arbitrary transfer function, calculations, and adaptive behavior”. I agree having an entire computer is wasted if you never go back and do anything more than manually defined threshold detection.

          But as a strategy rather than a tactic, it’s got merit. If you throw a microcontroller in everything even when it doesn’t initially seem necessary, then whenever you’re finally ready to improve things, you don’t need to do as much to update the design. If all of a sudden you finally realize that you could be doing so much more than fixed threshold detection, you can update the code so that if it does still use a threshold at all, maybe the threshold is set to N times the maximum background sound over the past minute. Maybe it combines the threshold with looking for a rapid rise. And you can figure out what sort of curve you’re looking for because you feed the sensor input into the arduino and graph it. Maybe you supplement the reactivation timer with another mcu input that is either a button or a camera signal indicating that the shutter has closed.

    2. I feel like HaD could really benefit if every article had a pinned, auto-generated post for people to direct their comments on how the OP could have or should have done things differently, and why. 555 comments included, if reasonable.

      I think it would be great to start a dedicated discussion like this on every project about how to do them cheapest, optimized for lowest power consumption, with the least or no programming possible / hardware only, easiest way possible (subjective I know, but still valid), etc. Each project could turn into a mini-competition of how to try to best optimize.

      Some simple guidance like this in the comments sections would not only lead to less cynical comments but also be a great knowledge sharing opportunity and brainstorming session for all to benefit from.

      1. Tbh obligate meme replies that have five duplicates under each and every article are very annoying. Oh, “could have done it with a 555?” Your brain could be a 555. You clapping seals

        1. I disagree (not least because I made the first post here, about using a 555). I did check that it was indeed possible with a 555 (I thought I had seen such a design, but I checked anyway), so it was a genuine suggestion, albeit with tongue slightly in cheek. Secondly, readers might not be familiar with a 555, so to see a project described using one method (Arduino), and a comment saying it could be done via another method (555), some readers might be inspired to find out if it’s true, and if so, how is it done.

          Also,

          *obligatory

    3. Sometimes you already have a stack of arduinos lying on a shelf. It’s fine, you don’t always have to minmax and build from scratch. And sometimes it’s nice to be able to modify its behavior in code instead of having to go in and resolder stuff

  2. The article is a good write up if you are a photographer. I have been meaning to try something similar to this for a while as I get better at flash photography. They explain all the lights they use and their purpose.

    For the Arduino, probably wasnā€™t a bad choice for an amateur project like this. As they used it to help measure signals out, and even tweak delays between hearing the pop and triggering to get the right amount of burst ballon. This could be useful for quick accurate changes in a fast pace of a studio without playing with too much test gear.

    Design from smarter everyday did something similar years ago photographing ballers fired into an apple I believe. Surprised what you can see with a short flash duration!

    1. Search the internet for issues of Popular Electronics, Radio Electronics, Nuts and Volts, Ham Radio, or any of a hundred electronics projects books in PDF for. Flash triggers were common hobbyist electronics projects decades be arduinos appeared.

  3. Kinda bugs me how an Arduino and module are used but then they cheap out on the switch. However, lets keep in mind the target audience are photographers. Its always cool to see non electronics people do this kind of stuff. And the photos look damn cool.

  4. Trying not to be negative here so kudos for the lighting info and the pics are good.

    But ‘keeping it as simple as possible’ by using thousands of lines of code (if we include the libraries), a PC, IDE and $20 of parts (including a reed relay that’s almost definitely not suited for the task) for a job that’s been done to death thousands of times in all sorts of electronics magazines and books since the 70s (and almost definitely earlier too) with dirt cheap stuff like the 555, op-amps, logic ICs etc???

  5. Not so long ago there were plenty of Arduino driven art hacks featured here. Many were mere blinkenlights, but they introduced a whole new audience who were not engineering types to the wonders of MCUs, programming and basic electronics. Maybe in time they will learn enough to ā€œgraduateā€ to the 555 club.

  6. Definitely not the first to do this, but nevertheless fun :-) Even the photography website Petapixel had this years before: https://petapixel.com/2017/05/10/build-simple-sound-trigger-high-speed-photos-arduino/

    The most prominent “trigger your photo/flash with an Arduino” I remember was the Photoduino from ~10 years ago: https://kalanda.github.io/photoduino/ The flexibility justified the use of a microcontroller over a 555, too ;-)

    1. Even at digikey the PC817 (most ubiquitous generic purpose optocoupler) starts at 32ct, and that goes down to 6ct when buying full reels, but shipping costs have become a real pain from the big western stores. I once bought a tube of 100 or so of the things from Ali and I forgot what I paid for them, maybe 3 to 5ct each?

      Reed relays are almost certainly more expensive.

  7. 1st thought. Does this circuit really need a arduino?
    Surely the microphone would trigger the flash circuit on its own.
    OK, I take the point that cheap sensors like these can be a bit hit or miss and using the analog circuit can be better, but there are discrete components that will do the same.
    With a circuit like this, the arduino will delay the output, which is less than ideal. Of course may want a delay, but arduino clocks are not very precise so again a delay circuit would be better

    I agree that an opto-coupler makes more sense than a relay

    I once designed a circuit to capture a hammer smashing a light bulb. It consisted of a screw, a hammer on a piece of 2 by 4 on a hinge. It was totally analog, but worked well, the only issue being the amount of glass flung around. Just to show you can over engineer some things

    https://photographyformortals.blogspot.com/2015/08/smash-and-grab.html

  8. Optos are a pain in this use-case, you will be wayyyy better off using a resistor and transistor.

    After all, there is not much to isolate against:
    Cameras and speedlites use some “passive shortcut detection” circuitsĀ¹ which are very sensitive while still being very robust, so you will try a lot of optos before you find one that works reliably …. until it doesn’t.

    Ā¹) I am not an analog electronics person, so take a lot of salt. But I do have extensive experience triggering cameras from micros and PCs.

  9. Since when is a reed relay cheaper than an opto? Also, I’d say someone working with a minimal collection of parts from a “getting started with electronics” is more likely to have an opto in their kit than a reed relay, and if you have to resort to scrounging so you can build it now instead of waiting for your one-part rush order from a distributor, you’re likely to find an opto long before a reed relay as well.

    I have a fair variety of parts on hand, and while I have magnetic reed switches, I don’t have any reed relays.

    The one benefit the reed relay has over an opto: you needn’t know the polarity or really, the type of signal being switched on the output. Whereas polarity would matter with a transistor. If that’s the reason for choosing a reed relay, say it, rather than talking about cost.

    1. The signal is “there is a shortcut” .. the sensing circuit does tolerate some voltage and minimal current but it can be triggered by putting a wire across. Also see my comment above.

    1. Different project, but the comments section would still look identical: mostly people complaining that people have been flushing toilets with 555s since the 70s and if they just looked at a magazine/book/electronics grimoire they’d be able to do it cheaper. ;) (Not knocking simple engineering, just that anymore if arduino/raspberry pi is mentioned in an article, the fivers show up in force)

  10. I did a lot of this a while back. First change I made was using a mosfet to trigger a wireless flash trigger rather than the mechanical relay. The mechanical switch has quite a bit of randomness that can make the timing impossible to dial in. The wireless flash triggers also have a delay, but is very precise. And has the added advantage of being able to hook up as many flashes as you have triggers for. Trying to do multiple flashes with mechanical switches will generally be very disapointing.

    For those wanting a “real” minimalist approach, beyond what a photographer would already have, you don’t need anything. The flash has a manual trigger, you can pop the balloon and press the manual flash trigger with no additional electronics. It’s tough to get the timing right, but I’ve seen a lot of people produce some great results.

  11. RIP Harold “Doc: Edgerton. For a long time, the Boston Museum of science had a variable frequency (Xenon) stroboscope where by turning a dial you could “stop” a stream of water drops. I saw an LED update of this exact exhibit at the ECHO science center in Burlington this weekend.

    What’s old (and used HV supplies) is new (with LEDs and Arduinos) again!

  12. Wow, when I was a kid we did that with a transistor.

    Honest to god Arduinos have made people stupid.

    I was watching a youtube video on a radar sensor and the guy could not light up an LED without an Arduino in the middle.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.