Water Leak Detection and Usage Monitor
by VirShroff in Circuits > Gadgets
83 Views, 0 Favorites, 0 Comments
Water Leak Detection and Usage Monitor
In an effort to reduce water waste at my home, I’ve developed a magnetometer-based water measurement device. This project helps you monitor your household water usage, identify unusual patterns, and prevent costly leaks.
There are a few products available on the market that perform a similar function though they are significantly more expensive and do not allow for customization.
This device uses an STM32 development board with BLE capabilities and a sensor board that has a magnetometer alongwith additional sensors - though I am simply using the magnetometer on the board.
How It Works:
In almost all US homes there is a water meter provided by the local authorities that meters the water used in the home. Most watermeters work on the principle of a displacement most areas use a meter similar to those shown here:
https://www.xylem.com/en-us/products--services/metrology-equipment-for-utilities/meters/sr-ii-water-meters/
These meters have a wet and dry component - the wet component has the displacement piston and a magnet that couples the rotation to a mechanical meter that indicates the wtaer consumption.
Since all areas prohibit directly attaching anything to the meter, this project leverages the magnetic field generated by the piston to detect the rotation of the rotor and calculate the water usage.
Since the pole of the magnet will rotate in a circle if the magnetic field is measured at a high enough frequency (50 hz ) in this case - we will obtain a sinusoidal wave and counting the number of periods will indicate the number of rotations of the rotor which can then be converted to actual flow
Supplies
- NUCLEO-WBA52CG STM32 Nucleo-64 development board with STM32WBA52CG MCU, supports Arduino, ST Morpho connectivity
- https://www.st.com/en/evaluation-tools/nucleo-wba52cg.html#overview
- X-NUCLEO-IKS01A2 Motion MEMS and environmental sensor expansion board for STM32 Nucleo
- https://www.st.com/en/ecosystems/x-nucleo-iks01a2.html
- USB cable
- https://www.amazon.com/Amazon-Basics-Charging-Transfer-Gold-Plated/dp/B07232M876?source=ps-sl-shoppingads-lpcontext&ref_=fplfs&smid=ATVPDKIKX0DER&th=1
- 5V USB power bank to power the board
- Mobile phone to connect via BLE to the board and monitor the usage - using the STM32 Toolbox app
- https://play.google.com/store/apps/details?id=com.st.dit.stbletoolbox&hl=en_US&pli=1
Finding Your Meter
The first step to setup your water monitoring device is to find the meter location. Here are some common locations:
- Inside Your Home:
- Basement or Utility Room: In many homes, the water meter is located in the basement or a utility room. Look near the main water line entry point.
- Laundry Room: Some homes have the water meter near the laundry area, especially if the washing machine is close to the water line.
- Outside:
- Near the Curb: In some houses, especially older ones, the water meter might be located near the curb in a metal or plastic box buried underground. Look for a small metal or plastic lid labeled "Water" or "Water Meter."
- Driveway or Sidewalk: The meter might be embedded in the ground near your driveway or sidewalk. It could be covered by a metal or concrete lid.
- Around the House:
- Front or Back Yard: Check the yard area, especially around the perimeter of the house where the main water line enters your home.
- Garden or Lawn: Sometimes, the meter is hidden among garden plants or lawn decorations. Look for any covered boxes or lids.
- The Utility Bill:
- Billing Information: Your water bill often includes information about the location of your meter. It may have a diagram or specific details on where to find it.
The link below also provides a helpful guide - https://help.flumewater.com/en/articles/1618597-i-can-t-find-my-water-meter-where-is-it
Assemble the Boards
Since the boards are keyed, the sensor board will only fit one way on the mother board.
Download the Firmware Using the STM32 Cube Programmer
Using the free programming utility provided by ST microelectronics - https://www.st.com/en/development-tools/stm32cubeprog.html
Download the attached water.hex file to the board. The link above provides extensive tutorials on how to program the firmware
Downloads
Mounting the Board
it's essential to properly line up the board near the meter to get accurate readings.
The red circle identifies the magnetometer location on the board. You want to ensure that the magnetometer is right next to the meter base as that will be the closest to the metering piston and the magnet
Make sure that the USB on the development board is face up and that it is pointing at your water meter.
To mount the board itself, make sure it's connected to a power source and then use zip ties or a cardboard box to mount the board near the meter in the correct orientation.
For my testing I mounted the board on wood and positioned it next to the meter as shown
Read the Data on the Mobile App
That's it once you power up the board you can connect to it over BLE using the STM32 Toolbox app and once connected the data will be displayed on the app. Currently the data only shows raw rotation counts of the meter, so a conversion factor is needed but that can be easily arrived at by turning on the water - collecting it in a known volume container and reading off the pulses from the app.
This innovative solution not only helps you save water but also provides a fun and educational DIY project.