Some 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.