Need Help! LM386 with Automatic gain from 20 to 200

Thread Starter

Etronic

Joined Oct 7, 2011
127
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.
 

Ron H

Joined Apr 14, 2005
7,063
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'.:)
 

Thread Starter

Etronic

Joined Oct 7, 2011
127
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.
 

Ron H

Joined Apr 14, 2005
7,063
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.
 

Thread Starter

Etronic

Joined Oct 7, 2011
127
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:

Ron H

Joined Apr 14, 2005
7,063
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?
 

Audioguru

Joined Dec 20, 2007
11,248
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.
 

Ron H

Joined Apr 14, 2005
7,063
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.
 

Attachments

Last edited:

Audioguru

Joined Dec 20, 2007
11,248
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?
 

rogs

Joined Aug 28, 2009
279
I believe the HT9170 will work fine on square waves.
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......
 

Ron H

Joined Apr 14, 2005
7,063
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......
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:

Audioguru

Joined Dec 20, 2007
11,248
I was using a DTMF generator i found on the internet to generate the
tone sounds.From my computer.
Were the tones produced from fairly loud computer speakers?

The MCP6401 amp has .... low noise.
Audio Guru stated it will hiss.
How would it hiss if it states its a low noise amp?
The datasheet does not say low noise.
Its noise is much higher than a TL071 low noise opamp:
 

Attachments

rogs

Joined Aug 28, 2009
279
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.
 

Ron H

Joined Apr 14, 2005
7,063
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).
 

THE_RB

Joined Feb 11, 2008
5,438
...
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.
...
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. ;)
 

rogs

Joined Aug 28, 2009
279
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).
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:

Ron H

Joined Apr 14, 2005
7,063
rogs

Thanks!

I will set the circuit up as noted.Once i receive the parts.
I will be back.

I thought about the AGC. As you guys stated i don't need it.
And just more added part to the circuit which i don't
want either. A variable pot gain will do.I just will need to
set the gain as needed.
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.
 

rogs

Joined Aug 28, 2009
279
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....
 
Top