Shop OBEX P1 Docs P2 Docs Learn Events
sound activated circuit for SSR — Parallax Forums

sound activated circuit for SSR

henrytjhenrytj Posts: 90
edited 2013-09-17 18:58 in General Discussion
If you've seen my other posts, You'll see that I've been constructing some SSR controlled outlet boxes for movie effects lighting. To add to the effects I'd like to offer to student and indie movie makers, would be a simple sound sensing circuit. The circuit would attach via 1/8 TRS mono connection to an an audio source. It would be nice if this could vary in level from mic-in to line-in. When the sound level reaches a threashold a output circuit would close that would be connected to one of my SSR outlet boxes, which would turn on a plugged-in light.

Here's what I'm getting at. Remember the old original Star Trek series. In one episode, Kirk was talking to some glowing brains. When the brains spoke, they lighted up in sync with the voice. That's what I want to do. I want to have a little box that a mic from a performer can talk into, or a line-level from a recording of a voice. When the voice gets loud enough, the output circuit closes and a light come on. When the voice drops in vorume, the circuit opens and the light goes off. Connected to one of my boxes this could drive a low wattage LED bulb for a gelly talking brain, to a 1KW movie light for a "voice of God" effect. It would be best if the circuit could be adjusted in sensativity with a knob, and can accept both mic-level and line-level audio input. And it would be best if it required no more than about $25 in parts. Can some cheap item be re-purposed for this. I have a basic stamp, but it seems that the micro-controller would not be needed for such a simple audio threshold switching task.

Thanks,
Henry
«1

