Water Usage Meter
I needed a way to measure water used outside the house. There are some commercial products, like Gardena Smart Water Flow Meter, but they are not cheap and can’t draw nice looking graphs.
This seemed like a good weekend project and I can finally use XRF wireless modules, that I bought a few weeks ago. XRF wireless modules are Xbee-like radios with a lot of features:
- they work out of the box,
- have Xbee-like pinout,
- support 128-bit AES encryption

ATEA password
ATEE 1
ATID 0000
ATAC
ATDN
which enables AES encryption, sets password to ‘password’ and specify network ID as 0000. New lines are represented as \r char, and commands return OK if it’s successful.
I decided to use the following configuration:
Flow meter on regular intervals send data about water usage to Netduino Plus gateway. Netduino Plus listens to XRF network and sends every received message to webapp hosted by Google App Engine. I plan to update gateway to support two-way communication, however, firstly I need to make web GUI to display flow meter’s data nicely, since numbers without graphs are somewhat boring.
Flow meter
water flow [dcl] = pulses / 3.2 per measured period
Example: If it sends 3.2 pulses in one seconds, it means that water flow is 1 dcl per second.
I decided to sample water flow for ten seconds period, and send sum of those values to web app every five minutes.
Netduino gateway
Netduino Plus listens to XRF wireless data and sends every received command to web app with HTTP GET request.
Commands consist of following data: start character, two digit receiver id, two digit sender id, data and end character.
Example command:
!0102hello world$
which sends hello world string from device #02 to device with id #01. Web app saves these information including current timestamp to the database.
Google App Engine
It’s first time I actually tried GAE and I kinda like it in the sense of building application. It multiple languages but I decided to use Python. Documentation and examples are really good and Python web community is quite big so it’s not hard to find different libraries. Databases are really cool, because you don’t need to specify columns in advanced, so it’s like MongoDB, which I really like. Sadly, web frameworks like Django mostly expect relational database.
Anyway, the only thing I don’t like about GAE for now are their free quotas. Yesterday, when I was testing I sometimes sent up to 10 updates per minute and I used 10% of database quota in about 1 hour. I’m a bit afraid that I might hit those limits quickly if I add additional processing to web app and additional modules to my system.
Amblight part 2: Controlling LEDs Need to start reading datasheets