DLMS COSEM (IEC 62056) Automatic Meter Reading

I have seen a number of projects where an Arduino is used to read a flashing LED to allow consumption information to be compiled but very little about using DLMS COSEM protocols to read potentially more and also more reliably, actual cumulative consumption information at any moment in time. Using such a method would allow for the Arduino to poll when it wants information rather than having to use interrupts etc.

Most meters nowadays have a way in which to interface and obtain this information - often it is by an IrDA device located adjacent to or in the vicinity of the flashing LED used for the pulse counting.

http://en.wikipedia.org/wiki/IEC_62056 explains more about what the protocol is.

These next few links also cross refer (I think) but they are useful in getting an idea of what is possible. The implementation falls short of actually a full understanding of the data coming from the meter (which I believe would be possible if the protocol was better understood): http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1273413449/9#9 http://www.rotwang.co.uk/projects/meter.html http://www.csc.liv.ac.uk/~greg/projects/rdmeter.html

I have found one implementation which claims to be open source under GPL2, but I can find no trace of the source: http://www.gurux.fi/index.php?q=OpenSource

Is anyone working on an implementation of the protocols that could be used on an Arduino? I think that this is the way to go for ongoing and accurate meter reading. I am particularly interested as I have an Elster meter which I understand transmits the information over IrDA once every second. I have a 3 phase meter (the one in the example above is single phase) and I have written to Elster asking them for more information around what they are broadcasting - we'll see what they come back with.

I have other meters from Landis & Gyr / Ampy monitoring separate circuits which also have an optical port for interrogation and I'd like to find out more about how they can be interrogated. I believe they will all comply with the DLMS COSEM (IEC 62056) protocol and so one lot of programming could theoretically converse with all these meters even though from different manufacturers.

Has anyone any thoughts or knowledge of the above?


I have done something similar using a Nano with simple photoresistor to pick up when the red LED pulses on my home electric meter. The nano relays this pulse by 434/433Mhz transmitter to another Arduino that has an LCD crystal display. Im measuring the time between each pulse and calculating a rate of energy consumption in kWh. Simple maths when you know that the meter pulse rate is 1 imp = 1 Wh. The code is simply an analogRead and triggers a serial transmission when a certain threshold is reached, i.e. > 500 - indicating the red light on the meter has flashed. You could always log the pulses at an SD card every 1 minute or 30 mins etc.

To communicate directly to the meter's silicon over IR should be simple. Theres plenty of Arduino projects using IR communication. However I would guess that the meter has an access code for read/write operations, or maybe just for write operations. Also the DLMS COSEM object model looks fairly heavy weight.

I would be very interested to hear how you get on with this.

first post btw :)

Reading through the experiences had by those in my earlier links, I'm optimistic that it is not a great leap to take it from Elster specific meter reading to something more general purpose. I think the Elster meters must be compliant with DLMS COSEM and it was possible to reverse engineer what much of the information comprised of - with documentation I think it could be relatively easy to modify.

DLMS COSEM has different levels of what it allows - all we need is the equivalent of what the hand held meter readers have - to read consumption and some useful other information that seems to be broadcast. These meter readers must be capable of reading from multiple manufacturers' meters - that and the fact that GuruX seem to have an open source product advertising such a capability leads me to believe it can be done.

Welcome to the forum!

I didn't realise that the basic Elster meters automatically push out data through the IR port. This is very useful for this kind of project! I dont think the Landis & Gyr/Ampy meters do this.

Reading the meter register is obviously a better way of monitoring the meter's consumption. Logging pulses is prone to missing a pulse and you need to log a base meter reading you want to track the total meter reading.

Some meters have an M-Bus interface. Its often used for connecting to energy management systems (or BMS). Its very common on a lot of newer meters and certainly most three phase digital meters. Heres an overview. http://www.m-bus.com/info/mbuse.php. It doubt this is any more difficult to interface with.

Thank you. I'll look at the M-bus method, too.

