Hello,
I have the mic preamp from the attached picture and i need to modified it so that i can use it as sensor for an Arduino.
The preamp works, but the output signal is centered at around 2.2V and i need that 2.2v to become 0(at analogRead from sensor pin - i only need the upper "positive" part of the wave to be taken in to consideration). Basically i need to bodify this preamp to be used as a sound level sensor 0(0V on Arduino input)- no sound
1023(5v on Arduino input ) very loud sound
Can anyone help me to modify this circuit?
PS: I would like to keep the gain on each stage of the amp if it is possible
The LMV722 has inputs and outputs that go to 0V in your single supply circuit.
The second opamp must be inverting so that its input never goes below 0V. Its (+) input can be at 0V. Then its output is 0V for no signal and swings positive when there is a signal.
Here is the input of my Sound Level Indicator project (a VU meter). You might not need the transistor and peak filter capacitor:
A rail-to-rail OP doesn't achieve exactly 0 V output voltage. You can try with a low resistance (kohm range) pull-down resistor at the OP output.
As a side remark, the suggested circuit doesn't work as a half-wave rectifier, as intended. It looses part of the output level, because the C4_R9 node loads to the average output voltage and doesn't stay at 0v, as it should. Besides reducing the output level, the output gets also time dependant in an unwanted way.
Your opamp has a 0.1V minimum output into your 4.7k load.
try adding an emitter-folloer transistor to the output like i did for 0.0V without a signal.
FvM said:
As a side remark, the suggested circuit doesn't work as a half-wave rectifier, as intended. It looses part of the output level, because the C4_R9 node loads to the average output voltage and doesn't stay at 0v, as it should. Besides reducing the output level, the output gets also time dependant in an unwanted way.
I see what you mean in my circuit. the c4 capacitor has a load of only R9 when the signal swings negative but its load is much higher (R9 plus R8 plus the output resistance) when the signal swings positive.
I did try your full circuit
i don't have the parts with the specified values, instead I've used those in the schematic below. I also try to lower the Value of R11 from 4.7K down to 1K but with no luck.
Now i have 97mV without signal.
Maybe i will redo the scale from the software
I am a little bit confused
t=1.1*R[Ohm]*C[Farad]
so if i have t=1.1*220000*33/1000000000=72ms
anyway, for testing i use R=47K and C=01uF
if will affect the results i will remove this delay
Thank you very much
PS: In the real circuit i didn't forget the reaction, only on schematic (stupid me)
Added after 5 hours 28 minutes:
well
i removed the RC delay
But something is wrong with the circuit and i can't figure out what is it
I've changed R4 value from 220K to 10K (maybe i will change it to 4.7K) because on the second stage seems that i have no gain
Can any one tell me if is something wrong with the circuit?
I used the transistor inside the feedback loop so that the changing base-emitter voltage does not affect the output voltage instead of your external diode that affects the output voltage.
I biased the input of my opamp at 0V so that the output of the transistor is also 0V without a signal.
I think your new circuit has a DC voltage at its output when there is no signal.
As i am still a beginner in electronics i followed some advice from arduino forum
"Take R6 and replace it with a pot with the wiper going to pin 3 and the ends to +5 and ground. That should allow you to control the DC level. However it will not turn it into an envelope follower which is I think what you want. For this put a diode in line with the output feeding into an R&C to ground. Then feed that into the analogue input of the arduino. "
"In my previous attempt i use an RC delay with R=47K and C=100n because i need a small delay (0 will be perfect Smiley ) but instead of a diode i used a 100Ohm resistor.
Regarding the R6 replacement, if i will use a pot then i will have an offset voltage. If no sound (or sound above a threshold) is present the i need my output to be 0, in this case i don't think it is possible. I am wrong? "
And this is the phrase that got me to redo the circuit
"
yes you need a DC offset, currently you have a DC offset of 0V with respect to the signal ground. However this signal ground it 2.5V above the arduino ground. therefore you want to have a DC offset of -2.5V. This then would give you 0V for no signal."
this is the reason i modified the circuit
Should i use 1N4148 or R=100 ohm to obtain an envelope follower?
What do you suggest?
Thanks again for your help
Replace the diode with a 100 ohm resistor. The transistor is already the rectifier and is inside the negative feedback loop of the opamp so the transistor plus opamp are a perfect half-wave rectifier with a voltage of 0V with no signal when R9 is the load for the transistor.
C8 forms a peak detector (or envelope follower) with a fast attack time and a slower release time. Remove C8 then the output will be half-wave pulses of the signal.