For the past few days, I've been going in circles trying to plan a circuit to detect water between a pair of metal probes (or more precisely, between several pairs of stainless steel probes approximately 1 inch apart connected in parallel, and two "water sensor" circuit boards that consist of two zig-zagging 50-mil traces separated by 50-mil space).
The fundamental problem is, I don't really understand the finer points of Ohm's Law (or at least, the parts that might deviate from what I suspect is actually a simplified special case... when you aren't just talking about a simple resistor limiting current between +3.3v and ground).
Consider the following circuit (in series), using a 3.3v ESP32:
GPIO pin that's normally left floating as an input (to minimize galvanic corrosion of the probes), but configured for output & taken high (to 3.3v) shortly before triggering ADC conversion.
82-100 ohm resistor (to limit the maximum possible current flowing between the GPIO and ADC pins to 40mA or less, even if there ends up being a dead short and zero ohms between the probes
a pair of probes (normally, with air insulating them... potentially, with tap water insulating them a bit less)... and two or more such pairs connected in parallel (so there could be current flowing between none of them, between one pair, or between multiple pairs)
ADC input pin on the ESP32
The things that have me scratching my head:
If you assume 3.3v on the GPIO pin and only 82 ohms between it and the ADC pin, how many volts will the ADC sense/measure/see?
Does a 12-bit ADC actually have enough "headroom" to meaningfully sense the difference between all-but-infinite resistance (82 ohms + an inch of open air) and whatever resistance you'd likely encounter between two stainless-steel probes immersed in tap water? Or at best, would you end up with readings that just jittered between something like 0 to 5 and 2 to 7 (out of 4095), and were so close and mostly-overlapping, you almost might as well randomly flip a coin to decide whether or not there's water present?
I suspect that the impedance of the ADC itself is an important detail that I don't know the value of.
I'm kind of embarrassed to be asking this, because this is apparently considered to be an absurdly-simple circuit... but all the examples I've seen basically consist of a voltage comparator whose output directly triggers a piezo, as opposed to using a MCU to measure it through a proper ADC. I'm not sure whether that's because the amount of voltage at the far end would be too low to reliably measure with a 12-bit ADC, or just because prior to just a few years ago, the very idea of using a MCU and ADC for something like this would have been prohibitively expensive overkill (instead of, like, $9 for an ESP32-C3 that you need anyway for the wi-fi link).
Do I actually need to do something like have the ESP32's 3.3v GPIO trigger a MOSFET switching 5.0v, then amplify the other end with an op-amp and/or run it through an optocoupler or something? Or am I way overthinking something that isn't nearly as complicated as I'm making it?