The idea is to read some data from the optical interface from a Landis+Gyr E350 [technincal sheet] electricity meter. The meter seems to use the IEC 62056-standard. The optical interface uses the IEC 62056-21:2002 Direct local data exchange (earlier: IEC 61107) for the optical probe. If the meter would use DLMS/COSEM-standard I could use Gurux.
Landis+Gyr has their own optical probe: AIP200 but I can build my own for 0.50€. I found a similar project from the Arduino forum. In the project they used a photo reflective sensor which is basicly just an infrared led and a phototransistor. Bebek (finnish electronic store) had a cheap photo reflective sensor that i used. It contain Vishays TCRT5000. To read the optical sensor I needed to connect it to a pull-up resistor.
Here is the wiring diagram.int led = 13;
int irled = 5;
int phototransistor = A5;
int del = 50;
void setup() {
pinMode(irled, OUTPUT);
pinMode(led, OUTPUT);
Serial.begin(115200);
while (!Serial) {
;
}
digitalWrite(irled, HIGH);
}
void loop() {
del = 50;
digitalWrite(led, HIGH);
int out = analogRead(phototransistor);
if(out < 1000){
Serial.println(out);
del = 0;
}
delay(50);
digitalWrite(led, LOW);
delay(del);
}
So I was able to build an optical probe but now i have to know what to send to the electric meter and how to read the output. I just tried to read IR signals from the meter but it did not broadcast anything. Of course I did try to just send IR light to it and I got some reaction: it triggered the tamper alert (an alarm clock on the lcd screen). This should only happen in case of detection of terminal cover opening, detection of DC magnetic field, sealable access lock to voltage connections or detection of Disconnector tampering (Disconnector meters only). The alarm on the screen lasted for about 10 seconds and then went back to normal.
The protocolI tried to find some documentation about the IEC 62056-21 but the standard document costs 280 CHF. It would contain description of protocal modes and how to read the optical interface.
IEC 62056-21:2002 Direct local data exchange [Source]A meter sends ASCII (in modes A..D) or HDLC (mode E) data using a serial port. The physical media is usually modulated light, sent with an LED and received with a photodiode. The protocol is usually half-duplex.
Show more...The Baud rate identification is used for the baud rate changeover. The "request message", the "identification" and the "acknowledgement/option" are transmitted with an initial rate of 300 Bd ( not valid for protocol mode D ). The baud rate identification in the message is determined by the used protocol mode.
Show more...// I have to use an Arduino Mega to use two different serial ports (one for usb to computer and one for the optical probe)
#include < SPI.h>
int irled = 5;
int phototransistor = A5;
bool query = 0;
void setup() {
pinMode(irled, OUTPUT);
Serial.begin(115200);
Serial1.begin(300); // Starting with 300 Bd
while (!Serial) {
;
}
Serial.print("Arduino reading Landis+Gyr E350:\r\n\n" );
}
void loop() {
if(query){
byte cmd[] = {0x2F,0x3F,0x21,0x0D,0x0A}; // query "/?!"+< 13>< 10>
Serial1.write(cmd,5);
}
if(query){
byte cmd[] = {0x06,0x30,0x30,0x30,0x0D,0x0A}; // < 06>"000"< 13>< 10> for energy data
Serial1.write(cmd,6);
}
if(Serial.available()){
int inByte = Serial.read();
Serial1.print(inByte, BYTE);
}
if(Serial1.available()){
a = Serial1.read() & 0x7F; // cheap way of converting from 8N1 to 7E1
char b = a; // convert serial byte to ASCII character
Serial.print(b);
}
}