LED Sound Sensor Help

Discussion in 'The Projects Forum' started by emarti13, Jul 24, 2011.

  1. emarti13

    Thread Starter New Member

    Jul 24, 2011
    11
    0
    I am trying to build a circuit that will be placed into a mask. The goal is to have 3 LEDs, one in each eye and one in the mouth and to have them blink to music. The idea is to have them blink in sync with music at a concert. I have taken basic EE classes and can look at circuits but am pretty novice. Tried to use some mixed tutorials from instructables but I can't get it to work. I have verified that the LED circuit in my schematic works with a direct line plugged in (i.e. it blinks to the music) so I am guessing the sound sensor part is where I am having trouble. Can anyone look at my schematic and give me some advice? Like I said, apologies, it is scrapped from a few different places but I tried to color code the lines to make it easier to read.
     
  2. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Well, the wiring of the OPAMP doesn't look good (-input on ground) and there is no base resistor.

    Is 6V the voltage you will use? 4x AAA batteries, I guess?

    And what microphone is this? Electret condenser mic? If not do you have the specs, like sensitivity, voltage output etc. (maybe not absolutely necessary to solve your problem.)
     
  3. emarti13

    Thread Starter New Member

    Jul 24, 2011
    11
    0
    4 AAA batteries and electret condenser mic are both correct.

    Should the -input just run from the mic and into pin 2 and then the ground be on its own? What size resistor should there be and where exactly?
     
  4. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    The -input should actually be a virtual ground. I had a look at the datasheet. It appears that the gain you adjusted is 200 (I didn't know that this is not a normal OPAMP).
    You didn't mention the model of your mic, if it has an amplifier , sensitivity etc.

    I've seen output voltages for 1 Pascal that can range from a few mV without internal amp to 170mV with amp.
    Also, at a concert , sound pressure will vary greatly depending on the music played and your location (in relation to the loudspeaker boxes), so I guess this thing may need some kind of automatic gain control.
    If you want it in sync with the music do you mean it should only respond to bass?

    But first you need to know the characteristics of your mic. It seems that it doesn't give you enough output voltage, so you may need a preamp.
     
  5. RRITESH KAKKAR

    Senior Member

    Jun 29, 2010
    2,831
    89
    One question....

    which is very useful, What happen on this resistance of C. mic on speaking..??
    means how it changes....??
     
  6. emarti13

    Thread Starter New Member

    Jul 24, 2011
    11
    0
    Ok let me try to answer all the questions, again I apologize for being new and thank you for holding my hand through this. Learning as I go.

    praondevou - I do not know much about the mic. I just took it out of a basic computer mic. I believe it came with my Dell computer from the late 1990s if that can be of any help. I just thought this would be a basic project so I didn't buy a new one but I might if that would make things easier.

    The music question is a bit trickier. Bass would primarily be what I want it to respond to I guess. I just figured the music would be loud enough at a concert, whether it is indoor or out to be picked up by the mic. Yes though I guess bass is what I want it to pick up.

    I assume I need a preamp and that is where the LM386 came in. With most sound sensor tutorials I found that applied to what I am trying to do it seemed like people used the circuit with gain of 200 to amplify the mic. I guess any explanation by you to clarify would be helpful to my learning.


    RRITESH KAKKAR - I don't really understand your question, to be honest. Could you maybe explain a little better? I am sorry I don't follow.
     
  7. RRITESH KAKKAR

    Senior Member

    Jun 29, 2010
    2,831
    89
    Its OK, see if you say or just some sound in front of condenser mic or etc....Mic.
    It resistance will change that is sure but with respect to sound. this was the question of mine..!!
     
  8. emarti13

    Thread Starter New Member

    Jul 24, 2011
    11
    0
    How do I check that? Is there a computer program? I have tested the mic works, actually just did, by plugging it into my computer and talking in to it. It was recognized but beyond that I don't know how to get any specs on it. It is a two connection electret mic.
     
  9. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    What RRITESH said, you could check it with an oscilloscope. You'll need to know the sensitivity of the mic to determine the gain you need...

    Also, what you need is something similar to this circuit, one amplifier and one circuit that rectifies and smoothes the amplified signal. This signal then you can feed to a base of a transistor.

    The amplifier you already have, and in case of this particular OPAMP you also don't need a dual supply, -input can obviously be tied directly to GND (according to the datasheet).
    At the output of your IC you'll have the amplified AC signal from your mic with a DC offset. You have to put a capacitor in series to remove DC-part of the output signal.

    The circuit you've seen on instructables is very simplistic as it puts AC on the transistors base... I don't even know if/how well this works.

    I'm trying to do a simulation on my computer but I'm not sure how to simulate a music signal :-/
     
  10. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
  11. emarti13

    Thread Starter New Member

    Jul 24, 2011
    11
    0
    This is starting to make some sense. I found an oscilloscope and used it to test the mic. I am attaching to readout that I think shows the most although there is not much there.

    [​IMG]


    I wanted to list what I have to work with in terms of supplies and see if you can help me with the circuit. I am confused on one thing. If I am taking the DC out after the first op-amp then what is the need to rectify it later in the circuit?

    I have the following to work with, along with everything already posted in the schematic:


    Resistors
    100 ohm
    100k ohm
    10k ohm
    47 ohm
    47k ohm

    220μf capacitor
    .1μf capacitor

    LM386 Audio Amplifier


    I guess what else would I need, and what happens if I don't have a low-pass filter or a rectifier for the purposes of my better understanding. Thanks.
     
    Last edited: Jul 25, 2011
  12. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    The DC has to be taken out to make sure that you only use the AC signal going to the transistors base (the pos halfwaves) and do not bias the transistor with a DC making it always conducting.

    you are right, rectifying is not needed in your circuit, because your OPAMP has a single supply so the ICs output voltage will never be negative.

    On your oscilloscope picture it's not clear what is the voltage level of the signal.
    I think if you don't have a low-pass filter I guess the LEDs will be flashing without showing a real relationship to the music.
    I also think as a music signal is kind of difficult to simulate on a computer, you need to experiment a bit.
     
  13. emarti13

    Thread Starter New Member

    Jul 24, 2011
    11
    0
    ok great, well do I have enough to try out? I see the 1M resistor is about the main thing I don't have and I seem to have a larger capacitor than shown there. Also the 12V in the schematic is double my 6V. Will any of these variables have a bad impact on the circuit or do I have what I need to take a stab at it?

    Found a better oscilloscope:

    The first picture is me talking directly into the microphone. About 6in. away at the farthest.

    [​IMG]

    The second one is a picture when playing music from my computer speakers. I held the mic about 2.5 ft away from the speakers just to get an idea of whats happening in a more practical setting for what this will be used for.

    [​IMG]
     
  14. #12

    Expert

    Nov 30, 2010
    16,261
    6,770
    The 1 meg resistor is in charge of setting the gain at 1000.
    You probably don't need that much. 180k to 220k should work.
    Actually, that position is a good place to put a volume control.
     
  15. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Ok, this is the first step in case you want to stick to the LM386.
    You can shape its frequency response by adding an RC from output to Gain1.

    The filter in my last post is a sallen-key low-pass with cutoff at 153Hz.

    You can achieve similar values buy increasing the 22nF capacitor in the attached diagram.

    The circuit with one IC is giving you now the "bass boost" mentioned in the datasheet.

    Max. amplification is 185 and minimum is 25. Maximum of this IC is 200 (see datasheet)
    The low amplification at very low frequencies is due to to series input capacitor (could increase that value, but I don't think it's necessary.

    To be continued...
     
  16. emarti13

    Thread Starter New Member

    Jul 24, 2011
    11
    0
    Cool. I will wait to ask questions then cause, to be honest, I am kind of confused with just that. I should still use two LM386s one for amplification and one for low pass?
     
  17. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    No, my last post amplifies and "low passes". I'm trying to get this thing to drive the LEDs without further IC because you said you don't have other components at hand. The easy way would be to use the schematic from post #10 that I found on the net.

    If you are lucky someone else is faster than me and has another idea.:D
     
  18. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Do you have any other npn general purpose transistor at hand? the TIP31 is totally overrated.

    If one really wanted the LED blinking to the rhythm, that's not such an easy task. A simple low-pass filter might not be enough.
    I put some trance music into the simulator and looks not to bad, I put some death metal from Norway and it's just crazy flashing. The biggest challenge I guess is to filter out the frequency band where the rhythm is "hidden".

    I attach a picture from the simulator. R6 you can put a lower value too. I'm actually not quite sure how to work with audio signals in these simulations. :confused:

    However, something is flashing. I was wondering also if I could drive the LEDs directly from the output of the IC but didn't succeed. I think there is still a lot of room for experimenting. Maybe someone else from the forum can help you out?

    see attachment

    I found another circuit too, it doesn't has a low-pass filter, but maybe it's not even necessary

    [​IMG]

    The best would still be a circuit with automatic gain control, amplification would always adjust to the maximum average sound pressure, but I guess that's more difficult to achieve.
     
  19. emarti13

    Thread Starter New Member

    Jul 24, 2011
    11
    0
    I apologize, what I listed was what I had ALONG with what I already had posted in the schematic, so I actually have 2 LM 386s on hand.
     
  20. emarti13

    Thread Starter New Member

    Jul 24, 2011
    11
    0
    I have tested both circuits, the mic circuit and the LED circuit independently.

    I hooked the mic up to a speaker and it worked fine, staticy, but it picked up what I was saying through the speaker.

    The LED has been tested with a 3.5mm jack plugged directly into an audio source.

    When I put them together the LEDs just stay lit, can anyone shed light on why they work independently and not when put together?
     
Loading...