In the meantime Elster have responded to my writing to them and have provided a 9 page document on the IrDA output of the Elster A100C meter which is used for many single phase applications. My application uses a three phase meter - the Elster A1100. In the e-mail the sender asked someone he copied to provide me with the same document for the A1100, if its output is different. I hope it is as I would like to be able to monitor each of the phases separately.

Hi rtXX, how are you getting on with this? Did you find out if the output for the A1100 is for individual phases? I would be surprised if it is.

It seems the A1100 does an aggregate total only, so you will not be surprised.. :) Elster e-mailed and advised this.

I also wrote to Landis&Gyr/Ampy and got a rather useless reply - 'we don't support the people who buy our meters unless they're a massive conglomerate so you won't get that information from us' - I paraphrase, of course. Elster were much more helpful.

I'm still sourcing parts but will come back with any further news when I have it.


Hope this helps. I have done some protocol development for some meters (ANSI/IEC). This byte frames will work for Landis+Gyr meters if it is program to be in mode A (IEC 62056-21). The command frame is just to query the meter for data.

character frames:

/ = 2FH or AFH ? = 3FH ! = 21H CR = 0DH LF = 0AH

Create a Serial object in Arduino:

byte cmd[] = {0xAF,0x3F,0x21,0x8D,0x0A} Serial.write (cmd,5);

Let me know it you are able to receive reply bytes and I'll show how to decode them.

Hello vans,

I have the Iskra MT372 meter that is also following the IEC 62056-21. Could you please educate me in how i get a readout with an Arduino. I have a photovoltaic system on the roof, so would be very nice to have power readings going both in and out of the house…

Thank you for any help!

Do you have an optical reader (IEC FLAG reader) or can you connect to the meter using its RS485 port?

Did not activate “Notify” on this thread, its done now, so see your question a bit late…

Yes, I made my own optical reader and it seems to work fine.

This is my test code:

Serial.println("Meter type");

byte cmd[] = {0xAF,0x3F,0x21,0x8D,0x0A}; // query the meter for data "/?!"+<13><10>
iskSer.write (cmd,5);

byte a;
while (iskSer.available() > 0)
  a = iskSer.read() & 0x7F; // cheap way of converting from 8N1 to 7E1
  char b = a; // convert serial byte to ASCII character

gives me:

/ISK5\2MT372-3107 and everything is good, its showing my meter type :slight_smile:

Then if I send the frame <06>“000”<13><10> polling for the energy registers, I get the following data:


And question is now how do I grab the essential 1936.631kWh imported, and the 1716.519kWh exported? A floating format? In my test code I just loop through every single byte in the buffer and convert it to readable characters…

Thank you for your help - I think I am almost there :smiley:

Slav: Yes, I made my own optical reader and it seems to work fine.

Hi ,can you share schematic for your optical reader ? I am interesting too by Electricity Meter Reading . Thank you.

Hi ,can you share schematic for your optical reader ?

See attached schematic - you can use this http://www.seeedstudio.com/depot/photo-reflective-sensor-p-543.html?cPath=144_148 IR block or the like

Hi I know its about a year ago but

Regarding the MT372 Does anyone have some short code examples setting the serial port and sending / receiving data from the MT372 IR connector?

Kind regards Torben


This is a bit off thread really...

But I think the newer meters also communicate via RF using some sort of XBee compatible protocol.

However I've not found any open source solutions, or a great deal of information about this.

I know that the you have to contact your electricity supplier and they have to authorize you meter to communicate with the XBee based device, I presume based on some serial number (in the XBee ??)

But this does seem the way that things are going and provides a lot more data i.e realtime power usage etc.


Just found this


It's python but it could be ported

Has anyone been able to read the IRDA port of an Elster A1100 with an Ardunio Yet?

If so how did you do it? :~



There are two ways to read IEC smart meters, IEC 62056-21 and DLMS/COSEM. IEC 62056-21 is ASCII based protocol and DLMS/COSEM is binary based protocol.

IEC 62056-21 is easier to use, but DLMS/COSEM offers more functionality.

You can try to use Gurux DLMS/COSEM component.

All source codes are available for Java and C# at github. http://www.github.com/gurux