June 5, 2015 AT 10:00 am

Measuring home water consumption with Raspberry Pi #piday #raspberrypi @Raspberry_Pi


Cuddleburrito posted a great project to help monitor water consumption in drought stricken California. Found via hackaday.

Living in California during the mega drought is like watching the car in front of you throw their trash out the window everyday, forever. It’s infuriating to watch other people’s destructive behavior, but there’s very little you can do about it. Throughout the Bay Area there are reminders to, “conserve water” on highway signs, business windows, and on the radio. This has led us to be hyper-vigilant of each others’ behavior because we’re constantly reminded how to act. However, without knowing how much water we’re consuming ( in a more useful format than the monthly water bill ), it’ll be very difficult to change our own behaviors or convince others they need to change. In other words we need more data. As Californians, we need to be mega nerds to get us through this mega drought.

I’ve always assumed it would be expensive to itemize water consumption in a house. Each water source would need a water flow rate sensor to get a measurement, which would add complexity and require plumping in most cases. However, a few days ago I suddenly had the realization that most of the time, I turn the water on full blast. All my sinks and showers have a single pull-style knob for on/off. The design makes it difficult to turn the water on minimally, so everyone opens it all the way. Therefore, I’ve made the assumption that all my sinks and faucets have a constant flow rate. All that’s needed is to measure the flow rate once, figure out how long the faucet is open for, and multiply the two numbers together.

System Overview

For this project the electronics and software were more interesting to me than the mechanical components. The least amount of work possible was done on the mechanical parts to get it all minimally working. The switches I used were arcade buttons because they’re inexpensive and I already had them.

Everything is based on a cloud database that the sensor data gets saved to. I use Parse.com because I’m familiar with their API. They have documentation and example code for most platforms I’d use in the future too. It’s really convenient to be able to swap out devices and components without the hassle of porting the data. Moreover, it’s now trivial to visualize the data anywhere and on any device (e.g. the scatter plot below is made with d3.js ).

A Raspberry Pi runs Python scripts to mashup the technologies involved and get the system to work. The scripts sense button presses, listen for wireless data from the microcontrollers over XBee radios, calculate the water expended, and push the information to the Parse database. Instead of a Raspberry Pi for every room, a Propeller microcontroller is setup in the bathroom and wirelessly sends the data to the Raspberry Pi in the kitchen. This saves a bit of money and adds modularity. The layout I ended up with was largely governed by the poor performance of the XBee radios I’m experiencing. At this point my guess is that there’s too much wifi interference, but this short distance works for now. The plan was to only have a R.Pi in the kitchen until I find a better solution. In the meantime, I’ve unplugged the kitchen sink sensor until this project receives more investment money and I purchase a second Raspberry Pi.

Read more.


998Each Friday is PiDay here at Adafruit! Be sure to check out our posts, tutorials and new Raspberry Pi related products. Adafruit has the largest and best selection of Raspberry Pi accessories and all the code & tutorials to get you up and running in no time!

Check out all the Circuit Playground Episodes! Our new kid’s show and subscribe!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground”Adafruit’s Apps!

Maker Business — Undercover in an iPhone Factory (video)

Wearables — Go with silicone

Electronics — Shift away from basic arithmetic

Biohacking — Recording and Biohacking a 100 Mile Run

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !

1 Comment

  1. Nifty.
    I was just wondering how you actually meaudre the time a fawcett is open. I might have missed that in your explanation.
    Do you have any data on how accurate this method is? I presume that in the end it must be not too far off from your utility bill.
    Though I measure my water too, just at onepoint, with a Hall sensor, I found that just common sense helps most in saving water. I managed to use one fourth of what i used a couple of years ago

Sorry, the comment form is closed at this time.