Comments

  • phatallicaphatallica Posts: 64
    edited 2013-08-19 18:17
    Something like this?

    The output stage could just as easily be an opto-TRIAC driving a TRIAC.
  • kwinnkwinn Posts: 8,697
    edited 2013-08-19 21:05
    One of the many light organ circuits or kits could be used for that. They split the sound into 3 or 4 frequency bands and vary the light intensity based on the power in each band.
  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-08-19 21:34
    A few years ago I built a circuit for a local effects shop that would read the audio from a mic or line source (the interface circuit came from Making Things Talk). I used and ADC and an SX chip running at 50MHz. The output was eight LEDs shaped in the form of a mouth. When the actor spoke, the mouth lit up and got brighter and wider with volume. It was sensitive enough that the LEDs would quiver when singing and holding a note with vibrato.

    The SX is long gone, but you could use a Propeller which is, in fact easier to program. It takes a little bit of interface for dimming AC (you have to monitor zero-cross), but it's not tough to do. I wrote a driver that will detect line frequency and dim up to four circuits (it's going into a commercial product). With proper buffering, you could connect to a suitable triac for the lamps you want to contol.

    And it would be best if it required no more than about $25 in parts.

    That's going to be a challenge. Be careful not to go cheap on anything switching AC -- you don't want to be harmed or do harm.
  • henrytjhenrytj Posts: 90
    edited 2013-08-20 01:45
    phatallica wrote: »
    Something like this?

    The output stage could just as easily be an opto-TRIAC driving a TRIAC.

    Thanks. Not sure. My electronics is 30 years rusty. I used to do much more hobby electronics back then.

    My concern in looking at the circuit is that I have a 25-amp SSR that already has its own 6v-9v power on the DC signal side. All it needs is for the circuit to be closed. heres a picture of one of my boxes.
    IMG_1738-Sml.jpg
    I just need a circuit that will connect to the connector on the right to close it when a sound reaches a certain level.

    H.
    1024 x 671 - 61K
  • henrytjhenrytj Posts: 90
    edited 2013-08-20 01:46
    Thanks Kwinn. Will look into that, but my application is simpler. All I need to do is turn something on and off. No frequency channels, at least not at this time.

    H.
  • henrytjhenrytj Posts: 90
    edited 2013-08-20 02:00
    JonnyMac wrote: »
    A few years ago I built a circuit for a local effects shop that would read the audio from a mic or line source (the interface circuit came from Making Things Talk). I used and ADC and an SX chip running at 50MHz. The output was eight LEDs shaped in the form of a mouth. When the actor spoke, the mouth lit up and got brighter and wider with volume. It was sensitive enough that the LEDs would quiver when singing and holding a note with vibrato.

    The SX is long gone, but you could use a Propeller which is, in fact easier to program. It takes a little bit of interface for dimming AC (you have to monitor zero-cross), but it's not tough to do. I wrote a driver that will detect line frequency and dim up to four circuits (it's going into a commercial product). With proper buffering, you could connect to a suitable triac for the lamps you want to contol.


    That's going to be a challenge. Be careful not to go cheap on anything switching AC -- you don't want to be harmed or do harm.

    Thanks. I don't need anything that elaborate. I already have the AC switching box. Not the best in the world. Doing this on a tight budget. But, it's better than what I've seen kids doing on student movie sets. And special effects artists still use the nail-board technique for setting off pyrotechnics.

    Anyway, I just need the simplest, meaning cheapest (for now), circuit for taking an audio input, and turning it into an open/close switch on the output side when the audio passes a threshold level.
  • henrytjhenrytj Posts: 90
    edited 2013-08-20 02:31
    I am looking at topics such as instrumentation amps, and isolation amps. My electronics is 30 years old, so not sure I'm even on the right track. I am hoping that some simple op-amp and TIP circuit would do what I want. This is not a primary application of what I am doing. I was hoping it would be a simple additional effect I could add to what I'm putting together. So I don't want to invest too much time in it right now. I am hoping (crazy, of course) that it would be a straight forward "buy these 4 parts from RS and wire them together like this" kind of answer. Something I can put together on the smallest of solderless breadboards. I know, I have unrealistic expectations.

    H.
  • phatallicaphatallica Posts: 64
    edited 2013-08-20 04:14
    Hmm ... well the tricky part is to be both simple and have adjustable sensitivity.

    Since you already have the SSR ... in the circuit linked in my previous post, the collector of Q1 would be used to "pull-down" the minus side of your SSR input.

    Even at distributor prices, it couldn't be more than $3 in parts. I don't know of any way to further reduce the circuit and still be adjustable.
  • henrytjhenrytj Posts: 90
    edited 2013-08-20 11:15
    phatallica wrote: »
    Hmm ... well the tricky part is to be both simple and have adjustable sensitivity.

    Since you already have the SSR ... in the circuit linked in my previous post, the collector of Q1 would be used to "pull-down" the minus side of your SSR input.

    Even at distributor prices, it couldn't be more than $3 in parts. I don't know of any way to further reduce the circuit and still be adjustable.

    Thanks. Then that's the circuit I will build. I see two pots. R3 and R6. Which does what? If you don't mind me asking. It might be a couple weeks before I get to it. Much chaos in my life. Have to find a replacement job for the one I lost a couple weeks ago. I have a science degree, but last few years all I've found is warehouse labor temp jobs. Can't seem to find my way back to better paying jobs. Economy is terrible here.

    H.
  • henrytjhenrytj Posts: 90
    edited 2013-08-20 11:49
    Also, will a 6v battery (rather than the 5v in the schematic) power supply affect the circuit much? Or even 4.8v (rechargeable AAs)?

    Thanks again.
  • phatallicaphatallica Posts: 64
    edited 2013-08-20 13:35
    henrytj wrote: »
    Also, will a 6v battery (rather than the 5v in the schematic) power supply affect the circuit much? Or even 4.8v (rechargeable AAs)?

    Over the range that you mention, there should be no big problem. The sensitivity might change a little, since there are a couple of voltage dividers that are based on supply voltage.
    henrytj wrote: »
    I see two pots. R3 and R6. Which does what?

    These are described in the link. R3 sets the gain of the input signal, so you can adjust based on different inputs.

    R6, in my opinion, is somewhat redundant. You could probably remove R5, R6, and R7, and just connect U1:pin5 to U1:pin3.

    Since it might be a few weeks until you get to it ... I am going to be updating a similar circuit that I built maybe 5-6 years ago for an animatronic Santa Clause, to try to improve the response. I will try to remember to post what I come up with.
  • henrytjhenrytj Posts: 90
    edited 2013-08-20 14:28
    phatallica wrote: »
    Over the range that you mention, there should be no big problem. The sensitivity might change a little, since there are a couple of voltage dividers that are based on supply voltage.



    These are described in the link. R3 sets the gain of the input signal, so you can adjust based on different inputs.

    R6, in my opinion, is somewhat redundant. You could probably remove R5, R6, and R7, and just connect U1:pin5 to U1:pin3.

    Since it might be a few weeks until you get to it ... I am going to be updating a similar circuit that I built maybe 5-6 years ago for an animatronic Santa Clause, to try to improve the response. I will try to remember to post what I come up with.

    Sorry, I had the schematic only PDF up on my screen. Forgot ab.out the explanatory web page. But in that page, it describes R6 as the sensitivity adjustment. So how can I lose that?

    H
  • phatallicaphatallica Posts: 64
    edited 2013-08-20 17:39
    henrytj wrote: »
    it describes R6 as the sensitivity adjustment. So how can I lose that?

    I was wrong ... I just did the (literally) back-of-envelope calculations and realized that the small impact of R6 does fill a purpose - it is an offset to prevent false triggering due to very small signals such as background noise.
  • kwinnkwinn Posts: 8,697
    edited 2013-08-20 19:07
    You might want to try using a 555 timer to drive the ssr. The simplest circuit would have the 555 wired as an astable oscillator and input the audio signal on the control pin. Another option is to wire it as a monostable and input the audio on the trigger pin.
  • henrytjhenrytj Posts: 90
    edited 2013-08-21 23:49
    kwinn wrote: »
    You might want to try using a 555 timer to drive the ssr. The simplest circuit would have the 555 wired as an astable oscillator and input the audio signal on the control pin. Another option is to wire it as a monostable and input the audio on the trigger pin.

    Thanks on that suggestion too. Wow, it's been a long time since I've worked with one of those. I know I have, or used to have, a few around here somewhere.
  • phatallicaphatallica Posts: 64
    edited 2013-08-25 18:04
    I found my notes from years ago, and realized that my working circuit was actually inspired by this circuit.

    I tweaked my old circuit and threw it together on a cheap breadboard. Hand-drawn schematic attached ... I will upload a video link shortly. If it meets what you were seeking to do, then feel free to copy.

    0.1uF capacitor must be non-polarized, like the ubiquitous ceramic bypass capacitor.

    Only one potentiometer is necessary; it sets the amplification of the input audio signal. The values that I selected were to allow for input audio signals of 100mV to 1V peak to peak. The magnitude of the amplified audio is compared against 0.6V (reference set by second diode), turning on the output transistor based on the audio level.
    1024 x 768 - 56K
    1024 x 768 - 68K
  • phatallicaphatallica Posts: 64
    edited 2013-08-25 19:19
    Video linked here. An indicator LED shows the effect. In my circuit, I am driving a solenoid-activated mouth instead of a SSR.

    The audio is an old newscast blooper ... I may do some further testing using the ATT text-to-speech website.
  • henrytjhenrytj Posts: 90
    edited 2013-08-27 19:26
    Went to RS today to get the parts for this. After collecting the resistors and capacitors, it turned out they didn't stock the key part. The Op Amp. So I put everything back. Figure if I have to order one part, why not all of them. But, where? What are good vendors for hobbyists to order $15 of parts from without paying more for shipping than what the parts cost?

    H.
  • phatallicaphatallica Posts: 64
    edited 2013-08-27 19:54
    My choice of LM2904 for the op amp was only based on having some in my parts bin. There are many other choices that would work, such as LM358.

    If you can wait about 2 weeks for stuff to come from Thailand, then Tayda Electronics is a good hobbyist source. Minimum order is $5 and shipping is typically under $2 for a small batch of components.
  • henrytjhenrytj Posts: 90
    edited 2013-08-27 20:24
    phatallica wrote: »
    My choice of LM2904 for the op amp was only based on having some in my parts bin. There are many other choices that would work, such as LM358.

    If you can wait about 2 weeks for stuff to come from Thailand, then Tayda Electronics is a good hobbyist source. Minimum order is $5 and shipping is typically under $2 for a small batch of components.

    Okay, another question if you don't mind. For the potentiometers on this project, do you recommend a linear, or one of the several non-linear varieties?

    H.
  • henrytjhenrytj Posts: 90
    edited 2013-08-27 23:31
    Oh, and one more new question about your circuit please. If two circuits are built side by side on the same breadboard, sharing the same battery power supply, would there be any interference or cross-talk between the two?

    Thanks,
    H.
  • phatallicaphatallica Posts: 64
    edited 2013-08-28 08:29
    henrytj wrote: »
    Okay, another question if you don't mind. For the potentiometers on this project, do you recommend a linear, or one of the several non-linear varieties?

    Either linear or log should be ok.
  • phatallicaphatallica Posts: 64
    edited 2013-08-28 08:43
    henrytj wrote: »
    Oh, and one more new question about your circuit please. If two circuits are built side by side on the same breadboard, sharing the same battery power supply, would there be any interference or cross-talk between the two?

    Any cross-talk would be quite small and would be unlikely to affect the performance of this circuit. Having a 0.1uF bypass capacitor from VCC to GND (near each op amp chip) never hurts as a general practice.

    If building 2 circuits, then a quad op amp such as LM324 could also be considered.
  • henrytjhenrytj Posts: 90
    edited 2013-09-08 15:00
    After about 2 weeks shipping, got my bag-o-parts. I've started building the circuit on a solder-less breadboard. Taking it slow as I am rusty at this. Hope to have it done in the next few days. Will let people know how it works out.

    H.
  • henrytjhenrytj Posts: 90
    edited 2013-09-13 12:34
    phatallica wrote: »
    Something like this?

    The output stage could just as easily be an opto-TRIAC driving a TRIAC.

    (lost the first time I tired to post this. Trying again.)

    Built the above circuit but it's not working. Pretty certain that it is wired correctly. Using an LED test the output of the 2N2222. The LED is always ON. I turn both pots to the there extreme settings, and the LED always stays ON. I've connected a mic, had nothing connected, the LED always stays on. I've never worked with OP Amps and don't know how to troubleshoot such a circuit. Any suggestions?
  • phatallicaphatallica Posts: 64
    edited 2013-09-13 13:29
    henrytj wrote: »
    I've connected a mic

    There are different kinds of microphones, but I do not have practical experience with any of them. For testing, I would feel more confident with the headphone output of a radio or such (I used a computer headphone output for the circuit in post #17 and #18).

    What tools do you have at your disposal - multimeter? o'scope?
  • henrytjhenrytj Posts: 90
    edited 2013-09-13 22:13
    henrytj wrote: »
    (lost the first time I tired to post this. Trying again.)

    Built the above circuit but it's not working. Pretty certain that it is wired correctly. Using an LED test the output of the 2N2222. The LED is always ON. I turn both pots to the there extreme settings, and the LED always stays ON. I've connected a mic, had nothing connected, the LED always stays on. I've never worked with OP Amps and don't know how to troubleshoot such a circuit. Any suggestions?

    Okay. Got it to work. It's my fault for being so idiotic to be gullible in assuming that the right parts were sent. When I checked the little bags of parts against the order list, I used the label on the bags. And did so in the circuit construction. But, the resistors in the bag meant for R8 from the diagram did not turn out to be the yellow-violet-red ones, but yellow-violet-gold ones instead. So they were not 4.7k, but 4.7.So no wonder why the LED stayed switched on. Lacking 4.7k, I connected 2-2,2k (for R9) ones in series instead. I still have to figure out the best way to adjust the two pot settings, but in an initial test, it is working.

    Thanks everyone.

    Henry
  • phatallicaphatallica Posts: 64
    edited 2013-09-14 06:34
    henrytj wrote: »
    Okay. Got it to work.
    Awesome!
    did not turn out to be the yellow-violet-red ones, but yellow-violet-gold ones instead
    When I was 17, while taking a color-blindness test, I distinguished colors that the tester told me were not different. I have distrusted the perception of color ever since.
  • henrytjhenrytj Posts: 90
    edited 2013-09-14 07:53
    A friend of mine is like that too. She can see the slightest blue in a hue of red. I have normal color vision. I was just not paying attention while building the circuit.


    Anyway, the circuit is a success. Now if the aliens attack, we'll be ready. Unless, they attack today while we have only the prototype. Hmm, probably shouldn't be broadcasting this then. Unless it's a trick. That's it. It IS a trick. We have thousands of these placed strategically around the globe, at the ready.

    *Click* *Click*

    Whew, that was a close one. I'm certain that those stupid aliens bought it.

    Here Bettie, get this alien-defeating, Earth-saving prototype circuit over to the 3-D printing lab as fast as you can. Tell them to churn out thousands. The lab's all the way across campus. You sure pick a fine day to come to work in high heels and a tight skirt. I mean, looks great, but... Anyway, on your way.

    *Door open and close.* *Tap, tap, tap...* of heels down the hallway.

    (pause)

    Hey Joe, how about them Steelers. I think they should-- What? The mic is still ON? We're still broadcasting?

    *Flying saucer WHOOSH rattles the windows*
  • phatallicaphatallica Posts: 64
    edited 2013-09-14 09:11
    henrytj wrote: »
    Hey Joe, how about them Steelers
    Must be talking to Joe Flacco, because the Pirates are the only winning team in Pittsburgh. Coincidentally, that is proof positive of both alien invasion AND the zombie apocolypse. Better make more prototypes.
Sign In or Register to comment.