microphone-activated LED/indicator

Thread Starter

JoeBro391

Joined May 15, 2010
68
Okay, so I've worked a lot with making LED's pulse to music and light. I've used LM3915 IC's and made VU meters and have also used basic transistors that would turn on when receiving an audio-signal from an MP3 player, LDR or stereo/laptop. I plan on making a temperature-sensitive unit, using a thermistor eventually, but for right now, I want to make a similar unit with a basic electret microphone. I've tried many schematics in textbooks and a few found on THIS website, but nothing has worked for me. It frustrates me, cause I'm usually pretty good at looking at a circuit and improving it for my own needs. I'm not sure what i'm doing wrong (it's probably just from my lack of experience with microphones and op-amps).

Ideally, I just want the input going into the mic to be able to turn a single LED on and off (varying with the noise, not a simple HIGH or LOW).

So if anyone has any helpful tips or hints, that'd be great. Circuit diagrams are always nice too :) . I'd like to make this from transistors, but I also have a few LM386N-1 op-amps in my possession. Thanks. -Joe
 

Audioguru

Joined Dec 20, 2007
11,248
Bias the (+) input of the LM386 so that its output DC voltage is too low to light the LED.
Add the 10uF capacitor from pin 1 to pin 8 so its AC gain is 200.
Bias the electret mic with a 10k resistor from +9V and capacitor-couple it to the input of the LM386.
Then the LED will pulse when the music plays near the mic.

Since you did not post your schematic then we have no idea what you made wrong.
 

Thread Starter

JoeBro391

Joined May 15, 2010
68
mms_picture (1).jpg
that's the circuit that I built but it didn't work. That's right off the 386's datasheet and looks to be about the circuit that audioguru was explaining to me. It was kinda working (led was flickering to noise, but barely) and then stopped working after about a few seconds. It looked like one of the cap's was filling up. The next step is where my limited experience with op-amp's gets in the way. Any tips would be appreciated. Thanks. -Joe
 

Audioguru

Joined Dec 20, 2007
11,248
The LM386 is not an opamp, It is a little power amp with built-in negative feedback. A big difference.

Your circuit does not bias the input of the amplifier so its output voltage is low enough so the LED is not lighted.
Your circuit has an output capacitor that cannot drive an LED because it will drive a speaker instead of a diode.
Your LED is receiving AC through the output capacitor but since an LED is a diode then the output capacitor charges until the voltage for the LED is too low to light it anymore.

My idea biases the input of the amplifier IC so that its output voltage is too low to light an LED at rest. Them the signal causes the output to go positive and light the LED.
 

Thread Starter

JoeBro391

Joined May 15, 2010
68
marshallf3: i used non-polarized capacitors.

audioguru: thanks for clearing that up, just goes to show how little i know about audio-electronics. What do you suggest I change in my circuit, so it's set up the way you think will work best?

thanks. -Joe
 

Audioguru

Joined Dec 20, 2007
11,248
Here is a circuit that I designed to pulse an LED to the beat of music or any noise:

1) I used 22k and 1k as a voltage divider to the (-) input of the LM386 so that its output DC voltage is close to 0V instead of being +4.5V to drive a speaker.
2) I added a 1N4148 diode and 220uf capacitor to keep the LED lighted during very short duration pulses of music but the circuit works without them.
3) I designed the schematic layout for stripboard construction and the stripboard layout sketch shows the strips and where they are cut.
4) I never built it so the value of the 22k resistor might need tweaking.
 

Attachments

Thread Starter

JoeBro391

Joined May 15, 2010
68
audioguru: thanks for the circuit, i hooked it all up (without the microphone) and when I apply 9V, and begin to tweek the pot, the LED with turn on (though suddenly, not really gradually) so I'll assume the circuit works just fine. But...where do I put the mic?? I tried connecting the positive lead of the mic to Vcc and the ground-lead to the pot, labeled "IN" but that didn't work and I don't want to blow out my mic. recommendations?? -Joe
 

Audioguru

Joined Dec 20, 2007
11,248
My previous circuit was for audio electrical input from an ipod or MP3. This new circuit adds resistors to power an electret mic and adds a 10uF capacitor to pins 1 and 8 of the LM386 to boost its gain to 200.
It still needs the two resistors at pin 2.
 

Attachments

Thread Starter

JoeBro391

Joined May 15, 2010
68
i don't have a 470uF cap to act as a smoothing-cap, is that a problem? I also don't have a 220nF cap, so could I just a .1uF in its place?? and which two resistors at pin-2? I'll assume you are referring to a voltage divider to bias the input? most schematics that i've seen use two 10k-ohm resistors, connected to Gnd and Vcc. Do you have any particular values that I should try? Thanks a bunch man, I really owe you for this. -Joe
 
Last edited:

Audioguru

Joined Dec 20, 2007
11,248
i don't have a 470uF cap to act as a smoothing-cap, is that a problem?
Then the "9V" from the battery is jumping up and down with the audio output power which causes all kinds of problems.

