Reading pulses from meters with pulse outputs.
Last updated: November 2010
Authors: Glyn Hudson, Trystan Lea
A note on what this document covers
The main thing that's being added here to the wealth of information on the internet about pulse counting is how to count pulses from more than two pulse outputs sources (up to 12 sources) using a continuos sampling and direct port manipulation Arduino sketch as opposed to interrupt driven counting.
In the case of counting pulses from one or two pulse output meters it is best to use the interrupt method. There are only two interrupt pins on the Arduino, if you wish to count pulses from more than two sources then please read on!
There is also information here on how to interface with wired / switched pulse outputs.
Many meters have pulse outputs, including electricity meters: single phase, 3-phase, import, export.. Gas meters, Water flow meters etc
The pulse output may be a flashing LED or a switching relay (usually solid state) or both.
In the case of an electricity meter a pulse output corresponds to a certain amount of energy passing through the meter (Kwhr/Wh). For single-phase domestic electricity meters (eg. Elster A100c) each pulse usually corresponds to 1 Wh (1000 pulses per kwh). For the case of higher power meters (often three-phase) each pulse corresponds to a greater amount of energy eg. 2whr per pulse or even 10whr per pulse.
What is a pulse?
Figure 1 illustrates a pulse output. The pulse width T_high varies depending on the pulse output meter. Some pulse output meters allow T_high to be set. T_high remains constant during operation. For the A100c pulse output meter T_high is 50ms. The time between the pulses T_low is what indicates the power being measured by the meter.
For the A100c meter each pulse represents a 1000th of a KWhr of 1Whr of energy passing through the meter.
3600 seconds per hour = 3600J per pulse ie. 1 Whr= 3600J
therefore instantaneous power P=3600/T where T is the time between the falling edge of each pulse.
Optical pulse counting: Flashing LED's
Many electricity meters do not have pulse output connections or connections are not accessible due to restrictions imposed by utility companies. All modern meters have an optical pulse output LED. In such cases an optical sensor can be used to interface with the meter.
The optical pulse output red LED can be seen in the picture above of the A100C, to detect the pulses from the LED you need a light sensor. There is a wealth of documentation on detecting flashing LED pulse outputs with the Arduino over the internet, we recommend having a read of these before continuing.
- An article by AirSensor: Arduino Electricity Datalogger which uses the TSL261 or TSL257 Light to Voltage sensor, Glyn has just been following their guide this week. He found the TSL257 Light to Voltage sensor to be best for detecting LED pulses from a Reporter 5193B meter (see notes on optical sensors below).
- An article by Eric Sandeen Energy Monitor Proof of Concept using an Axman photoreciever
- An article by Ken Boak: Using an Arduino to measure gas consumption
Notes on optical sensors (results of initial tests)
The TLS261 photo diode was also tested. Since this sensor is IR it is not effected as much by ambient light. Was able to detect pulses from a bright LED but not from the Reporter 5193B meter.
Wired / Switched output pulse detection
Many meters also have wired / switched pulse outputs. Many of the meters have connection diagrams similar to this one that comes with the A100C. The two smaller holes are the pulse output connections. I have added Vin and Vout labels to make it a little clearer. Vin is the pulse output supply provided by an external power supply. Vout is the pulsed output created by the meter by switching an internal solid state relay (like a switch in between Vin and Vout)
Wired / Swtiched output supply voltage
From what I understand 24V is a fairly standard supply for such meter systems, but other voltages can usually be used. Meters often have a fairly wide pulse output supply voltage range around 3V to 35V. So the 5V supply from an arduino could be used. Higher voltages are better when there is more noise in the environment and the cable runs are longer.
Watch out for mains connected pulse outputs: Make sure your meter's pulse output is not connected to high voltage mains (within the meter) some meters have one of the pulse output connectors connected to neutral. If your meter is one of these you will need other isolation circuitry to interface with an arduino.
Live wire proximity: The pulse outputs are usually very close to live wires, so watch out for those too!
Pulse output meter to Arduino connection diagram:
The 10k resistor keeps the digital input at GND (digital level 0) when the pulse output 'switch' is open.
Thanks to Jerry for the links and comment below.
Single optical pulse counting using a tidy JeeNode board and a Hope RFM12 RF module: