Thursday, August 4, 2011

Sound Triggered Flash: High speed photography




capturing scene invisible to the naked eyes: water balloon popping



I was always amazed with Discovery Channel's Time wrap video clips. So I decided to do some experimenting on my own. A high frame rate video camera costs thousands of dollars... that was out of the question. A compromise needed to be made... instead of shooting videos, let's go for high speed photography. Sound Triggered Flash.  As the name indicates, it is a flash triggered by a sound impulse. Using my SLR camera with the shutter open in a dark room, I would be able to capture photos of sound generating events.

Simple but inspiring. Enough to get me started on the project.

After doing some online search, I was able to find some links for DIY sound triggered flash. They were pretty helpful to get me started, however I decided to drop the research and just go with my own circuit design (more fun).



1. Component list:

- Disposable camera  with built-in flash x1
- Electret Microphone x1
- 9V battery x1
- LM386- Low voltage audio power amplifier x1
- LM339- Comparator x1
- NE555- 555 timer x1
- TIP120- BJT darlington transistor x1
- 10Kohm potentiometer x2
- Resistances: 10K x7 - 5K x 1 - 510 x 2
- Capacitors:   10nF x3 - 10uF x2 -  220 uF x1
- LED x2
- On/Off dip switch x 2




2.   Hacking the disposable camera:


You must have realized by now that we only need the flash circuit from the disposable camera (of course any professional flash would do the job, but for $10 the disposable camera flash is good enough). After cracking open the Kodak disposable camera that I got, and analyzing the amazing ingenuity behind the trigger/shutter/flash mechanisms, i focused on the flash circuit.


Now notice how I carefully hold the flash circuit PCB. Notice how there is a 185uF - 330V capacitor in the circuit. I was actually electrocuted by the 330V capacitor -twice. Not fun. Not deadly, but not fun. (What doesn't kill you makes you stronger doesn't really apply in this case..)
So I have to say this..
Courtesy of "How camera flash work" article
HAZARD: DON'T TOUCH THE CAPACITOR LEADS WITH UR BARE HANDS!! 
Be careful in handling the flash PCB. It is preferable to discharge the capacitor by triggering the flash before holding the pcb.


As you can see, the flash circuit is powered with a 1.5V AA battery. It consists of impulsing a high voltage into a xenon tube. So the circuit boosts up the battery's low voltage into a high voltage to charge the 330V capacitor. More theoretical info can be found in this nice "How camera flash work" article.

After understanding the circuit, I realized that connecting the two metallic leads M1 and M2 in the above picture causes the flash to trigger. PERFECT! (The circuit differs between different brands, however you will always find the similar two metallic leads). Again DON'T CONNECT THE LEADS WITH YOUR BARE HANDS! I soldered two wires to M1 and M2 as can be seen in the picture below.


3. The electronics:

First step in designing my circuit was to decide on the user interface. I would like the user to:
-Tweak the sound sensitivity using a potentiometer
-Tweak the time delay in the order of milliseconds between the sound detection and flash triggering using a potentiometer. (I realized during experimentation the need for this feature, else the pictures were captured a bit too early)
-Test the sound detection using a LED.
-Press a push button to switch the circuit from triggering a LED into triggering the flash.

I prefer not using a microcontroller for such a simple circuit, it would be an overkill. Let's do it the old challenging way: build my own A/D conversion and triggering.

The idea behind the circuit is simple: 
  1. Pick up the signal using an Electret microphone.
  2. Amplify the signal using LM386.
  3. Compare the amplified signal to a constant threshold (which can be modified using a pot to change sensitivity) using the LM339 comparator.
  4. The comparator's falling edge would trigger a pulse using the 555 timer in Monostable mode.
  5. The pulse would be delayed by charging an RC circuit connected to the LM339 comparator. (The resistance of the RC is actually a pot so that that we could vary the value of the time delay)
  6. The delayed pulse coming out of the comparator would go into the base of the TIP120 transistor switch that would trigger the flash.

