steam sensor/How it works/04. A divider made of water
How it works · 04 of 9

A divider made of water

Water across the loops is a resistor from VCC to SENSE, and the board's 1 MΩ is a resistor from SENSE to GND. Together they are a voltage divider: SIGNAL is VCC × 1 MΩ / (1 MΩ + the water). Dry, 0 V; water of 1 MΩ, half of VCC; a puddle, VCC itself. So VCC must be your board's logic voltage.

Two resistors, one of them water

The whole board is one circuit. VCC goes to the VCC loops. Water, when there is any, joins them to the SENSE loops. From SENSE, the 1 MΩ goes to GND, and the 150 Ω goes on to SIGNAL.

That is a voltage divider with the water as its top half:

SIGNAL = VCC × 1 MΩ / (1 MΩ + water)
A divider made of water
Your board
Water across the loops1.0 MΩ
SIGNAL
2.50 V
Reads, of 1023
512
From VCC
2.50 µA
The water and the 1 MΩ are of a size, so they share VCC between them: 1.0 MΩ gives 2.50 V, 50 % of VCC. This is the range where the reading moves most for a change in the water, and where a fogged board sits.

Slide the water from a trace of nearly pure condensate on the right to a salty puddle on the left. Around 1 MΩ, where a fogged board sits, the reading moves most for a change in the water. Far to the right it barely leaves 0; far to the left it is stuck near VCC.

The 150 Ω is in the path too, but next to a megohm it changes the reading by less than a count, and at rest no current flows through it at all. Only the water and the 1 MΩ decide SIGNAL.

VCC is your logic voltage

With the water near 0 Ω, SIGNAL is VCC. So VCC must be the voltage your board's analog pin takes: 3V3 on an ESP32, an ESP32-S3 or a Pico, 5V on an Uno. The page this replaced offered either supply as though it suited any board; 5V on an ESP32 can put 5 V on a 3.3 V pin.

On an Uno and a Pico there is a bonus. Their ADCs measure against the same supply VCC comes from, so the count is the divider's share of full scale: 1023 × 1 MΩ / (1 MΩ + water), whatever the USB supply is doing. An ESP32 measures against a reference of its own, so the count moves a little with the 3.3 V rail.

When it does not work

It reads full scale for any amount of water.

The water is far below 1 MΩ, a splash or a puddle of tap water, and the divider has run out of room: SIGNAL is nearly VCC whatever you add. Dry the board and start again with less water, or with condensate.

Can I power it from 5V and read it on an ESP32?

No. A soaked board puts VCC itself on SIGNAL, and 5 V on a 3.3 V pin is over its limit. Wire VCC to 3V3 on an ESP32, an ESP32-S3 or a Pico. The 1 MΩ keeps the current tiny, but the voltage is what harms the pin.

Why does it draw no current when dry?

Because VCC only reaches the loops, and dry loops touch nothing. Every current path runs through water and then the 1 MΩ, so even soaked the block draws at most 3.3 µA from 3.3 V, 5 µA from 5 V.

Where this goes next

A megohm source, and the 12 µs an ADC gives it.

Why the capacitor →

Edit this page — content/books/steam-sensor/a-divider-made-of-water.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

Steam Sensor

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum →