Sound Activated Flash Trigger for High Speed Photography

The primary problem when designing a sound sensor for a standard ADC input is to convert the amplified sinusoidal waveform into a corresponding stable DC voltage. This circuit here uses a common multimedia desktop microphone as the primary sensor, and a pre-amplifier along with a  Arduino micro-controller to trigger an external camera flash.

The feeble 1-3mV signal coming from the Electret microphone is pre-amplified by a single-stage 2N3904 transistor amplifier. The output is then passed through a 10uF Electrolytic capacitor and the rectified by a pair of diodes. This provides a DC output voltage in the range of 0.5V to 3.3V depending on the amplitude of the sound.

The output from the diodes needs to be stabilized for a certain amount of time so that the ADC has enough time to get a sample reading. A simple RC circuit comprising of a 100K resistor and a 0.1uF disc ceramic capacitor is sufficient for this. The output ‘OUT’ can be connected to A0 (Analog pin 0) on the Arduino board.

The 8K2 resistor can be replaced by a 10K resistor. The 10uF electrolytic capacitor on the collector of the 2N3904 has its positive terminal connected to the transistor. The circuit is powered by a regulated 5V supply which can easily be drawn from the main Arduino board.

Triggering the flash is really simple, using a commonly available CNY-17 opto-isolator. Use any digital pin from the Arduino configured as an output and feed that to trigger the internal photodiode. The photodiode cathode should be taken to ground via a 100 Ohm resistor. The CNY-17 datasheet is available here.

The collector and emitter of the internal photo-transistor is connect to the PC sync port of the flash. If the flash doesn’t have a PC port, it can be connected on a Hot-shoe adapter that does.

The software constantly monitors analogue pin A0, and when it crosses a defined threshold, it pulls the output pin high for a brief (about 100ms is fine) time. This is enough to trigger the flash. After the flash fires, its advisable to add a delay of about 1-2 seconds so that stray noises (subsequent bounces/impacts) can be eliminated.

To connect the flash, its best to get a female PC sync cable, cut the other end and then use that to connect to the opto-isolator. Unfortunately, I didn’t have one of those, so had to connect the PC sync port with a bit of engineered PCB hook-up wire. Rustic, but it works until you find a proper cable.

Here is the completed circuit on  a breadboard. The circuit works great for dropping coins, marbles, fruits and the like into a glass of water, but the microphone pre-amplifier is just not sensitive enough to detect a single drop of water falling from a height, unless you hold the microphone really close. Am still working on a more sensitive version that should be able to do that. Maybe a LM358 or 741 Op-Amp might provide the needed gain. Some folks have suggested using a standard acoustic microphone along with a guitar amplifier to act as a sound sensor. The output from the guitar amplifier needs to be rectified and stabilized before it can be fed into the Arduino ADC. I’m going to try this out at some point too.

For now, this suffices quite well. Will probably try some cut fruit now…
Sound Sensor Flash Trigger with ArduinoSound Sensor Flash Trigger Circuit with Arduino
Its Raining Coffee, Hallelujah
Splash!

Water Drop I Water Drop II

And here is the software…

/* Sound Activated Flash Trigger
 * by Sanjib Mitra
 *
 * Program using a Electret Microphone Preamplifier
 *
 * Listen to analog pin 0 and detect sounds that cross the
 * defined threshold. This needs to be calibrated depending
 * on ambient noise. Once detected, the program writes out
 * a HIGH on digital pin 12 for 100ms to trigger the flash
 * via an opto-isolator
 *
 */

int flashPin = 12;      // flash PC sync connected to control pin 12
int soundSensor = 0;    // the sound sensor will be connected to analog pin 0
byte event = 0;         // variable to store the value read from the sensor pin
int THRESHOLD = 5;      // threshold value to decide when the detected sound is a knock or not

void setup() {
 pinMode(flashPin , OUTPUT);  // declare the flashPin as an OUTPUT
 Serial.begin(9600);          // use the serial port
}

void loop() {
 event = analogRead(soundSensor);         // read the sensor and store it in the variable
 if (event >= THRESHOLD) {
 digitalWrite(flashPin, HIGH);            // take flashPin HIGH
 delay(100);                              // wait for 100ms to trigger the flash
 digitalWrite(flashPin, LOW);             // take flashPin LOW
 Serial.println("Flash Triggered\n");     // inform the computer that the flash was triggered
 delay(10);                               // 10ms delay to avoid overloading the serial port
 }
}


This article was inspired by and based upon experiments described here. Thanks Glacial Wanderer!

6 Comments

  1. This is good. It good to find that you could procure an arduino so easily in India. I had tried some times back and it was just not available anywhere

    Reply

  2. Fine way of describing, and fastidious post to obtain information concerning my presentation focus,
    which i am going to convey in college.

    Reply

Leave a reply to Broadaxe and Battledrum › Sound Sensor Flash Trigger Circuit with Arduino Cancel reply