wayne piekarski IoT water meter monitoring

 
Share 2017

IoT water meter monitoring

I have been very interested in tracking the water usage at my house, and wanted to build a computer-based monitoring system to see what I am using my water on. It turns out that doing this is a lot more difficult than you would think. Read on to learn more about water meters, how they measure flow, what meters to avoid, and how to use a computer to analyze this.

Water flow monitoring

The standard water meter that comes from the water company is very accurate, but is out near the street in an underground pit. Running any kind of cable to the water meter would have required extensive work underneath the concrete sidewalk owned by the city, and even if I could do that, the water meter provided no easy way to be read electronically. The numeric register, which contains the dial and numbers that show total usage, is designed to be tamper proof, and do not contain any easy way to interface with. I have seen some articles about detecting magnetic fluctuations from internal magnets that drive the numeric register, but this was all going to require a lot of messing around, and I still needed to get cables to the water meter. Also, any electronics you have outside are exposed to the weather and seem to be quite unreliable, so the simpler and more directly wired in, the better.


Neptune T-10 water meter underground near the street, provided by the water company

I decided to keep things simple and add my own water meter near the house. The meter would provide two wires that briefly connect when some amount of water passes, and this is easy to accurately measure with any kind of digital circuit or computer with GPIO input. I needed to cut the inbound pipes to my house, add the new water meter, and solder the connections, but this is a relatively straightforward task for someone who has plumbing experience. I found some water meters online, and thought this would be an easy modification.

Cheap water meters

It turns out that purchasing the correct type of water meter is very important. If you browse around online, there are lots of relatively cheap (<$100) water meters, that claim to be "accurate". I purchased one of these meters and then installed it into my house. For high speed water flows, the device appeared to measure water about the same as the water company meter. However, if I slightly opened up one of my taps and let the water flow slowly, my water meter would not measure it, while the water company meter would still turn slowly. After reading the specifications for the water meter, it turns out that it will not measure any flow less than 50 liters per hour. If you multiply that out, it is 36000 liters per month, or 17% of an olympic swimming pool in a year! If you look at the inside of this inaccurate water meter, it has a simple paddle wheel inside it. The water has the ability to sneak around the paddles if it is slow enough, and so it is unable to measure slow water flows and leaks. All the cheap water meters you can buy online work this way. These water meters are usually referred to as a turbine flow meter or a multiple jet meter, and in my opinion, are basically useless.


Turbine flow meter - inaccurate with slow water flows

Commercial water meters

The water company meter was measuring these slow flows just fine, and it was many decades old, so I did some research into how these meters operate. It turns out that water companies buy much higher quality water meters, since they need to measure and charge for every drop accurately. Their meters are based on a concept called positive displacement, and could use something like a nutating disk internally. The water meter design is much more complex, and basically each drop of water is forced through a mechanical system. The mechanical system is all sealed up, so it is impossible for any water to sneak past without being measured. You would think that this type of measuring device would be slow and not allow fast flows of water, but they can easily and accurately handle any amount of water that a house can consume with all sprinklers, hoses, and showers running simultaneously through a 3/4 inch copper pipe. Here is a neat video that shows how these meters work.

The water company was using a Neptune T-10 meter, and even though it was decades old, it supported replacing the register with alternatives that supported pulse outputs. It turns out that some water companies are adding registers that implement wireless monitoring to save money on billing. My water company was not using newer registers, and I wasn't going to be able to modify the existing one since it was their property. Given the proven reliability of it, I thought it would be a good idea to try and buy one of these and install it near my house. However, the Neptune T-10 is not available online, and even local plumbing suppliers did not have any in stock. It turns out that you need to order them in quantities of thousands, and there is many months of lead time due to lack of demand. However, I made a few calls and worked with the people at Meter, Valve, and Control Inc and they suggested an alternate meter from Badger that is also used commercially and has similar accuracy. The best part is that it was kept in stock and available for shipment immediately.

