Water leak detector


9 years ago I had a water leak and as a result of what I did I had an idea for a water leak detector but back then it would have been too expensive to build a real-world product. Cloud computing, IoT and other technologies made it a real possibility a few years later and I looked deeper into it and discovered two things:

  1. there are already patents in the space but nothing preventing my method
  2. it turned out other people were working on similar ideas

It’s really simple; you need to take two temperature readings where your water main enters your dwelling;

  1. the temperature of the mains pipe and
  2. the ambient temperature of the air near where you are taking the pipe temperature reading.

Then, you need to compute the absolute difference and monitor it over time. When you cause water to flow through the pipe, the temperature of the pipe will change (I expect there may be a few rare circumstances when this won’t happen). This will create a peak and once you switch the water off, the air will heat or cool the pipe until the pipe & air are the same or reach a point when the difference is constant. Copper pipes are best.

OK, so now we have a series of data that shows peaks and curves. There are various algorithms you can implement and most will give false alarms (washing the car, watering plants etc) but if you have a house full of leaky plumbing like I did it’s really useful.

I’m not good at processing time series data but I did something a while back, again really simple. Each time I posted a row to emoncms I copied it to Azure (where I can write code and store data, do it where you want!). After posting the data I had a look at recent rows and if there was a peak, has the difference become constant within n minutes? If n minutes had passed and the difference is not constant, I sent myself an email. I got a bit tired of those emails after a while and switched the monitoring off but it works!

Now, after we have fixed all our leaky toilets and dripping taps, I just display the absolute difference feed on my dashboard and keep an eye on it.

I have done this using 2x DS1820B via emonPi and an alternative install using emonTh & 1x DS1820B; I hope this may be of use to some of you.

So, if I understand it correctly, the working principle is you’re inferring a flow of water by measuring the rate at which it transfers heat to or from the immediate surroundings of the water pipe.

It’s certainly going to be easier to add a temperature sensor to a pipe than it is to break in and install a flow meter.

Yes that’s right. By making it non-invasive you don’t need a plumber to fit it and the leak detector will never leak itself.

Also I understand that flow meters can restrict the flow and potentially not record very small flows which the temperature sensor method does.

I stumbled on the idea because with my original leak I noticed condensation on the inlet pipe near the stopcock. A while after I fixed the leak I noticed that the condensation had gone; this bugged me until the penny dropped. With even very small flow the water in the pipe is never still and in my case the “new” water in the pipe was cooler than the air near the stopcock leading to condensation; when the leak was fixed, the water became stationary and warmed to the same as ambient. I thought “there should be a gadget for that” but back in 2009 I couldn’t find one. Looked into it a few years later, when I realised IoT would enable cloud based hosting & logic making the in-home device pretty simple.

1 Like