Muino Water Usage Home Assistant

The Muino water approach for water usage sensors aims to simplify installation by reducing complexity. Unlike traditional inductive sensors, the new design is smaller and easier to place, with a more intuitive interface. It also offers higher resolution, allowing for more accurate measurement of water usage, including smaller amounts. connector

Water meters are used to measure the amount of water that is used in a household. They typically have a spinning wheel with a red half-moon. With the following approach there are three sensors placed around the wheel. When the wheel spins, one of the sensors always passes over the red half-moon. By shining different colored lights green on the wheel, the sensors can detect how much red is present and use this to measure if the spinning read wheel spinned, one full rotation means 1 liter. This setup the resolution is even higher than 1 liter and will be between 0.1-0.3 liter precise.

There are different ways to communicate with Home assistant, using WiFi, Bluetooth, or USB (Serial). For WiFi the idea is to use ESPHome or a custom software implementation with MQTT. The custom version will be focussed on low power usaged, so it can run on a few batteries for a long period. Writing software is still in process so stay tuned!

connector The green pcb will be black

Project planning steps

  • Validate principle with light sensor, with test code
  • Create PCB
  • Order PCB
  • Waiting for the PCB to arrive
  • Solder components
  • Validate the PCB and working
  • Improve algorithm and make it robust
  • Write both ESPHome/Matter code that push it to home-assitant
  • Product first batch of water-meter-readers
  • Ship first batch of sensors
  • Determine the next version, what kind of chipset
  • Create low-power solution with the ULP of the ESP32-S3 chip, in Rust
  • Determine the battery setup

Update 25-04-2023

I have received the PCBs and components, and within minutes, the first prototype was a reality. As you can see from the figure, the cover/shield came loose and took an important resistor with it away. The current program I wrote, before the cover came loose, allowed me to see voltage differences of one light sensor. The current program is capable of reading one ADC and activating the LED. Moreover, the ESP can distinguish the red part of the disk from the white background. After some fine-tuning, I finalized the resistor values. I added an extra design rule to make it as cheap as possible, so more people can afford it.

connector

Although the PCB is green, I’d prefer it to be black. I wonder if this will work better or not. Since it gets pretty dark under the PCB. The new ESP32C3 is already in transit, so I’ll have to wait to fully test the code. Meanwhile, I’m working on some design ideas with two requirements: cheap and has an ESP32, for the ULP core and a newer design.

connector

How do the signals appear? Since I’m measuring very briefly (periodically measure), the left side represents when the sensor is on the white background, while the right side represents when the sensor detects the red circle.

Update 31-05-2023

Working on the last few filters and methods to make sure the measurment is more robust agains different situation that can stop the measurment.

connector

The 3 light sensors outputs are plotted in the above figure. The water tap is continuesly open and the second crane is also inbetween open and closed. It is also clear that the orientation of each sensor and LED has an impact in the bias of the zero-crossing of the sinus like waves. One of the issues it had is the following: between point 630K and 653K the wave was disrupted for a moment, because it was sending an update to MQTT, however something went wrong and it lost it needed to resend the msg and for a moment there was no measurment done. During this time frame around 4 liter was missed. This is solved in the newest version esp32-S3 using ULP processor.

connector

Update 03-06-2023

The algorithm has reached a robust state with an automatic calibration feature, eliminating the need for manual calibration. When devices are restarted or newly deployed, the algorithm can now automatically determine the appropriate maximum and minimum values required for autocorrelation. Although this may appear straightforward, it’s important to note that the algorithm handles non-periodic signals that are not continuously active. This means that the precise moment when the first liter of water is measured remains uncertain, whether it occurs after a few seconds or several hours from the start. Additionally, the minimum and maximum values of the sensor cannot be predetermined.

The provided figure illustrates three different signals, each with its own offset and distinct maximum and minimum values. The horizontal line at zero represents the volume of liters. In the absence of any detected liters, the autocorrelation becomes susceptible to noise interference in the signal. To ensure stability, certain algorithm adjustments have been implemented.

  • At approximately timestep 3000 on the x-axis, the water flow initiated, resulting in a sinusoidal wave movement. Each complete period of the sinusoidal wave corresponds to the consumption of 1 liter of water.
  • Following timestep 5000, there is an increase in the frequency of the sinusoidal wave movement, leading from a higher volume of water consumed.
  • Around timestep 5500, the water usage comes to a halt, causing the sinusoidal movement to end and the signal to remain constant.
  • Upon opening the water valve, a sinusoidal pattern emerges, and the measurements continue to accurately track its progression.
connector

Water sensor V2 - FOR SALE

I’ve created a new and improved version of my water sensor. It has a sleeker design, and it can be powered by a battery, for real-time water level monitoring via Home assistant. Version two is not finished and possibly some components will be moved around to make it fit better. Feel free to reach out to me for more information. See tindieVisit Tindie webshop

connector