0
\$\begingroup\$

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?

\$\endgroup\$
4
  • \$\begingroup\$ How many volts peak to peak is the audio signal? \$\endgroup\$
    – Andy aka
    Mar 4, 2015 at 12:30
  • \$\begingroup\$ Do your first and last bullet points conflict? Is a 0V input equal a minimum input? \$\endgroup\$
    – Nedd
    Mar 4, 2015 at 12:54
  • \$\begingroup\$ @Nedd edited the bullet points, should be more clear \$\endgroup\$
    – Kad
    Mar 4, 2015 at 13:03
  • \$\begingroup\$ Oops - I meant to edit this to 0.25 V peak, not peak-peak! My mistake. \$\endgroup\$
    – Greg d'Eon
    Mar 4, 2015 at 13:18

2 Answers 2

1
\$\begingroup\$

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.

\$\endgroup\$
8
  • \$\begingroup\$ What if the audio signal is 10V p-p? \$\endgroup\$
    – Andy aka
    Mar 4, 2015 at 12:31
  • \$\begingroup\$ I tried to simulate it using Multisim 15, I dont get any changes based on the voltage from V2. Here is my schematic: puu.sh/glYXT/4191172972.png Im sorry if i do a obvious mistake, just a student here :) \$\endgroup\$
    – Kad
    Mar 4, 2015 at 12:58
  • \$\begingroup\$ @Andyaka then you risk blowing the Arduino up. But it's not - it's stated as 0.25V peak, so 0.5Vp-p. Hence the mentioning of the op-amp. \$\endgroup\$
    – Majenko
    Mar 4, 2015 at 13:30
  • \$\begingroup\$ @Kad That's because you are using a DC source. Use an AC source instead, like your audio signal is, and look at the difference it makes. \$\endgroup\$
    – Majenko
    Mar 4, 2015 at 13:30
  • \$\begingroup\$ @Majenko I asked that question before the OP had stated the input level. \$\endgroup\$
    – Andy aka
    Mar 4, 2015 at 14:20
0
\$\begingroup\$

My input (Vm1) is going to be around 0.25 V (peak-peak)

Ideally, you need an amplifier (op-amp) to raise this signal level from 0.25Vp-p to 5Vp-p. This implies a gain of 20. You also need to apply a dc offset to raise it from having an average voltage of zero volts to 2.5 volts.

enter image description here

The above is a |gain| of 2 ac amplifier so if you reduce R1 to 10k the |gain| is 20. I would also recommend running this from a 5V supply and using a rail-to-rail op-amp. Ignore the components connected to the output C1 and CL - feed the op-amp output directly to your arduino. Here is a link to the internet page I took the circuit from. It may also make useful reading.

If in fact you find that your arduino hasn't got the processing power to sample at the full audio rate and convert the incoming AC to RMS then you can modify the op-amp circuit to do an RMS approximation - then the arduino is only dealing with a relatively slow moving dc signal that follows the peak amplitude of the audio - this needs to be sampled at only a few tens of hertz.

Precision rectifier: -

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ I thank you for your answer but i still dont get it, could you dumb it down a notch for me :P. Also i dont need something complicated just something that will do the job. By the way i dont really care that the arduino doesent read the entire audio spectrum, in fact i dont need that. All i need is that sometimes it can read the peak value. My program will be based on that it will read from the audio scource and get the highest value. Then set the diodes to whatever that value corresponds to. As time passes it will slowly decrease the max-value. Until a new and higher max value, and so on. \$\endgroup\$
    – Kad
    Mar 4, 2015 at 13:46
  • \$\begingroup\$ What main area don't you understand. Let's start with this first. \$\endgroup\$
    – Andy aka
    Mar 4, 2015 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.