Cold Solder

Sound Activated Flash Trigger for High Speed Photography

Posted in Ideas, Photography, Projects by Sanjib Mitra on 20 April, 2010

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!

About these ads

4 Responses

Subscribe to comments with RSS.

  1. Sayan said, on 20 April, 2010 at 6:31 pm

    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

  2. Sanjib Mitra said, on 20 April, 2010 at 6:45 pm

    Thanks Sayan.
    The Arduino and some of its clones are easily available nowadays. Here are links to some of the distributors in India:

    http://simplelabs.co.in/drupal/content/arduino-duemilanove

    http://www.simplelabs.co.in/drupal/content/induino-low-cost-arduino-usb-clone-board

    http://www.tenettech.com/arduino.html

    http://feemo.in/

    http://www.deccanrobots.com/

    http://www.bhasha.co.cc/manufacturer.php?id_manufacturer=3

    http://sites.google.com/site/ashwinvenkat/arduino

    I got mine from Tenet. They also have lots of useful of Arduino Shields too.

  3. Someone said, on 4 March, 2012 at 11:57 pm

    There are some commercial units as well.

    http://www.nerotrigger.com
    http://www.pmgadgets.net

    etc.

  4. sales cold calling best practices said, on 24 May, 2013 at 5:53 pm

    This is really interesting, You are a very skilled
    blogger. I’ve joined your feed and look forward to seeking more of your fantastic post. Also, I have shared your site in my social networks!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: