bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Energy monitoring

Sat Jan 31, 2015 5:46 pm

I am looking to add an energy monitor to my mains to track usage trends. I am aware of some options, but I was curious for some input by others.

My system:
I have 2 200A panels fed from a 400A box outside. I don't have access to the mains coming into the house without calling the utility. Due to changes in regulations since the house was constructed, I cannot call them as it would require a major rewire that would be very expensive (it's not important, so I'll leave it at that). I can put CT clamps on each of the 4 mains (2 per panel).

Currently:
I've been writing down the meter reading manually about 4-5 times a week after work for years. Fidelity is poor and tracking versus temperature is very coarse as well.

Goal:
I want to track overall usage and record the data locally and/or at one of the online trackers. I don't need individual breakers, just a single overall usage value. Eventually I will add a weather station of some kind to get temperature, wind, etc. but that's later on.
I have a Raspi B at the panel that I use for home automation. I currently only use X10, but other systems could be included easily.

Requested help:
What system should I look at? The current options seem to be something like the Aotec HEM1 which is zwave, a Blueline meter reader + wireless bridge, an Arduino solution (OpenEnergyMonitor), somehow connect CT's to the Raspi, or something else.
I have an Arduino Uno and network shield in my inventory if that matters.

User avatar
aTao
Posts: 1093
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: Energy monitoring

Sat Jan 31, 2015 7:24 pm

All depends what you are comfortable with.

Blueline makes me feel ill, too trendy corporate and not enough raw information, but does look like a brilliant idea.
AEOTEC is just a ready made CT solution, if you are confident to get your own working then its up to you, do the dev work or pay for someone else to have done it for you.

