I have a stereo VU meter. (Audio in on Arduino pins A0 and A1 and GND to common GND also 32ohm resistors going to GND on A0 and A1 to simulate coming speakers)

Now my problem is software architecture makes each channel very sensitive to voltage changes (adapting to lower volume on each volume separately) so in turn when there is only single channel input I get fluctuations (about the same) on each channel. So, how do I isolate the two analog inputs on Arduino?

Edit: software proves, if AREF if 5V then we are measuring about 0.01V for one step on a ten step VU meter. That's why I blame very fine voltage changes in overall Vin to GND voltage for this effect I'm seeing.

schematic http://i.imgup.hu/3OqfH5.png

If I remove the 32ohm resistors going to GND, nothing changes. Should I provide Arduino code?

  • 1
    \$\begingroup\$ I'm not sure I follow electrically what you have done especially the bit about seemingly connecting the speakers to the arduino. Try drawing a schematic dude. \$\endgroup\$ – Andy aka May 15 '14 at 19:22
  • \$\begingroup\$ ohh, sorry, just a sec i.imgup.hu/3OqfH5.png although if I remove the resistors nothing changes. \$\endgroup\$ – 19greg96 May 15 '14 at 19:39
  • \$\begingroup\$ This is wrong. Your audio source provides bipolar signal (changing from positive to negative over time). You can damage your microcontroller input. \$\endgroup\$ – Kamil May 15 '14 at 19:46
  • \$\begingroup\$ f**k. Hope the 1>volts didn't damage anything so far, how to solve that? full-wave rectifier? \$\endgroup\$ – 19greg96 May 15 '14 at 19:58
  • \$\begingroup\$ Adding a diode from audio in to analog input (to cut half the signal off) destabilizes my circuit, now the VU meter not only measures sound, but the distance of my HAND!! Freaky dude.. It's like gnd is begging for contact with me.. Any idea? \$\endgroup\$ – 19greg96 May 15 '14 at 20:05

Try this: -


simulate this circuit – Schematic created using CircuitLab

D2 ensures that the signal on it's cathode is shifted to a largely positive value and D1 rectifies it. C2 smooths it and R1 allows C2 to discharge when the audio signal dies away.

You might also need to protect the analogue input with a zener diode across the input and ground but its value depends on your power supply rail to the MCU.

The reason your modified signal "read" your hand is because your equivalent of my D1 didn't have C2 and R1 and between cycles of audio the analogue input floated.

  • \$\begingroup\$ this is like the hardware version of what the software does on the arduino, but I still get mono output, so this doesn't solve anything (except maybe the bipolar signal) \$\endgroup\$ – 19greg96 May 15 '14 at 21:11
  • \$\begingroup\$ If you need to try something, try shorting the left input on the arduino to see what happens. It's either hardware or software or both. The above is the minimal proper way to deal with the h-ware. Without a cap on the input to the arduino's ADC input there could easily be cross interference between one channel and the next due to the way the internal analogue multiplexer works - it will carry over charge from 1 channel to the next - read the data sheet on the ADC. \$\endgroup\$ – Andy aka May 15 '14 at 21:16
  • \$\begingroup\$ OK, I think I'll go, dig a hole and bury myself, it was a stupid software bug, thank you for opening my eyes to it though! \$\endgroup\$ – 19greg96 May 15 '14 at 21:29
  • 1
    \$\begingroup\$ Hee Hee, sorry LOL!!! \$\endgroup\$ – Andy aka May 15 '14 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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