Need help with a VU meter analog signal

analogarduinoaudiodclevel-shifting

I am making an Arduino VU meter. I need to convert an analog AC audio signal to a varying positive DC signal. I would like the following outputs:

  • 2.5 V output at 0 V input (from VM1);
  • 5 V at maximum output (when VM1 is 0.25V);
  • 0 V at minimum output (when VM1 is -0.25V)
  • The output voltage varies between 0V and 5V DC based on the analog voltage from VM1

I found a circuit online that's meant for a 6V (peak-peak) signal:

enter image description here

My input (\$V_{m1}\$) is going to be around 0.25 V (peak-peak) coming from a 3.5mm jack. How can I adapt this circuit for my signal?

Best Answer

You need to decouple the AC signal and then impose a DC bias onto it. All you need is a capacitor and two equal resistors:

schematic

simulate this circuit – Schematic created using CircuitLab

The resistors create a "mid point" voltage of half the supply voltage (2.5V), and the input voltage is added to (or subtracted from) that midpoint voltage.

If you want to boost the signal you can pass it through an op-amp in non-inverting mode with a 2.5V DC offset. There's many schematics online for that - google "op-amp non inverting single supply"

Also, to increase sensitivity, you can use 3.3V instead of 5V, set the ADC to use the EXTERNAL voltage reference, and connect the 3.3V power into the Aref pin.