Help reverse engineering water detection circuit - Page 1
Forum section: electronics / beginners

author: Philistino
author_rank: Newbie
timestamp: May 30, 2025, 05:04:41 pm
content: I am reverse engineering a PCB in an espresso machine and I am having trouble understanding the water detection circuit used for the steam boiler. The correct water level in the boiler is set such that the water just covers the tip of the probe.The trace on C6 goes to a header pin that is connected to a stainless steel probe in the boiler. The probe is insulated from the boiler and the outside of the boiler is tied to the chassis, which is also connected to the AC earth. Presumably, this is to detect continuity through the probe with current passing through the water in the boiler to the chassis. There is no AC current on the PCB, but AC current would help prevent corrosion.There are also two traces going to GPIO pins on the microcontroller through the passive components pictured. You can see the traces connecting the passives on the PCB, which is why I am not including a schematic. From what I can tell, it looks like R7 is a current limiting resistor and R8 and R9 form a voltage divider and C7 is probably for signal smoothing, but I don't know enough to understand how the whole thing works together.Any help understanding the circuit and how the microcontroller uses the two GPIO pins to sense the presence of water at the probe would be greatly appreciated!Also, I know direct current passing from the probe to the boiler can cause corrosion. How might this circuit mitigate excessive corrosion on the probe?Thanks for the help!

author: jwet
author_rank: Frequent Contributor
timestamp: May 30, 2025, 05:43:54 pm
content: If you draw the schematic out logically, its much easier to see what's happening. I took a stab. Consumer goods like appliances are designed for ultimate low cost by very clever designers.The circuit is a classic wheatstone bridge (google it). DC is kept out of the problem by the capacitive coupling at the top. GPI 1 is likely driving this pin at a khz or two with a timer or PWM type output. GPI2 is likely an ADC that looks the signal across the bridge. Those component with the line might be diodes used to rectify the output and speed up the falling edge of the input. You can measure them and see if they behave like a diode. The first cap makes sure that no DC can get into the sensor- it has to average to zero.PS- be careful poking around, a lot of this stuff isn't isolated from the line- they use capacitive droppers for little power supplies that can expose you to shock if not well understood. Most people would run this on an Isolation transformer for servicing. DO NOT hook you AC power scope up without careful thoughtHave funI couldn't attach the file. New phone problem but if you draw it, you'll see a bridge emerge. Note that GPIO1 is an out probably a timer or pwm and GPIO2 is an ADC input, the beauty of uControllers.

author: floobydust
author_rank: Super Contributor
timestamp: May 30, 2025, 06:41:24 pm
content: Welcome to the forumsI don't see a Wheatstone bridge there at all.How it works is the MCU outputs a square-wave from GPIO1. I'll guess a few kHz, or a just several pulses.With no water at the probe, this square-wave is rectified and filtered by D3/C7 to GPIO2 and will make a logic "1" appear there.With water at the probe, that capacitance loads down the signal (drop across R7) to make a logic "0" there.There is no galvanic corrosion at the electrode because blocking capacitor C6 prevents this.

author: Philistino
author_rank: Newbie
timestamp: May 30, 2025, 09:26:52 pm
content: That makes a lot of sense, thank you! What do you think D4 is doing in the circuit? Really appreciate it!

author: floobydust
author_rank: Super Contributor
timestamp: May 31, 2025, 08:37:16 pm
content: The circuit uses the GPIO_1 +ve pulse to charge C6 and the electrode's (wet) capacitance, and then fast discharge them at the -ve (GND) pulse via D4. So the circuit is looking at 1/2 wave of the square-wave.I think it's not a great circuit, R7 is huge so the tank electrode must be tiny. Usually R7 is 10-20x smaller in value like 20k-50k, not 390k. Most circuits use full-wave.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: June 09, 2025, 01:27:09 am
content: I did not look very long nor hard at it, but it does not seem very difficult.1. GPIO is an PWM output.2. This gets rectified by D3 and smoothed out by R8, R9 and C7.3. The probe is connected through C6, so it only sees AC.4. When the probe is wet, it alsmost shorts the PWM signal to GND.5. As a result the voltage on GPIO2 drops.GPIO may be a digital or an ADC pin.Floobydust posted nearly the same answer. I guess we're probably both right.