Old Gas Meter Gets Smart With The ESP8266

Measuring the usage of domestic utilities such as water, gas or electricity usually boils down to measuring a repetitive pulse signal with respect to time. To make things easy, most modern utility meters have a pulsed LED output, which can be used to monitor the consumption by using an external optical sensor. But what do you do if your meter isn’t so cooperative?

That’s exactly what [Francesco] had to figure out while developing the non-invasive gas tracking system he calls ESPmeter. His meter might not have an LED, but it did have a magnet attached to the counter disk which activated an internal hall sensor. With some hacking, he was able to attach an external Hall-effect sensor to pick up this magnet and use the signal to monitor his daily gas consumption.


A big stumbling block in such projects is the issue of powering the device for an extended period, and remembering when it’s time to change the batteries. With the clever use of commonly available parts, he was able to reduce power consumption allowing three AA batteries to last about a year between changes. For one thing, he uses an ATtiny13 to actually read the sensor values. The chip doesn’t run continuously, its watchdog is set at 1 Hz, ensuring that the device is woken up often enough so that it has time to power up the sensor and detect the presence of the magnet. Battery voltage is also measured via a voltage divider connected to the chip’s ADC pin.

At regular intervals throughout the day, the ESP8266 polls the ATtiny13 to pull the stored sensor pulses and voltage measurement. Then at midnight, the ESP transmits all the collected data to a remote server. Overall, this whole scheme allows [Francesco] to reliably gather his gas consumption data while not having to worry about batteries until he gets the low voltage notification. Since the data visualization requirements are pretty basic, he is keeping things simple by using Plotly to display his time series data.

If you are unfortunate enough to have an even older meter which doesn’t use optical or magnetic rotation sensing, you can use a disassembled mouse to keep track of the Gas Meter.

Disassembled Mouse Keeps Track Of Gas Meter

After building devices that can read his home’s electricity usage, [Dave] set out to build something that could measure the other energy source to his house: his gas line. Rather than tapping into the line and measuring the gas directly, his (much safer) method was to simply monitor the gas meter itself.

The major hurdle that [Dave] had to jump was dealing with an ancient meter with absolutely no modern electronics like some other meters have that make this job a little easier. The meter has “1985” stamped on it which might be the manufacturing date, but for this meter even assuming that it’s that new might be too generous. In any event, the only option was to build something that could physically watch the spinning dial. To accomplish this, [Dave] used the sensor from an optical mouse.

The sensor is surrounded by LEDs which illuminate the dial. When the dial passes a certain point, the sensor alerts an Arduino that one revolution has occurred. Once the Arduino has this information, the rest is a piece of cake. [Dave] used KiCad to design the PCB and also had access to a laser cutter for the enclosure. It’s a great piece of modern technology that helps integrate old analog technology into the modern world. This wasn’t [Dave]’s first energy monitoring system either; be sure to check out his electricity meter that we featured a few years ago.

Resource Monitoring Solution

Electricity, Gas and Water – three resources that are vital in our daily lives. Monitoring them using modern technology helps with conservation, but the real impact comes when we use the available data to reduce wasteful usage over time. [Sébastien] was rather embarrassed when a problem was detected in his boiler only during its annual inspection. Investigations showed that the problem occurred 4 months earlier, resulting in a net loss of more than 450 cubic meters, equivalent to 3750 liters per day (about 25 baths every day!). Being a self professed geek, living in a modern “connected” home, it rankled him to the core. What resulted was S-Energy – an energy resource monitoring solution (translated) that checks on electricity, gas and water consumption using a Raspberry Pi, an Arduino, some other bits of hardware and some smart software.

[Sébastien] wanted a system that would warn of abnormal consumption and encourage his household folks to consume less. His first hurdle was the meters themselves. All three utilities used pretty old technology, and the meters did not have pulse data output that is commonplace in modern metering. He could have replaced the old meters, but that was going to cost him a lot of money. reflective-power-meter-sensorSo he figured out a way to extract data from the existing meters. For the Electricity meter, he thought of using current clamps, but punted that idea considering them to be suited more for instantaneous readings and prone for significant drift when measuring cumulative consumption. Eventually, he hit upon a pretty neat hack. He took a slot type opto coupler, cut it in half, and used it as a retro-reflective sensor that detected the black band on the spinning disk of the old electro-mechanical meter. Each turn of the disk corresponds to 4 Watt-hours. A little computation, and he’s able to deduce Watt-hours and Amps used. The sensor is hooked up to an Arduino Pro-mini which then sends the data via a nRF24L01+ module to the main circuit located inside his house. The electronics are housed in a small enclosure, and the opto-sensor looks just taped to the meter. He has a nice tip on aligning the infra-red opto-sensor – use a camera to check it (a phone camera can work well).

Continue reading “Resource Monitoring Solution”

Monitoring Your Gas Consumption With A JeeNode And A NRF24L01+

[Sven337] just blogged about a gas consumption monitoring setup he finished not long ago. As his gas meter was located outside his apartment and nowhere near any electrical outlet, a battery-powered platform that could wirelessly send the current consumption data to his Raspberry Pi was required. His final solution therefore consists of a JeeNode coupled with the well known nRF24L01+ wireless transmitter, powered by 3 supposedly dead alkaline batteries.

[Sven337] carefully looked at the different techniques available to read the data from his meter. At first he had thought of using a reflective sensor to detect the number 6 which (in France at least) is designed to reflect light very well. He then finally settled for a magnetic based solution, as the Actaris G4 gas meter has a small depression intended for magnetic sensors. The PCB you see in the picture above therefore has a reed sensor and a debug LED. The four wires go to a plastic enclosure containing the JeeNode, a couple of LEDs and a reset switch. Using another nRF24L01, the Raspberry Pi finally receives the pulse count and reports it to an eeePC which takes care of the storage and graphing.