Continue to Site

# [SOLVED]Microphone PreAmplifier

Status
Not open for further replies.

#### yolco

##### Member level 2
The next circuit was thought to detect noise by a MCU. It is a preamplification stage for an electret microphone.

R22 & R23 help to provide Bias current to MIC.
'Mute point' is set at 1.65V with R23 & R24.

But I have some doubts about how decide the right configuration for amplifier.
• GAIN:
• Voltage supply is 3V3 (VDD).
• Gain has to be calculated to get the highest output voltage without clipping [Av=-R32/R31]. So, now it has a gain of -100.
• From MIC supplier, I now the max output voltage from MIC is 8mV.
• Which would the suitable gain for this application? How can I calculate it for getting a max output voltage of 3V3?
• FILTERS:
• As the desired range is [100Hz - 20 kHz], C32 value should be changed.
• Will 7pF capacitor enough for a low-pass filter (f3dB=22kHz)?

The commercial solution I'm thinking to work with is the MAX4467.

Kind Regards.

Sorry - does not compute!

The references you mention do not match the ones in the schematic. Even if they did, it wouldn't work.

Should the '+' input of the amplifier go to the junction of R3 and R4 ?

The DC gain (if the schematic is corrected) is -400 (inverted and x400) but C4 will restrict it's bandwidth to just a few Hz.

Brian.

yolco

### yolco

Points: 2
Helpful Answer Positive Rating
Hi Brian,

you are right.
The rush is not good.

Please, find below the right explanation for schematics.

R1 & R2 help to provide Bias current to MIC.
'Mute point' is set at 1.65V with R3 & R4.
AV = -R6/R5 = -100
Low-pass Filter: C4 = 7pF, R6 = 1MOhm, f3db = 22.7kHz

* If R6 is changed for 4 MOhm resistor, C4 should be of 2pF to get a f3dB of 19.9kHz.

The main doubt is how to adjust the resistors values (R5 & R6) in order to get the best gain for having a maximum output voltage of 3V3?

Thanks!

The + input of the opamp should go to the junction of R3 and R4 with the end of R4 going to earth.
Frank

yolco

### yolco

Points: 2
Helpful Answer Positive Rating
Still doesn't look right I'm afraid.

I think the '+' pin should go to the other side of R4 and the bottom end of R4 and C2 should go to ground. That sets the voltage at the '+' input to half the supply voltage and because of the negative feedback through R6, the output pin should also be at half supply as well. It isn't called 'mute point' the correct term should be 'center point' or 'mid rail', the word mute means 'silent' which is not appropriate in an audio amplifier.

Your gain calculation is correct, the effective feedback resistance is R6 in parallel with the capacitive reactance of C4 so you can work out the DC gain by using the values of R6 alone as the capacitor has no effect at DC. Then to choose C4 value, work out the feedback resistance you need to achieve the gain at the higher frequency and then work out what value you need to connect in parallel with R6 to drop it's value to get the new gain. The value of C4 is chosen to give Xc = that parallel resistance. I have omitted the effects of phase changes in explaining but it should give you a close enough result.

The ratio of feedback impedance to (R5 + source impedance) is what sets the gain. Obviously there are an infinite number of values that give the ratio you need so the choice has to be made of which pair of values is best. If you use very high values two things start to go wrong: the leakage currents into the op-amp start to cause voltage errors and the effects of stray and internal capacitance start to be significant. For example, consider that you chose 2pF for C4 but the capacitance across the input of the op-amp is probably more than that, especially if you use a socket. It will have the effect of reducing the negative feedback (coupling it to ground) as the frequency increases, counteracting the effect of C4. If you choose very low values for the resistors you waste current through them and reduce the input impedance of the amplifier but you also reduce the stray capacitance effects, C4 would become a larger value to have the same effect but as the stray capacitances stay the same, it's effect becomes more predictable. There is no exact science to picking values but as your microphone is low impedance anyway, you should be safe to use R6 between 100K and 1M and choose R5 accordingly.

Brian.

yolco

### yolco

Points: 2
Helpful Answer Positive Rating
'+' Pin was wrong connected. Now, it is fixed, and placed to get the 'center point' at 1.65V (VDD/2).

Now, circuit should be ok.
But, I think there is still work to do for fixing gain as long as OpAmp's output may be clipped easily, and cutoff frequency for avoiding narrow bandwidth.

I have modified the values as:
- C3=1uF, R5=1kOhm.
- C4=75pF, R6=100kOhm.
So:
Gain (Av): -100
f3db (High-Pass) = 21.2kHz
f3db (Low-Pass) = 160Hz

Input voltage from MIC may be in the [5mV~8mV] range, then, taking into account the noise frequency variation, do you think these resistors value will be enough to get the output in the desired range?

Thanks!

You have the terms "highpass" and "lowpass" mixed up. The highpass filter passes frequencies above 160Hz (no adult male voices and no bass in music) and the lowpass filter passes frequencies below 21.2kHz.
Actually, your value of only 1k for R5 shorts and reduces the output from the mic, and affects the highpass filter frequency. Since R1 is only 2.2k then a non-inverting opamp with a high input impedance should be used or increase the value of R5 to 10k (then the value of C3 can be much lower) and also increase the feedback resistor value.

