Question about Analog Ports....

whit3fir3:
Lefty,

Thanks for the quick reply. I guess my concern comes from more of my software design background and trying to test for the "floating input pin condition" to ensure that something is connected to the pins. For example lets say I had 2 of the water sensors but wanted to disconnect one. Instead of having to change the code a simple IF statement could catch this floating input pin condition, test for it and then NOT read the voltage from that pin if nothing was connected to it. This all depending on there being a way to test for the floating input pin condition, which I'm going to take a stab at and say there isn't a way from looking at the Arduino reference library. If I'm wrong please let me know.

Thanks,

whit3fir3

No, there is no logical method I can think of for a program to determine if a returned ADC count of say 200 was the result of a valid input voltage of that value sent by a sensor or of the results of a disconnected sensor. You must either be able to tell your program you are going to disconnect an input so it can stop reading it or some kind of external electrical circuitry that applies a known default voltage value onto the pin when there is no sensor voltage to override that default voltage (very high impedance pull-up or pull-down resistor perhaps? There is probably a hardware interfacing solution or workaround, but is it really worth the effort?

Lefty