Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

PIC + Google Power Meter
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PIC + Google Power Meter

by Pyrofer on Wed May 19, 2010 5:10 am

After seeing the Kill-a-watt modded to use google power meter I thought I would share my PIC based project.
Components,
PIC micro, Serial to Ethernet convertor, IR relectance sensor.
Because Google require https its very hard to implement on a micro, and the Kill-a-watt solution uses a server running in the home. I didnt want this.
After a few hours coding PHP I had a page on my hosted web service that takes a standard url request with http post variables sent on to Google via the power meter API.
The php takes care of all the API and https issues, leaving my PIC free to do a single simple http GET to upload the variables!
Because I used a cheap serial to ethernet adaptor no IP stack coding was needed, the pic simply sends the text out of the serial port "GET /url?reading=xxx HTTP1.0"

To measure power usage the IR pair watch the spinning disc on the meter, when the black block passes it counts one revolution. 150 of these is 1kWh. Because this is a direct reading of the meter itself is 99% accurate to the electric companies billing.
So all the PIC does is count pulses from the sensor, and every 10 minutes it sends the HTTP get to the serial/ethernet adaptor, that links to my hosted server and uploads the reading to google.

A simple solution, with very simple and mostly cheap parts! Its possible that the Xport serial to ethernet convertor could be programmed to count the revolutions for you but im not sure on the programability of it.

I will be writing it up in more detail for my blog when its finished and tested (so I have some readings to show).
Just thought id share this approach and see what people think.
Pyrofer
 
Posts: 3
Joined: Wed May 19, 2010 5:00 am

Re: PIC + Google Power Meter

by adafruit_support_bill on Wed May 19, 2010 5:29 am

Nice project! I like the direct reading idea, and the back-end connection sounds pretty straightforward too. Looks like an easy port to most any microcontroller.

Did you have to open the meter case to get at the dial?

adafruit_support_bill
 
Posts: 78659
Joined: Sat Feb 07, 2009 10:11 am

Re: PIC + Google Power Meter

by Pyrofer on Wed May 19, 2010 6:13 am

The actual dial reading is the last part im doing. Everything else works.
In theory NO, dont open the meter it should work. Actualy, NEVER open the meter. Its probably an offence to tamper with it as it belongs to the electric company often. (UK). Also, its safer not to touch anything in there!

Its a mater of balancing the IR signal so the black stripe is enough to break the beam. Carefull positioning and blocking of stray IR is important. Modern meters have a flashing LED that can be sensed much more easily.

To be honest, im probably going to stick both emitor and receiver in a block of blutac so I can adjust the position/angles to get best results.

Ironicaly I'm stumped by the lack of a power socket near the meter to plug the PSU into, so I may end up having to make it wireless (a more expensive serial to wifi adaptor) and use batteries. Originaly it was to be power over ethernet, I bought a POE splitter that gives 5v out but cant find a decent route to the meter for the cat5.
Pyrofer
 
Posts: 3
Joined: Wed May 19, 2010 5:00 am

Re: PIC + Google Power Meter

by adafruit_support_bill on Wed May 19, 2010 6:50 am

Definitely never open the meter yourself. I've had the power company open it for electricians to install new service, but they supervise the work and seal it back up before they leave. I would have been very surprised if the power company allowed you to install anything else in there. I'm just curious because I think it would be very difficult to read the wheel on mine through the glass as it is at right angles to the face.

It was my understanding that large parts of Europe were going to the ISO/IEC 14908-1 (a.k.a. LonWorks) standard for remote meter reading. Talking to one of the engineers at Echelon that developed the standard, it should be possible to tap into this signal for power monitoring.

adafruit_support_bill
 
Posts: 78659
Joined: Sat Feb 07, 2009 10:11 am

Re: PIC + Google Power Meter

by Pyrofer on Wed May 19, 2010 11:36 am

Thats entirely possible, however a large part of the UK population have old meters. Some in flats even have COIN operated meters!

Reading the wheel is by far the most universal method, the Led is easier, but only for newer meters. Remember, if you can SEE the black mark move round, so can an IR pair. Its just a matter of some tuning to get it to trigger correctly.

Placing the pair above the wheel and pointing down at an angle will reduce direct reflection from the glass, also, if the emittor is covered right up to the glass there shouldn't be much leakage to blind the reflection.

Incidentally I'm working on reading my gas meter too. This will be done with an optical mouse assembly modded to output the actual image to the PIC.
The pic will see the last 2 digits of the readout. It will do basic OCR by checking the colour of pixels in 7 places that corespond to the 7 digits in the normal 7segment display.
By reading the last 2 digits the PIC will be able to track gas usage too.
That wont be done untill after the electric reading works however.
Pyrofer
 
Posts: 3
Joined: Wed May 19, 2010 5:00 am

Re: PIC + Google Power Meter

by Amberjack on Thu Oct 14, 2010 5:55 am

Hi there Pyrofer.

I am working on a very similar project, and I was looking for a Serial to Ethernet convertor, but those that I saw, they only allow you to connect to a port on a certain IP, but this isn't wat I want. what I want is to do the same as you, send data via HTTP to a php webpage using the URL address. I also saw a few that allow me to communicate trough HTTP, but I need to build the hole protocol inside the serial to Ethernet convertor.
What Serial to Ethernet convertor did you use?

Best regards,
Daniel
Amberjack
 
Posts: 2
Joined: Thu Oct 07, 2010 9:41 am

Re: PIC + Google Power Meter

by richms on Thu Oct 14, 2010 9:15 am

You have meters with wheels still? I wish I still had my old one of those, read way low and had no concept of powerfactor. When the digital meter went in my bill went up about 20%.

Anyway, the newer meters have an IR port on the front (its a 2 way one, not just a flashing LED) - has anyone done any work in interfacing thru that? I would like to be able to get the amps out in real time since the whole house is on a pathetic 63A breaker, so if I take more than about 70 for a while it trips, and as it is A not watts that matter for that, counting the flashing light doesnt help since that indicated 0.1% of a kWh used, nothing to do with current.

richms
 
Posts: 558
Joined: Tue Jan 20, 2009 3:05 am
Location: New Zealand

Please be positive and constructive with your questions and comments.