Author Topic: open source power meter  (Read 6324 times)

0 Members and 1 Guest are viewing this topic.

Offline NiHaoMikeTopic starter

  • Super Contributor
  • ***
  • Posts: 9154
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
open source power meter
« on: July 24, 2010, 01:10:54 am »
For those who have used the Kill-a-Watt power meter before, it is a surprisingly good device (especially for $20!), but it has several flaws:
* It only works on 120V AC and up to 15A.
* Resolution is really poor at the low end, greatly limiting the use of the device for measuring standby losses.
* Only one measurement can be viewed at a time.
* It blocks the other outlet. (For those outside the US, US power outlets are almost always pairs.)
* The lack of backlighting makes it difficult to read in certain situations.
* Accumulated energy measurement is lost if there is a power outage or the unit is unplugged. Additionally, unplugging it is the only way to intentionally reset the energy measurement - a real problem if the device you're measuring is to remain on.
* No wireless capability. There is a kit (Tweet-a-Watt) to add it, but it's expensive.
* It will not measure reverse power flow, making it useless where power flow could be in either direction. Grid tie inverters and induction motors operating as regenerative brakes, for instance.

I have taken mine apart, and it uses a simple analog front end connected to some sort of microcontroller. It's exactly what I expected for a cheap device. And easy to build your own.

So let's start the design:
* The fundamental frequency, for AC, is either 50Hz or 60Hz. That translates into a minimum analog bandwidth of 500Hz or 600Hz (to capture harmonics) and a minimum sample rate of 5kHz or 6kHz, not very difficult. For DC, it would only need to sample a few times a second.
* 1% or so accuracy in order to keep costs low. That is particularly important for low cost wireless sensors. The standalone bench version could have somewhat higher accuracy.
* To accommodate the wide range of current measurement, it will use a switchable current shunt amplifier. Possible implementation could be to use two opamps set to different gains, and use a multiplexer to switch between them.
* Low cost microcontroller with required A/Ds integrated, probably would also have the required multiplexer integrated. Some TI MSPs even have wireless integrated, but those are surface mount.
* Capacitive power supply for low cost AC versions, just like the Kill-a-Watt. Small switcher for other AC versions and some DC versions, linear regulator for very low voltage DC.
* Wireless versions should use an open protocol and be able to share a channel.

And as for possible versions:
* Low voltage DC with small 7 segment or text LCD, for alternative energy and battery operated circuits. Good starting point as it is low voltage and simple.
* 120V or 240V AC, 15A wireless sensor.
* 120V or 240V AC, 15A bench unit, with graphic LCD and RS-232.
* Split 240V AC, Hall effect current sensing for whole house monitoring, intended for permanent install in a breaker box.
* High voltage DC, Hall effect current sensing or high current shunt for electric vehicles and large alternative energy applications.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline NiHaoMikeTopic starter

  • Super Contributor
  • ***
  • Posts: 9154
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: open source power meter
« Reply #1 on: July 26, 2010, 04:29:33 am »
http://enerjar.net/
That's similar to what I have in mind, but with a more flexible design.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: open source power meter
« Reply #2 on: July 26, 2010, 02:44:14 pm »
Once by chance I found  this chip..
http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en520376
I never used it, but I think that if they've done a chip just for that, it could be a good thing to take a look, perhaps they have already solved some precision issues...
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline NiHaoMikeTopic starter

  • Super Contributor
  • ***
  • Posts: 9154
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: open source power meter
« Reply #3 on: July 26, 2010, 05:32:22 pm »
That chip would probably be a great choice for a bench meter or whole house meter where accuracy is important, but not so much for a simple wireless sensor. You'll still need a microcontroller to operate the display or wireless interface.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline TheWelly888

  • Frequent Contributor
  • **
  • Posts: 344
  • Country: gb
Re: open source power meter
« Reply #4 on: July 26, 2010, 05:56:11 pm »
Is there really nothing commercially available that meets most of the specs given?
You can do anything with the right attitude and a hammer.
 

Offline NiHaoMikeTopic starter

  • Super Contributor
  • ***
  • Posts: 9154
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: open source power meter
« Reply #5 on: July 26, 2010, 07:39:04 pm »
Nothing I'm aware of that is reasonably priced. I'm looking for something like $5-10 per wireless sensor and maybe $20-30 for a whole house meter.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline saturation

  • Super Contributor
  • ***
  • Posts: 4787
  • Country: us
  • Doveryai, no proveryai
    • NIST
Re: open source power meter
« Reply #6 on: July 27, 2010, 01:18:44 am »
Hello NiHao,

Some ways I've overcome your comments, only those in red I've been able to do something about:

Below it minimum resolution, if there is actually a draw, leaving the unit on for many hours will result in a cumulative wattage/hours that you can use to calculate its actual kwh

The no-input power consumption of the Killawatt itself in negligible and can be ignored,  I reconfirmed it last night, its 0.01kw/7.75h

Use an extension cord to unblock the outlet and make for better viewing angle, so backlight isn't strictly necessary

The updated version has a memory so it retains the last wattage before a power off; it needs to be purposefully zeroed to measure from zero

On you lead, I opened the unit.  Its a series resistor with the neutral lead, measuring I= V/R then calculating power as VI=W as AC rms. 


