Gas Consumption Monitor

I got some time over the holiday period to carry out my threat to start monitoring our gas consumpition. The setup is an Arduino Duemilanove with ethernet shield. I used the standard software for the shield that comes with the IDE, trying it in both client and server modes. In the end I decided it should log the current “reading” every 5 pulses. The pulses come from a contact closure on the meter fed into one of the Arduino’s inputs. This needs some debouncing.

The nice thing about making it a client rather than a server was that I did not have to mess around with firewall settings. As a rule I don’t like any incoming access and this wasn’t necessary. Should our broadband connection fail for a while you don’t lose any data beacuse the current “reading” is always stored while the unit has power. (Must remember to add battery-level monitoring next time I change the software.)

No so fast: The power consumption of this setup is too high for practical running off batteries. If this was to be used in a volume situation we’d need to be able to turn off the Ethernet circuitry when not in use.

UGI Gas Meter
Arduino with Ethernet Shield

I did find some problems with the IDE on Windows. The serial port is not always available for downloading. Moving to a less-cluttered machine solved this. Also, when the Arduino is commected via USB and Ethernet it sometimes resets itself. I think this is due to noise or a ground-loop as the problem goes away when running off battery with the USB disconnected. Connecting to the meter does not seem to create a problem as its contacts are also isolated.

How best to present the resulting information? For now I calculate a moving average of the pulse rate, graph the resulting information with SVG and present it on a web page. For security reasons I am not posting the link to that but will add sample here in due course.

Next challenge: Electrical power. I know this is easy with “Current Cost” but I may look at alternatives too.

Post-script: Had some issues with Arduino’s Ethernet shield – now solved and documented on that forum. Looked at optically sensing the rotating wheel on my electricity meter but the marking is too subtle. I’m now getting a more up-to-date meter as my first choice solution. If not feasible, then Current Cost must be the best option despite its more approximate nature.

Arduino/ Ethernet and alternatives

Had a look at a few options including PICAXE. Not a great deal to choose between them. Liking the philosophy behind Arduino I decided to bet on that as I only want to learn one platform. Initially found that the A. Ethernet Shield was not available in the UK. Ordered it directly from Italy.

In my travels, spoke to a very helpful guy at – a site worth a visit, inter alia for robots playing soccer. It’s nice when people publish their phone numbers so you can speak to them instead of sending emails into the void.

Next step: get all the software and mount the learning curve.

Monitoring with Homecamp

I’ve been able to move along a great deal in my thinking thanks to the Homecamp unconference on Saturday. The guys have done some inspirational stuff with monitoring so it’s clear what I need to do next. Thanks to Chris Dalby and helpers for putting this together.

My electricity cost meter has not arrived yet but when it does I’ll have that source of input. I also discovered a secret socket in my gas meter where I can derive a pulse output (that will need some debouncing). The most convenient way to make all this data into useful information is to build up a database of the readings from which I can get reports as needed. I’ll do that with a low power microcontroller that will act as a server on my home network. I’ll extract the readings into an existing central server. From those I can use a variety of tools for reporting.

The quickest way to get a low power microcontroller seems to be an Arduino setup. Time was that I would have built something like this from scratch. Thankfully, it seems that they’ve done most of the hard work and neither the price tag nor the power consumption will be a problem. Reputedly the whole thing will run off batteries.

While at Homecamp I also heard about Rob Veck’s great initiative at Colden Common to use a community approach to influencing behaviour. This is the kind of thing I had in mind so I will follow their progress closely. Maybe we can clone this in other communities?