0
\$\begingroup\$

I have been working on a simple project to read the analog voltage input on Arduino. I'm having problem to read the correct value on Arduino. I know what's causing the problem. I'm using the virtual ground on the op amp non-inverting side but Arduino is referencing to the digital ground instead of the virtual ground when reading the analog input value on pin A0. How can I solve this issue?

enter image description here

\$\endgroup\$
  • \$\begingroup\$ "Virtual ground" doesn't mean that it becomes ground for the whole circuit. \$\endgroup\$ – Ignacio Vazquez-Abrams Jun 11 '16 at 0:33
0
\$\begingroup\$
  • Make sure that op-amp GND (connected to its pin 4) is also connected to the Arduino GND.
  • Connect virtual ground to Arduino A1. Now the Arduino will be able to measure the reference voltage.
  • In your code the analog reading is A0 - A1.

This will give you positive values when A0 > A1 and negative values when A0 < A1.

\$\endgroup\$
  • \$\begingroup\$ I tried your suggestion and yea it works. This is what I wanted. thanks \$\endgroup\$ – rajk Jun 11 '16 at 18:32
  • \$\begingroup\$ You might add a 10u electrolytic in parallel with R3. That will keep your reference voltage stable in the presence of power supply noise. Thanks for accepting my answer. \$\endgroup\$ – Transistor Jun 11 '16 at 18:35

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.