For those who have used the Kill-a-Watt power meter before, it is a surprisingly good device (especially for $20!), but it has several flaws:
* It only works on 120V AC and up to 15A.
* Resolution is really poor at the low end, greatly limiting the use of the device for measuring standby losses.
* Only one measurement can be viewed at a time.
* It blocks the other outlet. (For those outside the US, US power outlets are almost always pairs.)
* The lack of backlighting makes it difficult to read in certain situations.
* Accumulated energy measurement is lost if there is a power outage or the unit is unplugged. Additionally, unplugging it is the only way to intentionally reset the energy measurement - a real problem if the device you're measuring is to remain on.
*No wireless capability. There is a kit (Tweet-a-Watt) to add it, but it's expensive.
* It will not measure reverse power flow, making it useless where power flow could be in either direction. Grid tie inverters and induction motors operating as regenerative brakes, for instance.

I have taken mine apart, and it uses a simple analog front end connected to some sort of microcontroller. It's exactly what I expected for a cheap device. And easy to build your own.

So let's start the design:
* The fundamental frequency, for AC, is either 50Hz or 60Hz. That translates into a minimum analog bandwidth of 500Hz or 600Hz (to capture harmonics) and a minimum sample rate of 5kHz or 6kHz, not very difficult. For DC, it would only need to sample a few times a second.
* 1% or so accuracy in order to keep costs low. That is particularly important for low cost wireless sensors. The standalone bench version could have somewhat higher accuracy.
* To accommodate the wide range of current measurement, it will use a switchable current shunt amplifier. Possible implementation could be to use two opamps set to different gains, and use a multiplexer to switch between them.
* Low cost microcontroller with required A/Ds integrated, probably would also have the required multiplexer integrated. Some TI MSPs even have wireless integrated, but those are surface mount.
* Capacitive power supply for low cost AC versions, just like the Kill-a-Watt. Small switcher for other AC versions and some DC versions, linear regulator for very low voltage DC.
* Wireless versions should use an open protocol and be able to share a channel.

And as for possible versions:
* Low voltage DC with small 7 segment or text LCD, for alternative energy and battery operated circuits. Good starting point as it is low voltage and simple.
* 120V or 240V AC, 15A wireless sensor.
* 120V or 240V AC, 15A bench unit, with graphic LCD and RS-232.
* Split 240V AC, Hall effect current sensing for whole house monitoring, intended for permanent install in a breaker box.
* High voltage DC, Hall effect current sensing or high current shunt for electric vehicles and large alternative energy applications.
« Last Edit: July 27, 2010, 11:29:02 am by saturation »
Best Wishes,

 Saturation
 

Offline cksa

  • Regular Contributor
  • *
  • Posts: 69
Re: open source power meter
« Reply #7 on: July 31, 2010, 01:21:02 am »
Once by chance I found  this chip..
http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en520376
I never used it, but I think that if they've done a chip just for that, it could be a good thing to take a look, perhaps they have already solved some precision issues...


I've used that chip. Quite easy to use. Integrated PGA for the current channel makes ranging easy. Quite cheap too (from farnell).
 

Offline Polossatik

  • Frequent Contributor
  • **
  • Posts: 295
  • Country: be
Re: open source power meter
« Reply #8 on: August 12, 2010, 05:06:46 pm »
I'm not sure about your price point with a wireless interface, if you want a decent range it's going to be far more expensive (zigbee for example is $$$) and then I'm not talking yet about stuff like all the blocking you have in non-wooden houses :)

I think you might want to look for some form of PLC , but that of course needs a receiver that can handle multiple fazes for non-mono faze installations and a point where this can be installed (means in the actual mains switchboard), adding to the complexity of installation.
Real Circuit design time in minutes= (2 + Nscopes) Testim + (40 +120 Kbrewski) Nfriends

Testim = estimated time in minutes Nscopes= number of oscilloscopes present Kbrewski = linear approx of the nonlinear beer effect Nfriends = number of circuit design friends present
 

Offline NiHaoMikeTopic starter

  • Super Contributor
  • ***
  • Posts: 9154
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: open source power meter
« Reply #9 on: August 12, 2010, 07:12:38 pm »
The wireless sensors are going to be used in the same room or nearby rooms, so 50 feet range would be enough. The whole house sensor will need a longer range, but it also has a larger budget.

One very simple and cheap method is to take a cheap FM transmitter and send the current (lowpassed to 1kHz or so) directly and the voltage on a subcarrier at 10kHz or so. The main problem is that analog transmission would result in low accuracy.

I'm thinking about having the microcontroller operate a cheap and simple FSK transmitter in the 900MHz ISM band, using Reed-Solomon ECC to reduce dropped packets.

As for PLC, I once bought 4 PLC transcievers for $1 each at a garage sale, originally intended to extend a phone line. Since I don't have an old style phone line anymore, I used a bench power supply and a resistor to simulate a line for testing. My next step was to modify the transmitter to operate as a VoIP endpoint so I can use my old analog phones for VoIP, but maybe it would be better to modify them for low speed data transmission?
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline TeraHz

  • Contributor
  • Posts: 37
Re: open source power meter
« Reply #10 on: May 08, 2011, 11:05:10 pm »
NiHaoMike, how is the project going? I'd like to put together something similar and would rather not reinvent the wheel if you have something complete.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf