Measuring gas consumption

Those who are regulars of the blog, already know that I like to measure everything, and the gas could not be less.

One thing that not many people know is that it is usually very easy to measure because the meters have a "magnetic output" that can be easily read.

The difficulty lies, more than anything else, in how to send the data from the counter, which is often inaccessible and has no nearby power outlets.

For a while I was reading the gas consumption using a Jeenode (a kind of Arduino with a radio frequency module for low consumption applications). The system worked great for a few months until, well, until it was stolen from the meter box! One fine day the readings just stopped coming, I went to see what was going on, and my dear little gadget had disappeared.

I have not read the gas for almost a year now, and with the changes that I have made this year in the boiler and in the heating control system, it would be good for me to have real-time data again to be able to optimize its operation and know if the changes that I am implementing translate into gas savings.

Measuring gas consumption is not difficult, in most cases. Fortunately, gas meters usually have a magnet that moves with the numbers that go around, so that we can detect each turn of the number and calculate the consumption that way.

At first I wanted to make the measurement system using an ESP8266 and MQTT (and I prepared it) the problem is that in the vicinity of the gas meter I do not have a nearby electrical outlet and the ESP8266 is a little too hungry to be powered by battery. On the other hand, Jeenodes are a bit pricey, for what is out there today. Since I already have a receiver for the Jeenodes installed and integrated through Nodered (my EmonTX power consumption reading system is based on and is compatible with Jeenode), and all the components to make a homemade Jeenode for little money, I have decided doing so.

With an Arduino Pro Mini, of which you can get in AliExpress for less than € 2, duly modified to improve its consumption (removing the power LED, which consumes a lot for this application and eliminating the voltage regulator, since I am going to use with batteries and I hope they last several months), and an RFM12B radio module that I already had, I have built a homemade Jeenode in a couple of hours.

Maybe you are also interested in:  Color touch screen for CO medidor meter Wow!

The biggest problem is the sketch that has to be loaded onto the Arduino, and that is, after a couple of years since I wrote the old one, I don't know where it is, I can't find it, neither alive nor dead, so I had to write new one. The sketch, in itself, is very simple, the difficulty comes because it has to be optimized so that it consumes as little as possible, which is an additional headache.

As in the previous version, I have used the wonderful Arduino Jeelib library. This library is a marvel to implement low-power modules with radio communication. It's a bit old now, but it's just what I need and I'm familiar with.

Edit: The truth is that optimizing its consumption has taken me much longer than I thought. In the end, I spent a week testing, measuring and changing the code until I got what I wanted. 

This is the device, once finished:

Arduino Gas Meter

Edit 2: I include this graph a year later (February 2018), where you can see that the invention works spectacularly well. After one year of uninterrupted use, the battery (two 1.5 Volt AA batteries) is still above 3 Volts, so many more months of operation are expected before having to change the batteries

Edit 3: I include this graph three years later (February 2021).

The system Still working after more than four years running uninterrupted with the same batteries (which weren't even new when I first put them in for testing)!

Maybe you are also interested in:  PeluCO₂: A CO₂ meter on your wrist (wearable)

The battery voltage is still above the 2.92V, so that battery remains for a while. How far will it go?

Leave a Comment