Need Help! LM386 with Automatic gain from 20 to 200

Discussion in 'The Projects Forum' started by Etronic, Nov 7, 2012.

  1. Etronic

    Etronic Thread Starter Member

    Joined:
    Oct 7, 2011
    Messages:
    91
    Location:
    USA
    Hi all

    I need to make this.

    Hi
    I'm looking to use the LM386amp with a sensitive mic with automatic gain
    From 20 to 200. The output will need to have enough single for
    the next stage,the HT9170 chip to pick-up the single.
    Does anyone have a working schematic that i could use for my application.
    With the LM386 amp.And how do i get a automatic gain from 20 to 200
    with low noise.

    kindly appreciate your help.
  2. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    Maybe you can get enough gain from the HT9170 op amp to avoid needing a preamp. How much signal are you getting from the microphone?
    Why do you think you need AGC?

    BTW, 'single' means 'one'. The word you want is 'signal'.:)
  3. Etronic

    Etronic Thread Starter Member

    Joined:
    Oct 7, 2011
    Messages:
    91
    Location:
    USA
    Hi Ron

    I making a remote security dtmf electronic lock opener.At a
    range of 10FT.I need the AGC to get enough pickup.The HT9170 will not pick it up at that distance.I'm assuming a gain of 20 to 200 will be enough. Until i test it.

    Ron. Do you or can you provide me with a schmatic that will work,with a LM386 with AGC or aother preamp.
  4. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    I don't think you need AGC. I think you can use a fixed-gain preamp, followed by a lowpass filter, then a high gain limiter (such as a comparator with a little hysteresis). Feed the square wave output of the limiter to the HT9170. This is much simpler than an AGC circuit.
    I believe the HT9170 will work fine on square waves. You could easily test it on the bench before you design and build the preamp and filter.
  5. Etronic

    Etronic Thread Starter Member

    Joined:
    Oct 7, 2011
    Messages:
    91
    Location:
    USA
    http://howcircuits.com/lm358-preamp.html
    Ron

    can you provide me with a schematic of preamp plus filter and limiter So i have something to build.I'm not an engineer.TL071amp,LM358amp,might
    work as the preamp.What would you use or recommend.About the filter
    no idea what or how to build one.And what comparator to use.

    I found the above link on a 358.Will this do. Will i need to add or change any parts
    in that circuit.Or would the TL071 circuit work better. link below.


    http://www.elektropage.com/default.asp?tid=556
    Last edited: Nov 13, 2012
  6. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    Do you have to run the op amp on a 5V supply, or do you have dual supplies available? if so, what voltages can you use?
  7. Etronic

    Etronic Thread Starter Member

    Joined:
    Oct 7, 2011
    Messages:
    91
    Location:
    USA
    Ron

    I have either single supply voltage of 3.3V or 5V i need to use.I perfer 3.3V.
  8. Audioguru

    Audioguru New Member

    Joined:
    Dec 20, 2007
    Messages:
    9,411
    Location:
    Ontario, Canada
    The LM358 preamp uses the opamp as an inverting amplifier that has a very low input resistance of 1k ohms that attenuates the signal from the mic. The opamp should be a non-inverting amplifier with a fairly high input resistance.
    The LM358 is too noisy to be a mic preamp. Use an audio opamp instead.
    An LM358 is a dual opamp, a single opamp should be used instead.

    The preamp with the TL071 audio opamp has the polarity of its HUGE 10uF input capacitor backwards and does not have biasing for an electret mic.
    The 10uF capacitor passes earthquake frequencies as low as 0.68Hz.
    For an audio response down to 20Hz the input capacitor should be a 330nF non-polarized film capacitor instead.

    The minimum supply voltage for a TL071 is 7V so it can't be used with your 3.3v or 5V supply.
  9. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    Here is an automatic gain-controlled amplifier that simulates well. With the level control set at 3.37V, the output will be ≈2V p-p, when the input is between 10mV and 100mV p-p.
    The 2N5460 is available at Jameco
    MCP6401 is made by Microchip. It is available from several vendors.
    The MCP6401 is a rail-to-rail I/O, low-noise op amp. You may not need the low noise feature.

    Attached Files:

    Last edited: Nov 21, 2012
    DickCappels likes this.
  10. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    I drew the boxes to highlight the functions of the various parts of the circuit.

    See VCA810. Fig. 32 is an AGC amplifier.
  11. Audioguru

    Audioguru New Member

    Joined:
    Dec 20, 2007
    Messages:
    9,411
    Location:
    Ontario, Canada
    The microchip opamp might be too noisy (hiss) to be a mic preamp.

    What do you have that produces DTMF tones that are heard as far away as 10 feet?
  12. rogs

    rogs Active Member

    Joined:
    Aug 28, 2009
    Messages:
    244
    Location:
    Dorset UK (GMT)
    Sadly, not true. Although the chip itself actually 'squares off' the input internally, to present a better 'control' signal to the internal counters, this has to occur after the input band pass filters have split the signal into 'hi' and 'lo' group component signals.

    If you 'clip' the incoming signal before these input filters, you will get a lot of false decoding. I made that mistake myself, some years ago! :)

    The HT9170 (which is only an MT8870 clone) has quite an impressive input range -- almost 30dB, IIRC, so AGC is probably not necessary either.

    As Audio Guru has pointed out, use a low noise audio op-amp, like the TLO71, to provide your initial mic gain. You can also use the internal op-amp in the HT9170, to provide a little extra gain, if necessary, but I suggest keeping the gain of that down to less than 10.

    You really don't want to clip the signal before it reaches those internal band split filters.

    Even with the system set up correctly to accept audio over your required range, you do need to make sure the system is only used in a reasonably quiet acoustic environment. Too much background noise will introduce artificial '3rd tones' into the signal, which will then be rejected by the decoder......
  13. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    Yeah, I rethought my ideas and came up with the same conclusion. That's why I designed and posted a circuit (that has too many parts) with low harmonic distortion.
    Regarding the op amp, the OP requested a gain of 20 to 200. In my circuit, the output voltage is ≈2V p-p. When the gain is 200, the input will be ≈10mV p-p. I don't think op amp noise will be an issue with that input level. I do think a low-noise preamp will be required. In fact, I wonder if DTMF can be picked up by a mic from 10 ft away and decoded, unless the source of the DTMF tone is pretty darned loud.
    Last edited: Nov 25, 2012
  14. Audioguru

    Audioguru New Member

    Joined:
    Dec 20, 2007
    Messages:
    9,411
    Location:
    Ontario, Canada
    Were the tones produced from fairly loud computer speakers?

    The datasheet does not say low noise.
    Its noise is much higher than a TL071 low noise opamp:

    Attached Files:

  15. rogs

    rogs Active Member

    Joined:
    Aug 28, 2009
    Messages:
    244
    Location:
    Dorset UK (GMT)
    To keep it simple, use an LMV358 op-amp. It's not especially 'low noise' but it's fairly modern, so at 33nV/vHz it's not bad. (TLO71 is 18nV/vHz by comparison). It also works from a 3.3V supply.

    Using the circuit you linked to here: http://howcircuits.com/lm358-preamp.html


    - Substitute the opamp for the LMV358

    - make both C1 and C2 0.1uF

    - make R2 4.7K

    - omit R3 and R4, and connect pin 3 directly to pin 1 (and/or) 4 of the HT9170

    - make R5 a 10K pot

    - make the input resistor to pin 2 of the HT9170 10k, and connect C2 directly to that resistor

    - keep the feedback resistor between pins 2 and 3 of the HT9170 as 100k

    That will give you a gain range up to 200.

    Because you are using an electret mic capsule, that will be the dominant 'noise' generator, so that's why an especially low noise op-amp is not so important in this case. The LMV358 will be fine.
    Most modern electret capsules are OK, but I can recommend the Panasonic WM61A (which you can find on Ebay, or at Digikey). That's a pretty quiet device.
  16. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    Rogs, did you slip a decimal point? R5/R2 goes from 0 to 2. The gain of the HT9170 is fixed at 10. That's gain range of 0 to 20.
    I'm pretty sure that Etronic will remind you that he wants AGC (although I fail to see why he needs it).
  17. THE_RB

    THE_RB AAC Fanatic!

    Joined:
    Feb 11, 2008
    Messages:
    5,435
    I think you need to re-think your "security" door lock!

    If the door lock is opened by someone using a DTMF audible sound from any distance like a few feet, the security is totally compromised because the bad guys could just record the DTMF sound with a hidden device (like something with an auto-gain amp) and open the lock later using the recording. ;)
  18. rogs

    rogs Active Member

    Joined:
    Aug 28, 2009
    Messages:
    244
    Location:
    Dorset UK (GMT)
    My bad -- sorry! Yup, the pot should be 100K not 10K. Variable gain of the first stage up to 20 (well, 21.28 actually!:)), second stage fixed at 10.

    Thanks for that.

    Not sure what any AGC is likely to achieve? (apart from 'hunting down' to max gain, and pick up noise!)

    The input range of 'valid' DTMF signals for the HT9170 using a 3.3V supply is 30dB. (-36 to -6 dBm).
    That's a pretty useful input signal range - in fact, better by some 10dB than your required '20 to 200' range (which is only a range of 20dB) - without making life more difficult with AGC, that would probably do more harm than good!:)
    Last edited: Nov 27, 2012
  19. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    It seems that many people who ask for help have already decided what they need, and want help designing it, only to discover later that that a simpler approach will work. If you had been more forthcoming about your requirements in your first post, I would not have wasted my time designing an AGC amp. My bad for not dragging the details from you before I started designing.
    It is always better to post too much info, rather than too little.
    I am not asking for an apology. I'm just venting.
  20. rogs

    rogs Active Member

    Joined:
    Aug 28, 2009
    Messages:
    244
    Location:
    Dorset UK (GMT)
    I've not had any experience with those particular devices, but from the published data sheets they would appear to be fine. In fact, they appear to have a much higher spec than the op-amps we have been suggesting so far, so the only unknown would be with layout and supply decoupling.
    The higher frequency specs might mean you need to pay special attention to those details, and follow good supply de-coupling practice, to prevent any unwanted oscillations.
    That may not be a critical problem ---- as I say, I've not used these devices....

    You do need to remember that an 'ultra' low noise op amp is not going to make a big difference to your project here, so opamps like the LMV358 would be fine in this application.
    You are going to be using an electret mic capsule, which means that the internal premap within that mic capsule will be the defining noise source.
    You are, however, expecting to pick up your signal from quite a distance, so the room ambient noise will also be a major factor here - even in a 'quiet' room!
    So we're not dealing with a 'pro' level of low noise audio pre-amp here...... most modern op-amps, with the required 3.3V supply capability will probably be fine....
Similar Threads: Need Help
Forum Title Date
The Projects Forum Help needed: MOSFET gets hot when PWMing car highbeams as DRL lights Today at 10:48 AM
The Projects Forum i need help for our project . Thursday at 1:46 AM
The Projects Forum Help needed? step-up Boost Tuesday at 4:59 PM
The Projects Forum Need help for NiMH battery charger Tuesday at 12:04 PM
The Projects Forum Need help repairing SMPS Aug 23, 2014

Share This Page