I'm trying to use a water sensor in a new design, and I don't understand the example circuit that is given in the datasheet, even though it looks very very simple. I must be missing something. Any help explaining why this example circuit works would be much appreciated.
I don't get how the example circuit shown in the image “Arduino circuit I don't understand” works. The datasheet for the water sensor can be found here.
In the example in question, it says that the Arduino Mega should be in a pull up mode, which I believe should pull the digital input pin up to 5 V. But the sensor is hooked up to 5 V on the other side, so when water is present and it conducts, it seems like the input pin should also go to 5 V. We tested the real device though and found that when there is water the Arduino reads a digital low.
Please explain how this circuit works and why we see a digital low when water is present. To me it looks like the following two conditions would happen:
No water present: Water sensor doesn't conduct. The Arduino input is pulled high to 5 V by the internal pull-up.
Water present: 5V is detected by the Arduino input (a high impedance digital input state) since the water allows the signal to propagate.
What am I missing? Thanks!