Your 'scope shows a frequency much lower than C3 and R5 can pass so it is difficult to see the extreme clipping.
Which audio opamp works from such a low supply voltage?

yolco

### yolco

Points: 2
Helpful Answer Positive Rating
Lots of op-amps work on low voltages - the MCP6001 has 100KHZ bandwidth with rail-to-rail outputs even at 1.8V single supply.

You need to be careful with your requirements, when you say "detect noise by a MCU" are you trying to make an MCU trigger when a sound is present or are you trying to measure the sound level with an ADC? For triggering, you need the audio waveform to cross the digital input threshold and that may require you to remove the DC from the op-amp output. For analog measurement you need to constrain the output so its peaks do not exceed the ADC reference voltage.

Brian.

yolco

### yolco

Points: 2
Helpful Answer Positive Rating
The MCP6001 is not an audio opamp.
It is too noisy (lots of rumbling earthquake sounds) and if its gain is 100 then 10kHz and all higher audio frequencies are cut.
Oh, I forgot that the OP does not want any low audio frequencies. Then it will need a highpass filter at its output to reduce the rumbling noise.

Hi guys,

* First of all, I mixed the terms for filters completely.

I thinking on MAX4467 for preamp stage.

The application here is to read the sound level with an ADC.
By now, MCU need to sample for a while (~10 seconds), and compare with a threshold to send or not an alarm.
Later on, audio sample will be transformed to frequency domain and compared with a pattern. But, I want to understand every step it is needed to reach that goal.

So:
- ADC reference voltage is 3V3.
- Peaks from output need to be inside this maximum range.
- Clip need to be avoided.
- Filters: fLPF=22kHz; fHPF=160Hz

Then:
- If I change R5 from 1k to 10kOhm, R6 need to be 1MOhm to get a gain of 100.
- Doing so, C3 changes to 100nF and C4 changes to 7pF. Won't C4 too much lower for this application?

I'm suspicious of this is not going to work as needed because of clipping and peaks, what do you think?

Kind regards.

All op-amps will work as audio amplifiers although I agree that some will be far better than others. In this instance where the quality will be relatively low and there is no overhead voltage for the amplifier output, almst any rail-to-rail amplifier will work satisfactorily.

There are several ways to measure sound level but the simplest is to rectify the amplified signal then filter it to remove high frequencies so all that remains is the envelope (the volume level). Because all the rapid changes are removed by the filtering, the ADC can take consistent readings. If you try to use the ADC directly, feeding it the audio signal, you have to sample it very rapidly, at least at twice the highest audio frequency, store a block of results then perform some fairly complex mathematics on the data. For now I would stick to the simple method!

Work backwards:
1. The ADC want to see the biggest voltage possible (for best accuracy) that does not exceed the reference voltage as that would make it go over-range. So target 3.3V at the ADC input pin.
2. To rectify the signal you need a diode, this will inevitably drop some voltage so you really need more than 3.3V supply to the amplifier so you can drive it with more signal to overcome the drop or you are limiting your maximum measurement to around 3.3V - Vf which with a schottky diode means about 2.9V. You can improve the linearity of the rectifier stage for better accuracy by using a precision rectifier circuit (using another op-amp to compensate for the diode non-linearity). If you are constrained to a 3.3V supply, you have to accept you will never measure 3.3V at the ADC input so you will lose accuracy.
3. Decide what time constant (LPF) you want to use for the envelope measurement, I would suggest something around 50mS to 100mS.
4. Decide the gain of the amplifier. You know you want 3300mv out and your peak input is 8mV so the voltage gain you need is 3300/8 = 412.5 times. Round this down to -400 to give a safety margin in case the microphone gives more than 8mV. I would be suprised if it didn't!
5 Use the formula Vout = -(Vin(Rf/Rin)) to calculate the resistor values. Given the high gain you need, it might be a good idea to split the amplification in to two stages.
6. Look at the amplifier frequency response you need. Can the amplifier provide sufficient gain (400 times = 52dBV) at the bandwidth you want and at 3.3V supply? If not, you will be forced to use two lower gain stages.
7. Consider the frequency response of the audio, remember you are going to pass it through an LPF with a cut-off of just a few Hz and most electret microphones have a frequency response graph that looks like a cross section of the Alps. Is it necessary to restrict the bandwidth at all? The answer depends more on the kind of sounds you are measuring than the electronic design. There is no need to tailor the response exactly if the microphone response it's exactly known and there is no point in amplifying sounds outside the range you are interested in.

Brian.

yolco

### yolco

Points: 2
Helpful Answer Positive Rating
Hi Brian,

thanks!!

I write down all your tips.
I think I'm going to proto the design to check its behaviour before routing it on a PCB.

Kind regards.

most electret microphones have a frequency response graph that looks like a cross section of the Alps.
Brian.
I disagree. I think you are talking about a piezo transducer used as a mic. Most electret mics are perfect.

#### Attachments

• Electret mic and Piezo mic responses.png
57.9 KB · Views: 106
yolco

### yolco

Points: 2
Helpful Answer Positive Rating
Status
Not open for further replies.