As an interesting side note, commercial water meters are very well designed for both security and reliability. The register with the dial and electronics is completely separated from the mechanical system that detects water motion. Magnets are used to pass the motion through the sealed housing, so it is a physical firewall of sorts. The register can be made completely waterproof and submergible, and no water can leak out of the housing. You can tell some careful engineering went into this.

Badger Recordall Model M35 Disc Meter

This is a very sturdy water meter, it is huge and built like a tank. It includes a register that provides the accumulated usage in gallons on a dial, and also a wire that generates one pulse per gallon. It is basically a small switch, that contacts briefly as each gallon passes through. I asked about other units, like cubic meters or cubic feet, but those were not available except as a special order. While the cheap units barely have any specifications, these commercial meters come with nice data sheets that show the accuracy over different flow rates.


Badger Recordall Model M35 with Transmitter Register WMDP-M35-34S-NL-G-RTR-1

The part number is WMDP-M35-34S-NL-G-RTR-1, it costs about US$170, and the description from their system is: BADGER MODEL M35 COLD WATER DISC METER, GALLONS, NO LEAD BRONZE, RTR BARE WIRE REGISTER, 1 PULSE PER 1 GALLON.

There is a collection of very detailed documentation with more information:
Badger Recordall series data sheet: (RDM-DS-00464-EN-03) (mirror)
Badger Recordall M35 3/4" tech brief: (RD-T-3/4) (mirror)
Badger Recordall Transmitter Register (RTR) user manual: (REG-UM-01090-EN) (mirror)
Badger Recordall Transmitter Register (RTR) tech brief: (RTR-T-05-EN) (mirror)
Badger Recordall Transmitter Register (RTR) splicing: (120490_IOM mirror)

When purchasing a water meter, you also need to have the connections that attach it to your water pipes. This is important so that you can replace the water meter without having to cut any pipes later on. You turn off the tap, undo the nuts, and the meter slides out. Commercial water meters are all standard lengths to be interchangeable without having to redo the pipes, although the cheap turbine devices you can buy online are not necessarily standard sizes. The part number of this part was WMCON-3/4"-LL and the price was US$18.00.

Interestingly enough, one time the water company meter on the street had a leaky tap, and they came out to repair it. The problem is, how do you replace the tap without having to shut down the whole neighborhood's water? It turns out they actually do hot swap replacement! I saw this being done ... they turn off the tap in the meter pit, and remove the water meter. Now the fun begins - they open the tap, and while water is blasting out at mains pressure, they remove the old tap. The whole pit is instantly filled with dirty water and spraying out everywhere since the pressure on the street is incredibly high. The worker is desperately trying to hold everything together and attach the new tap, and it looks like they are trying to hold on to a wild animal. After a few minutes of fumbling around in the water, it was done, the tap turned off, and then the meter reattached. It was unbelievable that this is standard practice, but pretty interesting to see how problems like this are solved in the physical world.

Water meter horns

The final problem I encountered was installation. The pipes entering my house only have a small amount of space from where it comes out of the ground vertically, to where it enters the wall. The previous turbine meter was a lot shorter, and just barely fit in the whole area. The new water meter was almost twice the size and would not fit, and also the data sheet recommended a horizontal installation for best accuracy. I found a special adaptor called a meter horn that is designed to allow large water meters to be retrofit into spaces left by smaller water meters. This is commonly used when the water company wants to upgrade an existing installation, but doesn't want to have to replumb everything around it. The 3/4 inch meter horn is available from a company called Water Specialities Company and costs about $125, and is much nicer than anything I could have built myself.


Water meter horns - allows a standard horizontal water meter to fit into a small vertical space by redirecting the pipes

Installation

Here is the completed photo of the installation, showing the Badger water meter installed horizontally using the meter horn, and a tight fit with all the existing plumbing at the entrance of the house. Doing copper plumbing is quite similar to soldering electronics, except you use a blow torch and special solder to heat up a much larger area. Overall, using a commercial water meter did not cost much more than a cheap turbine device, while guaranteeing the same kind of accuracy that the water company gets. I can also use my equipment to verify the billing from the water company as well. The meter has two wires coming out of it that I joined up to a piece of CAT5e cable and then routed through the walls of the house to go indoors. It is important when you splice the cable outdoors that you do a nice clean join and seal it up, or it will start to rust and then fail. Just wrapping some tape around is not good enough, the water will eventually work its way in via capillary action. I soldered the wires together and then applied silicon rubber all around it for a nice seal.


