This project was born out of sheer frustration. While I was 350 km away from home, the water connector on my American-style fridge failed. Fortunately, my leak detection system—previously published in
Elektor (
ESP32 Water Leak Detector)—did its job: I received both an email and a push notification alerting me to the leak. By checking the hourly consumption dashboard, I noticed water was flowing at a rate of about 15 liters per hour. I assumed it was a toilet flush or a tap left slightly open and didn’t worry too much.
Two days later, I returned home to a disaster: 5 cm of water in the dressing room. The connector had completely ruptured, releasing thousands of liters. I had to dismantle furniture just to access the faulty joint.
That’s when I realized that detection alone wasn’t enough—automatic water shutoff was essential. I began researching motorized valves and stumbled upon a device on the French classifieds site Le Bon Coin: the Gröhe Guard and Sense system, which includes an electric valve (EV) that shuts off water in case of a leak or abnormal consumption.
The seller claimed the unit was brand new and unused, selling it only due to lack of installation space. I believed him. Unfortunately, I quickly discovered the valve was defective—it never shut off the water. With the seller refusing any refund, I decided to modify the device and integrate it with my existing leak detection system.
Reverse Engineering the Gröhe Guard
The Gröhe unit is built around an Espressif ESP8266 module. It connects via WiFi and supports OTA updates. Its onboard sensors measure water pressure in bars and consumption in liters, with historical data (hour/day/week/month/year). A clever algorithm detects micro-leaks by briefly closing the valve multiple times a day. The valve itself is membrane-based, pressure-assisted, and held shut by an electromagnet—this was the part that had failed.
I sourced a higher-quality electric valve and set out to control it via the Gröhe unit, a small web server, and most importantly, my leak detection system.
Using an oscilloscope, I analyzed how Gröhe drives its valve: 12V for 2 seconds to compress the spring (PWM = 100%), followed by a 50% PWM signal to keep the valve closed (without power, it defaults to open). However, the Gröhe’s output wasn’t powerful enough for my new valve, which required 24 VA. I also wanted to control the PWM duty cycle (between 10% and 40%) to avoid overheating the coil unnecessarily.
My Solution
I disconnected the Gröhe’s electromagnet and added a 3.5mm jack to extract the signal. To avoid interfering with the Gröhe system, I used a dual high-speed optocoupler to isolate the signal, feeding it into a microcontroller I built around an Arduino Nano with a 16 MHz ATmega328.
The optocoupler was essential to capture the 15 kHz PWM signal without distortion. Its second input accepts a simple on/off signal, allowing me to replicate the Gröhe’s PWM pattern via a dry contact.
Writing the software to analyze the PWM signal was challenging: 2 seconds at 100%, then 50% until cutoff, all at 15 kHz. I used timers and interrupts on the ATmega328 to generate a synchronized PWM output with a duty cycle adjustable via DIP switches.
The system also responds to a dry contact input with priority management. I added a manual switch to this input to allow local water shutoff. While the code could have been written entirely in assembly, I managed it in C using the Arduino IDE.
One processor output drives a VMOS transistor—no heatsink needed, as it’s fully saturated by the 5V PWM signal. Two DIP switches let me select the duty cycle (10%, 20%, 30%, or 40%). A TTL serial output at 9600 baud continuously reports input states, PWM percentage, and DIP switch positions.
Web Control and Cloud Integration
To enable remote control, I added a second processor: a basic ESP32 module that connects to the Arduino Cloud, which I use in many projects. It controls a small REED relay that activates the optocoupler’s second input, thereby shutting off the water.
A simple iPhone interface shows the state of both inputs, the PWM output, water cutoff duration (which helped me understand Gröhe’s behavior), and lets me toggle water flow remotely.
Since I’m using Arduino Cloud, I can retrieve two boolean variables updated from my leak detection system. That system is near the water meter but far from the valve—over 50 meters away. When either boolean becomes active, the REED relay triggers and shuts off the water.
Regardless of how the water is cut—via Gröhe, the local button, the web interface, or my leak detection system—I receive both an email and a push notification detailing the event and duration.
Full Coverage
The Gröhe Guard communicates with two Sense sensors on the same WiFi network. I installed one in the dressing room cabinet to monitor for future leaks, one in the boiler room where all water lines originate, and one in the laundry near the washing machine. These battery-powered sensors use gold-plated probes to detect moisture and signal the Guard to shut off water.
My home is now under full surveillance for leaks or pipe ruptures. By combining Gröhe’s capabilities with my custom monitoring system, everything is under control.
In case of power outage, an UPS keeps the system running. If it fails, the normally open (NO) valve allows water to flow again.
Thanks to my iPhone app, I always know the system’s status and can shut off water remotely whenever I leave home.
Discussion (0 commentaire(s))