problems with reading voltages - one pin+

trying to read two voltages from two analog pins. when one voltage chsnges the othe changes - not supposed to. any ideas? tried optos voltage dividers same results. two pins A0 --A5 effect each other

one batt-|opto|--||arduino - A0
Pwr -----|opto|---||Arduino - A5

What is providing the voltages? How are the devices connected? What code do you have on the Arduino?

As you're reading through optos I gather you are just interested in the existance of any voltage over the LED threshold, not the actual value of the voltage.


Rob

not supposed to.

Well how I presume it's connected, i'd be surprised if it didn't do that.

You need to add a pull(down is probably best in this case) resistor on the analog line as well as the opto.

when one voltage chsnges the othe changes -

This is because the impedance of your voltages is too high. Solution:-

  1. Lower the impedance, if you don't know how you will have to tell us more about your setup.
  2. Take each reading twice and discard the first one.
  3. If 2 is not enough put a delay in between the two readings.