Hi:
To be clear, I'm a bit of a newbie.
I'm having trouble trying to read moisture sensors connected to the first 4 analog input pins on an Uno. I'm using some moisture sensors plugged into LM393 boards supplied with the moisture sensors. I only connect the analog outs from the LM393's to the analog pins on the Uno, and leave the digital output from those boards unconnected. I've measured the voltages getting to each LM393 and all are getting ~4.95v.
I do a digitalWrite(a*,HIGH) to each pin to set the pullup resistor and then call pinMode(a*,INPUT) to set the mode back to input (I see that this might not be necessary since I'm following it with an analogRead(a*) later).
I then loop over analogRead(A*) and serialWrite calls. When I sequentially short the two moisture sensor arms on a sensor, the first 3 sensors (whose analog outputs are tied to A0-A2) show no change in their value (all four sensors stay at ~1023), but when I short out the Moisture sensor arm for the 4th sensor (on pin A3) that sensor's output drops to ~0 and the other 3 sensor outputs drop to ~200-300 (although these latter values do vary).
Any ideas on what I'm doing wrong and how I can get the 4 sensors to be independent and correctly read the resistance across the moisture sensor arms? I've switched the LM393 boards and moisture sensors around and find that the board/sensor combo connected to A3 always works and the other 3 do not.
In case this is relevant, I am using i2c devices (real time clock and LCD) that are connected to A4 and A5. But I believe that I get the same behavior even if the i2c devices are disconnected.
I'd really appreciate any input as this is driving me crazy!