Completed installation on inbound house water pipe with Badger water meter and meter horns

IoT Monitoring

With the water meter installed, now we need to monitor it. Detecting the pulse is basically the same as how you would detect a button press with a microcontroller or an Android Things board. Any GPIO input pin on your device will be suitable. My device uses 3.3V for the GPIO inputs, and I have a 3.3V power supply on board. You need to make sure you use a pull-up resistor so the GPIO input is set to a high value by default, and then when the switch closes the input is grounded. If you do not include a pull-up resistor, then the GPIO pin can float around and may give many invalid phantom inputs. It is also important that you read the data sheet of the water meter and make sure you limit the current. In my case, the specifications indicate that we should not exceed 30V DC @ 1 mA. Using 3.3V with a 10K ohm pull-up resistor ensures that we never provide more than 3.3/10000 = 0.33 mA of current (using V=IR), so we are well within the specifications. Here is a diagram showing the wiring:

3.3V    -------+                               
               |                               
               R1 (10K ohm)                    
               |                               
GPIO In <------+------------o---+ (red wire)   
                                |              
                                 \   RTR switch
                                |              
GND     --------------------o---+ (black wire) 

On the software side, you configure the GPIO pin as an input with edge triggering (example for Android Things), so that your handler is called whenever the signal changes in one direction (you can use rising or falling). Since a switch never opens and closes with a perfect square signal, you will probably need to do some debouncing, where you handle multiple counts of the signal changing in a short time period. You can simply use the Android Things Button class, look at the source for how Button implements this, or you can do it yourself by ignoring extra triggers within some time interval.

If you don't want to develop your own monitoring system, there are some nice ones you can get commercially. Many years ago I purchased a Hydrawise controller, which can control your garden sprinklers and also create graphs of your water usage. It is very reliable, but the only catch is that it only uploads water usage to the cloud at a delayed rate, and you can't see every gallon instantly. The Hydrawise software is nice because it allows you to use any 3rd party water meter like the Badger one instead of their standard low-accuracy model.

Conclusion

By tracking every gallon of water that goes through the house, I have been able to understand better where my water usage is going, and optimize this to conserve water. A toilet with a stuck fill valve can burn through many gallons per minute, and if this happens while you are away or sleeping, huge amounts of water and money can be wasted. I had a tree in my koi fish pond with its roots directly in the water that was causing the water level to drop significantly every day and causing the fill valve to run all the time. Even a slow leaking tap can waste huge amounts of water over a long time period. I've been working on some software that tries to analyze usage and look at patterns to detect problems, but it can be quite tricky to differentiate normal usage from a real problem. Here is a graph that shows a sample of what the water usage looks like over a typical 24 hour period:


Graph showing water usage in gallons per 15 minute intervals over one day


Share 2017


Google Developer Advocate 2014-2023


X-Plane plugins and apps for flight simulation


IoT water meter monitoring


IoT computer vision monitoring


Tiny and cheap offline Wikipedia project 2017


Outdoor augmented reality research
Tinmith 1998-2007


Outdoor augmented reality 3D modelling
Tinmith 1998-2007


Outdoor augmented reality gaming
ARQuake 1999-2007


Scanned physical objects outdoors
Hand of God 3D 2006


Google Developer Advocate 2014-2023


X-Plane plugins and apps for flight simulation


IoT water meter monitoring


IoT computer vision monitoring


Tiny and cheap offline Wikipedia project 2017


Outdoor augmented reality research
Tinmith 1998-2007


Outdoor augmented reality 3D modelling
Tinmith 1998-2007


Outdoor augmented reality gaming
ARQuake 1999-2007


Scanned physical objects outdoors
Hand of God 3D 2006


Contact Wayne Piekarski via email wayne AT tinmith.net for more information

Last Updated 2024