I also don't have a 220nF cap, so could I just a .1uF in its place??
The 220nF capacitor calculates a cutoff frequency (half power) into the 100k volume contol in parallel with the typical input resistance of the LM386 of 50k to be 22Hz. A 100nF capacitor increases the cutoff frequency to be 48Hz which reduces deep bass frequencies.

which two resistors at pin-2? I'll assume you are referring to a voltage divider to bias the input?
Yes.
The 22k resistor from the +9V supply that is in series with the 1k resistor to ground produces 0.391V which is amplified by the LM386 so that its output idling DC voltage is much less than the usual half the supply voltage then the LED is turned off.

most schematics that i've seen use two 10k-ohm resistors, connected to Gnd and Vcc. Do you have any particular values that I should try?
I guessed at 22k and 1k.

An LM386 has inputs that are already biased so they work at 0V. When the (-) input is bised at a positive voltage then the output DC voltage drops. The output of an ordinary LM386 idles at half the supply voltage so it can swing up and down to drive a speaker though an output coupling capacitor. You don't want the output at half the supply voltage, you want it to be biased so that it is low enough to not light an LED at idle, then the signal's positive excursions are amplified to light the LED.

An opamp is not already biased and needs two equal (10k) resistors to bias its input at half the supply voltage. Then its output is also at half the supply voltage so that its output can swing up and down.
 

Thread Starter

JoeBro391

Joined May 15, 2010
68
okay, I finally got this circuit up and working. The only problem is, I have to be whisteling directly into the microphone for the LED to turn on (and it's only turning to about 75%). Any ideas?

For the record, I substituted the 220nF cap for a .1uF cap and the 470uF smoothing cap for a 220uF cap. Also, the 100uF cap in the top-right of the circuit, i put a 220uF cap in its place as well.

-Joe
 

Audioguru

Joined Dec 20, 2007
11,248
The LM386 has a gain of only (!) 200 with the capacitor between its pins 1 and 8. My Sound Level Indicator project has a gain of 1,820 (9 times more) so it picks up the sound of a pin dropped on the floor in the next room with the door closed.

Maybe your electret mic is poor quality. Mine came from ordinary telephones and cell phones. The capacitors affect the bass frequencies response.
 

Thread Starter

JoeBro391

Joined May 15, 2010
68
ah, i understand. what type of amp did you use? was it an audio-amp, like the LM386, or an op-amp? [i'm learning ;-) ] -Joe
 

marshallf3

Joined Jul 26, 2010
2,358
Looks like the 22K and 1K set up the DC bias, can't see any way to externally alter the gain unless you could get away with a bit of positive feedback?
 
Last edited:

Thread Starter

JoeBro391

Joined May 15, 2010
68
Looks like the 22K and 1K set up the DC bias, can't see any way to externally alter the gain unless you could get away with a bit of positive feedback?
I read a chapter in Practical Electronics for Inventors on this stuff...but I really don't know what you're asking haha. If my memory serves me, positive feedback would drive the LED into saturation, and since we're not dealing with an audio-signal, it's not a big deal. So I guess that works...or am I totally wrong? -Joe
 

Audioguru

Joined Dec 20, 2007
11,248
The LM386 has negative feedback resistors built-in. It has a gain of 20, or if you add a capacitor then its gain is 200. Adding a series RC from pin 1 to ground will cancel some of the negative feedback and increase the gain and distortion and reduce high frequencies.
 

Attachments

Thread Starter

JoeBro391

Joined May 15, 2010
68
audioguru: I'll try that out. I'll assume that this is an addition to the 10uF cap connecting pin 1 & 8 and NOT a substitute? as well, is that added resistor 22 ohms or 22k ohms? I'l just try both haha. -Joe
 

Thread Starter

JoeBro391

Joined May 15, 2010
68
okay, never mind, I used a 22-ohm resistor in series with a 100uF cap and it definitely works better. I also found a better mic which considerably boosted performance. It's definitely working nicely, but now that I got the basic circuit down, i want to make it better, more power {ogh ogh ogh ogh ogh}...anyway. So any ideas? such as double-amplification with a second LM386? -Joe
 

Audioguru

Joined Dec 20, 2007
11,248
The 22 ohm resistor in series with a 100uf capacitor at pin 1 to ground steals most of the negative feedback from pin 1 so the capacitor from pin 1 to pin 8 won't do anything.
The frequency response when the gain is 1000 begins dropping at about 1.5kHz and is down -3dB at about 8kHz. When the gain is 200 then the output is down -3dB at 30kHz.
When the gain is 20 then the output is down -3dB at 300kHz.

If you use two LM386 amplifiers in a bridge and an 8 ohm speaker then the current will be too high for them so the power in the speaker will be slightly more (maybe 500mW with the bridge instead of 450mW with a single LM386) but the heating in both LM386 amplifiers will be very high.
A TDA2822M is a stereo amplifier (8-pins DIP case) similar to two LM386 amplifiers but with a higher current rating. With the amplifiers bridged and a 9V battery then they will melt (!) when they try to produce 2.5W into 8 ohms. With a 6V supply the output power is about 1.1W and the heating is not bad.
 
Top