Meet the WaterMote (Moteino based water meter reader)

SY310-photo-reflective-sensor-breakout-perspectiveSome time ago I posted a youtube video describing how I read my water meter. This is a write-up about it and an introduction to WaterMote – a combination of Moteino and EE-SY310 photo reflective sensor breakout board. The PCBs for the SY310 sensor arrived and the product is available in the store.

The WaterMote is a simple setup, similar to my WattMote where I’m using a Moteino to sample power data from a Kill-A-Watt and transmit it wirelessly to my RaspberryPi-Moteino-EmonCMS combo for storage and graphing. In this case a Moteino is feeding power to the sensor and reading back the digital input on a Moteino interrupt pin. The sensor outputs a logical 0 or 1 depending whether the sensor is over a dark or light area.

The sketch I use has an interrupt setup on the input from the sensor, and captures every HIGH-LOW transition, which then gets processed into useful data like Gallons Per Minute, Gallons Last Minute, and Total Gallons. The total pulse counter is saved in EEPROM to avoid losing the counter when power fails. A timer triggers transmission to base every 5 seconds (every minute for the Gallon-Last-Minute reading). A python script runs on the RaspberryPi which listens to the incoming gateway Moteino data (serially) and submits it to EmonCMS for storage in MySQL.

The resolution is great, in my case the spindle on my meter is a triangle and spins 15 revolutions for every gallon. That means I can capture 45 pulses for every gallon I use. That in turn means 0.022 gallons for every pulse. Sweet!

The EE-SY310 sensor is fed from the VIN pin on Moteino, which is powered by a 5V USB wall wart, so the sensor gets 5V as input. The output is read as a digital pin interrupt.

The sketch for the remote node, the gateway node, and python code is available in my Github repository.

8 thoughts on “Meet the WaterMote (Moteino based water meter reader)

  1. I did a water meter like this a few years ago. The video may still be up on youtube.
    I used a pic attached to a meter that I bought on ebay and put in series with my
    city water meter. If the meter face is removed ( there is a metal plug on the side that
    can be drilled out to remove), then you can pick the spinning magnet that counts the water usage. I used a tiny magnet reed relay. I put a bunch of led’s on it so that counted the counts in binary. My wife loved how she could tell that there was a leak in the house when she saw the led’s flashing. I hooked it up to my computer using an XBEE. I really liked your info on stencils. Good work.

    • My city meter has a magnet but the field was too weak to pick up with an analog or digital hall effect sensor. The photo reflective sensor worked very well…

  2. Felix,
    Thanks for the great writeup. I’m planning on doing something similar.

    I noticed that there might be a small typo above.

    You say, “That means I can capture 45 pulses for every gallon I use. That in turn means 0.22 gallons for every pulse.”

    Wouldn’t that be .022 gallons for every pulse, not .02?

    Just wanted to give you the heads-up.

    Thanks again,


  3. Hi Felix,
    I have just purchased two Moteinos to build a modified Watermote project that I intend to use to read the dial on my gas meter. I have got the remote node successfully reading the meter and the receiver hooked up to my Pi and I can see the comms data using minicom on the Pi. However I’m still very green when it comes to getting the data into Emoncms.
    Where can I find the “python script that runs on the RaspberryPi which listens to the incoming gateway Moteino data (serially) and submits it to EmonCMS for storage in MySQL” you used for your Watermote project ?
    Thanks in advance, John

    • Here’s an example of a gateway script that I’m running to collect sensor data from Moteinos in the house:
      The data gets passed to EmonCMS using HTTP calls. So this assumes you got EmonCMS installed and running. For the SMS alert part of this demo you don’t need EmonCMS, it’s more for eye candy and being able to look at the water level in the past using nice graphs.

  4. Just tried to get this going on my water meter but wasn’t able to get a reading 🙁
    The problem is that the clear plastic cover of the meter reflects the infrared light so as soon as I get close to the meter it goes to high and stays there until I move it away from the cover. And here I was looking forward to logging my water consumption 🙁
    For reference this is my water meter:

    • Too bad 🙁 It looks like your water meter does not have a high resolution indicator either. Mine had a small triangle that was spinning 45 times for every gallon, that’s what I used to read it with the SY-310 sensor.
      Have you tried to put the sensor above the black stripe in the small dial with a red hand? Maybe when the hand covers the black stripe you can get a reading.

Comments are closed.