I need a clear answer why my AnalogInputs are making bogus measurements.

I have an Uno and a Mega both measuring the same power supply output , both using "int sensorValue = analogRead(A0);" . When the power supply is on (4.5 Volts) , Both read a value which seems correct around 920, however when the power supply is turned off the reading stays about the same or it "floats" . If I measure the the point with a high impedance dvm i get about .788 volts but both arduinos are still reading 900. When I ground the inputs they do go to zero.

Questions :

  1. What can I do to stop this floating input reading? ( it should be at most reading .788 volts)

  2. s it a bad practice to connect two arduinos inputs and expect them to read voltages correctly ? Or will they source each other (or do other strange things).

  3. Should I use a pull down resistor ? If so what value ?

I would imagine that your circuit uses high value resistors that are unable to discharge the sample and hold capacitor in the ATmega328P, in a short time.

Have you read the datasheet for the ATmega328P?

The section about the ADC starts on page 250.

Quote from page 257:

The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or
less. If such a source is used, the sampling time will be negligible. If a source with higher impedance
is used, the sampling time will depend on how long time the source needs to charge the
S/H capacitor, with can vary widely. The user is recommended to only use low impedance
sources with slowly varying signals, since this minimizes the required charge transfer to the S/H
capacitor.

buckstucky:
3. Should I use a pull down resistor ? If so what value ?

Have you tried it?
What happened?

With an Arduino it is usually quicker to learn-by-doing.

...R