Looking at those options, if the Blueline system would work for you, I would build my own. All it is is a light cover for the wheel on the meter, a light source (LED and a photo transistor/diode/resistor/cell. Follow that with a logic conditioning circuit (whatever the sensor does to 3.3V for the RpI) and you are done.


Edit..
If you reference commercial units, or anything really, links would be really handy.
>)))'><'(((<

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Energy monitoring

Sat Jan 31, 2015 9:00 pm

Since you've got an Arduino and a CT then wiring the two together seems like a good start.
http://openenergymonitor.org/emon/node/58

You can send the data to the Raspberry by serial or with an ethernet shield by using Nick O'Leary's MQTT library and mosquitto on the Raspberry. The Arduino has the benefit that it's got the analog inputs that are missing from your RPi.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Energy monitoring

Sat Jan 31, 2015 9:07 pm

This is my system, does energy monitoring besides other stuff.

http://pluggy.duckdns.org/index.html

It uses an Arduino for the monitoring and a Pi to do the hosting, pretty graphs etc although it could be done with just a Pi. The Arduino predates the Pi by about 3 years. I gave up trying to get meaningful readings out of CTs years ago. I got frustrated by the inaccuracy and the difficulty in getting anything like meaningful readings at low power levels (usually with poor power-factors).

For years I've done it by counting and timing the blinking LEDs on meters, its close to 100% accurate and as a bonus for just using a Pi, it doesn't need an ADC, it can be purely digital.

I have solar panels, which the system also monitors, one of the meters has a direct open collector ouput and one has a phototranstor stuck over the LED. I have 4 meters as in the photo, but only 2 are wired, One is the generation meter and one is the use meter, the other 2 are done mathmatically, but its useful to have meters for the long term. The two meters not wired are import (what is what the electric company reads) and export. Mathematically Import is Use - Generation and Export is Generation - Use.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Sat Jan 31, 2015 11:06 pm

I am open to developing a solution as long as it's not too intense on the design side of the hardware. I can follow directions and build a kit just fine, but surface mount is out of my capability due to equipment.

I considered ready made but they all seem to have some down sides which makes DIY an option.

Aeon Labs Aeotec HEM 1A:
http://aeotec.com/z-wave-home-energy-measure
http://www.amazon.com/Aeon-Labs-Aeotec- ... B00FKJBUX2
This is a good option, but it uses zwave to transmit and I only need it to go 3' so I'm basically adding a new system for one component that could be done with a wire. Price is a little high because I need 2 of them and have to obtain a zwave usb stick for this one device thus somewhere around $250.

BlueLine PowerCost Monitor with WiFi Bridge (BI 32000):
http://www.bluelineinnovations.com/powe ... d-sensor-0
http://www.amazon.com/Blue-Line-Innovat ... B00EU7NUP6
I would have to go wireless if I go with a meter optical sensor. As a result, the package would end up running costing close to $200.

Arduino OpenEnergyMonitor:
http://openenergymonitor.org/emon/
This is also wireless but uses a relatively cheap components. It's open source so I could build it from scratch or buy pre-built. Prebuilt might be cheaper since it appears to include CT's but I doubt they would be appropriate for 200A. Total cost is likely around $100.

TheEnergyDetective (TED):
http://www.theenergydetective.com/
Wired solution that uses CT's on the mains and a hub that appears to connect to a PC or a wireless viewer. Systems start at $200 but I'd need 2 sets. I'd also have an issue with interference with my X10 from what I've read in the past.

As I said, these are the options I've considered, but others that I haven't would be very useful. I did consider building my own optical reader to go on the meter itself, but weatherproofing and communication inside the house would need help. I also don't know how compact the solution I might come up with could be, so BlueLine might be a better option. I also considered using a BlueLine reader and a DIY receiver. There's some code for Arduino that might work but I haven't looked at it. I don't know if that would be cost prohibitive compared to just getting a WiFi bridge.

I don't exactly have a budget since this is a hobby as much as for useful data. I'd like to keep the cost closer to $100 or less than over $250. But, most importantly is reliability and safety since I could be adding this into my panels.

User avatar
aTao
Posts: 1093
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: Energy monitoring

Sat Jan 31, 2015 11:41 pm

All your solutions seem pretty good, so its all down to personal preference.

Are there really serious weather proofing considerations where the mains distribution is? seems a bit odd. Even then potting compound will fix most problems.
For 3' transmission distance (are wires really out of the question?) I would certainly consider a home made opto sensor preferably wired to the RPi or a home brew on/off wireless signal (ultrasonic might do the job too)

For manufacture of a sensor:, do you have access to (or do you know anyone with access to) a 3d printer? If not then make a model of it in clay/plasticine/soap, cast a mould then assemble the components in the mould and fill with clear epoxy resin.
>)))'><'(((<

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Sun Feb 01, 2015 1:13 am

Ahhh, I understand now why there's a bit of confusion. I have 3 locations that I mentioned and made it sound as though they are the same. I'll explain again just for clarity. I have a pad mount transformer vault in front of my house that is where the power from the utility comes onto the property. The power goes to a meter (with a rotating wheel and analog dials) on the side of my house. In the basement I have a current transformer (big grey box) that feeds power to 2 200A panels on either side. One of these panels can be switched to a generator backup. Next to these panels, I have a structured media box (telephone, network, cable) as well as the router, DSL modem, HA Raspi, etc, etc, etc.

I like the idea of using a clamp style CT because it keeps everything in the same location. Using a Blue Line style reader is ok but I would pretty much have to go wireless or find a path into the basement for wiring (possible, but not ideal). I know there are accuracy issues with the CT approach, but how bad is it for the whole house? Seems like it would be accurate enough for understanding trends but might miss when trying to calculate the actual energy bill. Even then, I'm not sure how far off it would be.

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Thu Feb 05, 2015 7:41 am

I've been leaning toward using the Blue Line Power Monitor and a wireless receiver module connected to either an arduino or raspi. The most likely candidate so far is something like this:
http://scruss.com/blog/tag/blueline/

I do have the arduino, network shield, proto shield, and maybe even a rf receiver (315MHz I think, so may need a different one). But, anyone know of a way to use the arduino project code directly with raspi? 433MHz is the same as weather stations and other equipment, so I was thinking I might be able to double duty things...

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Mon Feb 09, 2015 4:49 am

I found a Blue Line Power Monitor on ebay for reasonably cheap and it should arrive late this week. I'm now trying to figure out the best approach for reading the data. I have some 315MHz receivers that should be tunable to 433MHz...but I don't have a reliable way to tune them. I ordered a 433MHz transmitter/receiver kit and it should be here by the end of the week as well. I found a code that claims to be able to decode using an arduino and a 433MHz receiver, so that will be my going in approach. It would be nice to be able to use the Raspi directly just because I find it easier to code for, but I suspect the Arduino would be a bit better suited for this job.

One other thing I've decided is that since I'll be using a 433MHz receiver to decode the power monitor, I'm also going to add a weather sensor. I picked up a system from Lowes that seems ok, but I'm not sure if it's a good fit. On the up side, I found several sources of decoded signal for the setup (Acurite 5in1 weather station). I actually found that the sensors are available separately for many of the stations, so that may be a cheaper way to go.

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Tue Feb 10, 2015 4:11 pm

In case anyone is reading this thread, I could use some insight. I have been reviewing documentation on using an Arduino to decode the 433MHz signal from the Blue Line / Black&Decker Power Monitor. It looks like if I use that setup, I can pretty much just use the provided code and build the hardware as documented. That would be fine, but I was wondering if I really need the Arduino since the Raspi has GPIO's as well. Wouldn't it be possible to just use the Raspi with either an SDR or a 433MHz receiver directly? The only problem I'm concerned about is how much that would load down the system. Does anyone have some knowledge on if using the Raspi in this way would bog things down? This is a home automation system so I don't want it to hurt performance.

User avatar
davidcoton
Posts: 4908
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Energy monitoring

Tue Feb 10, 2015 7:42 pm

bkenobi wrote:... I was wondering if I really need the Arduino since the Raspi has GPIO's as well. Wouldn't it be possible to just use the Raspi with either an SDR or a 433MHz receiver directly? The only problem I'm concerned about is how much that would load down the system. Does anyone have some knowledge on if using the Raspi in this way would bog things down? This is a home automation system so I don't want it to hurt performance.
The other items you have mentioned are not likely to be pushing the Pi hard. I would be surprised if a bit of data decoding (that which you might do on the Arduino) would push it over the edge. However, there could be some heavy real time processing lurking in your description that I've missed.

Which model Pi? If you're planning Model 1 (B or B+) then the architecture is single processor and you will need to allow for any real time processing of incoming data. A 2B with four cores should have no issues there.
Signature retired

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Tue Feb 10, 2015 8:52 pm

I'm not pushing the Pi hard currently. I just want to make sure that events that come in from a motion sensor don't end up waiting to turn lights on due to adding RF monitoring and decoding. I can't see it as being very intensive, but The Pi is only a version 1 B so it's not a powerful machine. My Windows laptop has no issue with SDR# but it's a multi-core system.

I suppose I can plan on testing/debugging on Adruino and then try using the Pi directly. As long as there's no surprise delay, I can keep it on the Pi.

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Mon Feb 23, 2015 4:10 pm

FWIW, I'm currently testing the components, but it looks like a viable path forward is going to be:

Raspi B
Arduino
433MHz 3400RF superheterodyne receiver
Powermon433

I'd like to remove the Arduino from the equation for simplicity, but a Nano is sufficient and costs so little that I may not worry about it. Since the receiver only needs 1 data pin, and standard voltabes, it seems like the only think keeping me from going that route would be converting the Powermon433 library to Raspi. I ran the Arduino off a PC last night for half an hour and was able to see the furnace turn on and off which was pretty cool. Not sure how to get the data off the Arduino and onto the Pi yet, but that shouldn't be all that difficult I imagine.

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Fri Feb 27, 2015 5:49 am

It doesn't look like anyone is still watching this topic, but in case I'm wrong I do have a question I'm stuck on.

I have a 433MHz superheterodyne receiver module that works great on the Arduino. I wired it up on the Raspi and I get nothing. A search of topics suggests that the issue is a logic level issue where the chip is using 5v logic which the Uno can handle but the Raspi wants 3.3v. So, I tried using a voltage divider as suggested here:

http://www.disk91.com/2013/technology/h ... pberry-pi/

I didn't have the correct resistors, but used the correct ratio. But, I get absolutely nothing. I used the arduino as an oscilloscope and verified that the logic level is truly 5v but I don't get anything with the resistors. I'll pick up the correct resistors tomorrow, but any other suggestions would be great.

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Wed Mar 04, 2015 4:35 pm

Well, part of my issue was the antenna length. I used a ~1/2 wavelength antenna that was apparently sized wrong. I tried a better wire with an accurate 1/4 wavelength and after recording on Arduino for about an hour saw 1 missed signal. So, the receiver should work for me.

I picked up some Zener diodes and a couple CD4050B chips which may not be used. I think I'm just going to connect the Arduino to the RPi over SPI at this point. I think segmenting the RF processing from the RPi will be better in the long run. Up until last night, I was about to jump on the Moteino+HopeRF band wagon. But, if this chip continues to function I'll probably stick with what I already have.

User avatar
JSingleton
Posts: 18
Joined: Fri Jan 16, 2015 12:10 pm
Contact: Website

Re: Energy monitoring

Tue Mar 17, 2015 12:44 pm

I wrote up a similar project I did a while ago: https://unop.uk/dev/raspberry-pi-electricity-monitor/

Check out the interactive graphs. You can click and drag to zoom in on either axis. http://jpsingleton.github.io/rawExample.html and http://jpsingleton.github.io/lowPassExample.html

Image
Image
Image

These all use http://dygraphs.com/ which is awesome. I use it on https://shutdownscanner.com/home/dashboard too.
Computing4Kids.com
@shutdownscanner
unop.uk

User avatar
scruss
Posts: 3155
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Energy monitoring

Tue Mar 24, 2015 1:10 am

Oh, um, sorry … didn't see this thread. The blueline/arduino thing is my project, though really capnbry and the mysterious “redgreen” know a lot more about the code and protocol than I do. I like the BlueLine as it doesn't use CTs. I work with CT data a lot, and even expensive ones aren't that accurate. The BlueLine (and identical Black & Decker unit) use your meter's pulse/Wh output, so are as accurate as your meter can be. More importantly, it should agree with your billing.

The unit does have one major limitation, though: its cumulative meter counter rolls over at 65,535 Wh (or 65½ kWh). In noisy environments, and with high loads (or generations: the unit could be used to measure generation from rooftop solar, too) you might miss enough packets that you overflow the counter and lose your reading. With my load, I get rollover roughly every 2½ days, and the longest ‘packet drought’ I've seen is 18 hours.
bkenobi wrote:Well, part of my issue was the antenna length. I used a ~1/2 wavelength antenna that was apparently sized wrong.
Yeah, trimming antennae for these radio bands is fiddly. I tend to agree with capnbry, who now just uses the moteino. It has a pre-trimmed antenna and the nice Hope RFM69 radio on-board.

To answer your question from my blog, I don't know why the Micro doesn't work.

Stewart
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

rpiswag
Posts: 804
Joined: Mon May 19, 2014 10:04 pm

Re: Energy monitoring

Tue Mar 24, 2015 1:14 am

What about a twitter bot that tweets how much electricity you are using?
A computer's power can't be just measured Gigahertz. It is the same thing with us humans.

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Tue Mar 24, 2015 2:37 am

I've only used an Arduino for one other project, but that one has been running untouched/flawlessly for nearly 2 years. That being said, I'd say I'm pretty much a newbie to the platform. I haven't used interrupts before, so this project is pushing my limits! I thought I could simply copy the protocol functions from Powermon433 and use RCSwitch to receive and convert the RF into packets. But, interrupts are harder than I thought. And, getting RCSwitch to receive the data is causing issues as well. I certainly didn't expect the Nano to cause another level of difficulty. :shock:

User avatar
scruss
Posts: 3155
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Energy monitoring

Tue Mar 24, 2015 10:34 am

rpiswag wrote:What about a twitter bot that tweets how much electricity you are using?
Low on my priorities, but the hard part is getting your data measured reliably. Once you have the data, writing twitter bots isn't too hard.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Tue Mar 24, 2015 1:11 pm

Is it fair to say then that you updated CapnBry's code to improve certain areas and that he knows the ins and outs of the framework best? I'm trying to get either version of Powermon433 working on a Nano, but also understand it well enough to either add a new protocol to it or add its protocol elsewhere (RCSwitch for example).

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Energy monitoring

Tue Mar 24, 2015 1:16 pm

scruss wrote:Oh, um, sorry … didn't see this thread. The blueline/arduino thing is my project, though really capnbry and the mysterious “redgreen” know a lot more about the code and protocol than I do. I like the BlueLine as it doesn't use CTs. I work with CT data a lot, and even expensive ones aren't that accurate. The BlueLine (and identical Black & Decker unit) use your meter's pulse/Wh output, so are as accurate as your meter can be. More importantly, it should agree with your billing.

The unit does have one major limitation, though: its cumulative meter counter rolls over at 65,535 Wh (or 65½ kWh). In noisy environments, and with high loads (or generations: the unit could be used to measure generation from rooftop solar, too) you might miss enough packets that you overflow the counter and lose your reading. With my load, I get rollover roughly every 2½ days, and the longest ‘packet drought’ I've seen is 18 hours.
bkenobi wrote:Well, part of my issue was the antenna length. I used a ~1/2 wavelength antenna that was apparently sized wrong.
Yeah, trimming antennae for these radio bands is fiddly. I tend to agree with capnbry, who now just uses the moteino. It has a pre-trimmed antenna and the nice Hope RFM69 radio on-board.

To answer your question from my blog, I don't know why the Micro doesn't work.

Stewart
It isn't that difficult to 'cut out the middle man' and measure the meter's pulses just with a photo transistor and the arduino.

I've been doing it for years. I rapidly tired of the 'educated guess' you get from CTs.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Tue Mar 24, 2015 1:38 pm

If my meter was inside, I would do that in a heartbeat. As it is, my meter is outside, exposed to the weather with no particularly easy way to get a low voltage wire inside. So, I'd need to use RF for communication either way. The Blueline/Black&Decker meter provides that information for a pretty reasonable price (historically). If I were looking at the current retail price, I'd look elsewhere though the wifi bridge might make connecting things quicker (but at a premium).

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: Energy monitoring

Tue Mar 24, 2015 3:39 pm

My gas meter is outside. I have a sensor on it connected to a panStamp (http://panstamp.com), pulse count is sent via wireless to my monitoring system indoors

bkenobi
Posts: 65
Joined: Sat Jun 21, 2014 4:55 pm

Re: Energy monitoring

Tue Mar 24, 2015 6:22 pm

Any pictures of the installation? I'm considering building something that can read magnetic field to use with my water meter. It's outside (actually underground) and would need to send a signal around 200 feet (60 yards). I assumed this wouldn't be possible with 433MHz so was planning on that being a down the road type project. I also plan on implementing a weather station and was currently looking at a premade 433MHz model. But, I suppose if I constructed based off something like the panstamp, I could avoid worrying about how others encoded and just worry about the actual data.

I'm still planning on moving forward with the Blueline meter reader at this time as I already have all the hardware and just need to figure out the software. But, I appreciate the other options as a backup if this approach doesn't pan out.

Return to “General discussion”