Go Down

Topic: Reading your Electricity Meter. IEC 62056-21 (Read 20 times) previous topic - next topic

ffimon

Hi

I have had a search round on this site and others for information in reading the data from my Electricity Meter.

I found this http://arduino.cc/forum/index.php/topic,22225.0.html topic but it was closed so I could not reply to it.

I just got into arduino kit (In the past week or so) and have done the usual experiments temperature probe, RTC, LED Blink etc. But now I wish to move on to what I wanted to do. 

I installed 3.75KW of solar on my house and I wish to monitor not only how much I produce but how much I export. I have two electricity meters the First is An Elster A100C this is the one I had fitted and measures my "GENERATION" i.e. the Total energy produced by the PV. I have managed to read this meter after reading this http://www.rotwang.co.uk/projects/meter.html article. It worked almost first time using a just an uno and a TSL261 http://www.alldatasheet.com/datasheet-pdf/pdf/92399/ETC/TSL261.html PhotoIR optical sensor. This meter constantly transmits its data about once every couple of seconds or so so was pretty simple to read.

The second meter I have is the one fitted by NORWEB my electricity supplier this records both my "IMPORT" i.e. the electricity I get from the grid and my "EXPORT" i.e. the excess electricity I produce that goes back to the grid. Unfortunatly this meter only displays the "IMPORT" figure but I am reliably informed that deep in its registers are the "EXPORT" values too.This meter an Ampy 5196A I have had some success in reading this meter too. I used the TSL261 as a receiver and this http://dx.com/p/38khz-ir-infrared-transmitter-module-for-arduino-135040 as my transmitter.  Before I dived into reading the meter with the UNO I thought I would see if I could read the meter with a PC using a USB to TTL adapter (cp210x).

I hooked it up as follows.

Serial adapters tx Pin ----> signal pin on the transmitter
Serial adapter Ground -----> Transmitter Ground
Serial Adapter RX Pin <----- Receiver Signal Pin
Serial Adapter Ground ------> Receiver Ground
Serial Adapter 5V -----> Receiver VCC

I opened up "termite" and sent /?!{cr}{lf} to the meter at (300 Baud 7Bit Even Parity One Stop Bit) but no joy  :0 , other than /?!{cr}{lf} being received back by the receiver (Echo was turned off). After a little head scratching I had a flash of inspiration, I thought what happens if the "1" should be "0" and vice versa. So I dug out a 74c04 Hex Inverter and inverted both transmitter signal  and the receive signal. I opened up "termite" again and sent the command 20 or so times and eventually got a reply something on the lines of /AMP05196A-21 (I think). The receiving was very Hit and mis only got a reply about 7 or 8 times out of about 100. The transmission was working though as the meters Red led flickerd for about 5 seconds every time I sent the command. The receiver seems to need to be pointed precisely at the RED led to work, at first I thought the TSL261 may need amplifying. In writing this post I found this http://www.abacuselectrics.com/f6zd09r.pdf data sheet It appears that my Utility company have fitted one of the only meters that replies in the RED spectrum not the IR spectrum. There must be just enough IR being emitted to operate the TSL261 if the wind is blowing in the right direction and I balance on the right leg.

My original question was going to be can I invert the tx/rx  serial port signals in the "UNO" in software or am I still going to need to  still use an inverter. I figure I can get away with an inverter for the transmitter by connecting it like so.


UNO tx Pin ----> Ground transmitter
UNO 5V -----> Signal Ground.

Thus when the TX is low the LED will be transmitting.

My second question, In the light of my RED/IR discovery is, Am I best trying to amplify the TSL261 output or can someone recommend a TSL261 equivalent for RED light and am I going to have to stop daylight getting to it. 

I have a copy of the IEC 62056-21 specs and getting the data out of the meter is relatively simple one you have the optical probe. I hope that this will allow access to the data IEC 1107 optical port for less than $10 rather than the $80-100 everyone seems to charge for the a probe. This would be more accurate and simpler to implement than say a CT clamp. 

draythomp

There's a bunch of experts at reading pulses and other stuff from a meter over at http://openenergymonitor.org that you can consult with on this.  Also, if you use software serial in its latest incarnation, you can read reverse signals on the serial input.  This allows you to use the regular serial as a monitor or command port.  The page for it is at http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html  I haven't used it with signal inversion, so you'll have to take a look at the library to see how to set it up for this.  More info on this at http://arduiniana.org/libraries/newsoftserial/

I tried reading my meter which gives out red (can you believe it) pulses.  I was getting terrible interference from ambient light and had to get some modeling clay and mash it all over the sensor and about an inch out to the side.  This gave me enough signal to reliably count pulses, but the clay melted in the sun and I haven't gone back to the project to see what is better to do.  Took about an hour to clean up the melted clay from the meter and the concrete under it.  There are lots of silicon based solutions that I could have used, but I happened to have some dark blue clay.....  When you get that far along, google oogoo for a material that works really well for stuff like this, you can even tint it to the color you need.
Trying to keep my house under control http://www.desert-home.com/

Kuba_eM

If somebody is interested in meter's optical probe project, please read Elektor's article:
http://pl.scribd.com/doc/50612482/Iec-1107-Electricity-Meter-Interface
Kuba_eM

ffimon

I have ordered one of these http://www.vishay.com/docs/81532/bpw96.pdf Photo Transistors with a 10K variable resistor. From what I can make out if I put the emitter to ground and use the 10K to pull the collector to 5v. I can then connect the collector to the input of my inverter. By adjusting the POT I should be able to adjust the light threshhold to cut out the effect of ambient light.
 
The Lamda for the BPW96B goes below 640nm and upto 1000nm so hopefully this device will work for my meter and conventional IR meters. The problem with the TSL261 I have is is low end cutoff is 800nm which is why its flaky with my red led meter.


ffimon

Well there's "Good News & Bad News"

The good news is that the BPW96 photo transistor with a 10K Pot did the trick. Also the signal doesn't need inverting.

Now I send this request message @ 300 Baud 7bit Even Parity one stop Bit 

2f 3f 21 0d 0a  /?! {cr}{lf}

Then get this reply...

2f 41 4d 50 30 35 31 39 36 41 2d 36 31 42 0d 0a              /AMP05196A-61B {cr}{lf}

(This is the model of the meter)

All well and good. :)

Now for the bad news....

If I send an acknowledgement and read command I get no reply.

This should give me a meter read but unfortunately returns no data.

Just as a test I sent an Acknowledgement with the programming command 

06 30 30 31 0d 0a                                            .001 

And got this supply

01 50 30 02 28 30 30 34 30 29 03 64                  .P0.(0040).d

Which from the I.E.C. specification means give me a password using a manufacture specific algorithm and 0040 is the key.

So my conclusion is that "Yes you can make an optical port for less than a couple of £'s" but not all meters allow you to read them without a password. 

A lot of meters give up there data only after the initial handshake. Others like the Elster A100C dribble the data out constantly without any request.

So now I need to go to plan B a current transformer. The optical output goes solid red when the power when the power flow is reversed so combined with a current transformer I should be able to get the data I need.

Go Up