M1 and M2 wires are connected to the H1-camera header in the schematic.
Audio: C1 - removes the DC component in the signal
C2 - removes the high frequency noise
LM386- amplifies the signal. C3 is connected between terminals 1 and 8 so that the gain is 200 (46db)
Comparator: Pot1-varies the voltage between 4.5V and 9V at the positive terminal of the LM339 comparator (because the output of the amplifier is biased at 4.5V)
When the signal voltage goes above the voltage specified by Pot1, a falling edge occurs that would trigger the 555 timer to generate a pulse.
555 timer is in Monostable mode: the pulse width is t=R4*C4*ln(3)=2.4 sec.
Time delay: The pulse generated by the 555 timer will charge the RC circuit composed of pot2 and C6.
The RC is a first order system:

which is compared using LM339 to a voltage divider circuit providing 10k/15k*Vin. As soon as this voltage is reached, the flash would trigger. The time delay equation is:


So the maximum time delay achieved with the 10K pot is t =110ms.


Trigger: Finally, the signal switches the TIP120 transistor. If SW2 is pressed, LED2 would light up (for testing purposes), otherwise the flash would trigger.

4. Prototype and PCB

One of the earliest models I made was based on the NE5532 audio amplifier. Here are a few images of the early prototype built with a perforated board.


The reason I switched to LM386 amplifier is for its simplicity, however NE5532 provided the option of having a pot in order to modify the gain.
I designed a single sided Printed Circuit Board of the new circuit


Click here to download Gerber files of the PCB.

5. Experimentation:


Here are a some of early pictures I took:
More experimentation pictures will be uploaded soon.. stay tuned.


6. Purchase

Contact us at DepotBeirut if you'd like to purchase a PCB or even a fully assembled sound triggered flash.

Cheers,


3 comments:

  1. Dear Readers, Admirers, Engineers, Amateurs, or any curious person who stumbled across this page by any means.... THIS PRODUCT IS A-M-A-Z-I-N-G! So much fun and it never grows old! With 10$ and some effort, you can get the same beautiful and highly fascinating images you'd get from a high speed camera that costs 1000's of $.
    How do i know this? I'm THE PROUD OWNER of one of these babies!! The first of them to be precise, built by Bassam Jalgha himself :)
    I can tell u I'm very very pleased
    GO FOR IT

    ReplyDelete
  2. Bassam.. I can't believe it!!

    I recently got into photography and bought myself a Nikon DSLR in April, and a flash among many other things, not knowing how to spend my money :P

    I rapidly got interested by high speed photography and started searching for sound/motion triggers, which I found very expensive. I also found DIY circuits, but was too lazy to build one :P

    So I went the manual way! This is a shot I took by manually triggering the flash
    http://www.flickr.com/photos/redaaouad/5647374243/
    (and you can imagine how many times I did it and cleaned the mess before having the shot!)

    Anyways.. It's really interesting to see you work on this project. I see that the pictures are from 2010. I would really be interested by your circuit.

    But I have a few questions.. does it work with all types of flashes? Especially the pro ones? Can you make a circuit with a higher delay range? Can you do some sort of nice packaging to the whole device?

    Yalla waiting for your reply !

    Reda

    ReplyDelete
  3. Reda!
    that's an amazingly impressive shot you took!! Wow I just checked your flickr album and, for a person who just got into photography, you became a pro pretty fast man!

    well the pictures are indeed back from 2010. (when I built the first prototype). Since then, I drifted into other projects, and lost interest in this one. But now, we are planning me and Tamima some new shots! :) when you r here you are welcome to experiment also! and if u want to have your own, I can do the PCB for u.

    as for using other flashes well .. i haven't really tried. But I am pretty sure its not that hard.. always willing to try and learn.

    I can definitely make a higher delay range. Simply by having a higher pot resistance.

    As for nice packaging.. yeah I should be working on that.

    ReplyDelete