The story

I've bought the ENERGY CONTROL 3000 USB from conrad/voltcraft/ELV with the ES-2 sensor, hoping that that sensor would be able to sense the blinking led on my digital power meter. After more than an hour hacking and bricking the sensor, I've got my multimeter, and found out that the IR transistor that was used really only was sensitive to the IR spectrum. A red led was able to drop the voltage on the transistor from 4.65V down to 4.55V. A simple IR-gate from my IROBOT vacuumcleaner was able to drop the voltage down to 2V or so. So I was nowhere near having a good energy meter. Fed up with this I decided to do some old style badgering and hacking. I got out an old network camera that was able to deliver a multi-part jpeg stream.

The result was that the EC3000 USB from conrad and the weird unusable software that came with it was replaced with a C54NETCAM and a small shell script.

How it works

Basically a multipart jpeg is downloaded using netcat. After a while the netcat is killed, and replaced by a new netcat. The resulting file is about 2.2MB for a minute of downloading. While the new netcat is downloading, the old file is parsed with a small shell script, that splits the file into images, and per image determines if the led is on or not by using a simple C-program that averages the pixels. If it goes from off to on, it is seen as a pulse. These pulses are counted and kept for munin. Munin just registers the values of the counters. The stuff under GPL v2 or higher:
  • countpulses.sh: The shell script that counts pulses in a multipart recording.
  • testjpg.c: The program that averages pixels and returns 0 or 1 for on or off.
  • countthem: The cron job that is run every minute
  • parsemp.sh: Simple multipart unpacker test. Not needed, but handy.
  • stroom: Munin plugin to register power averages.
  • stroomtotaal: Munin plugin that basically is the total usage. Times a price equals the energy bill.

The Pics

munin average power usage graph munin total power usage graph
asus1.dc0-stroom-day.png asus1.dc0-stroomtotaal-day.png

4 frames in a row frame # ON
00000045.plaatje.jpg 45 no
00000046.plaatje.jpg 46 yes
00000047.plaatje.jpg 47 yes
00000048.plaatje.jpg 48 no

The next blink started at frame 118. With 20 frames per second that's about 20*3600/(118-46) = 1000W.

Conclusion: camera's are easy generic solutions.

Don't be afraid to take the camera solution. You really got instant and exact results with it. The procedure should be light enough to do it with a linux based router with usb connection and a webcam. My meter does a pulse per Wh, which boils down to about 3 pulses per second absolute max. If you have an old disc instead of a led, you can easily measure it by fixing the camera, and then define a hot-region, and average the region. If you have a disc, and solar panels (in which case the disc will turn backwards), it is easy to spot the direction by using to hot-regions that are slightly placed over eachother. Count when both regions are 1, and the region that's first 1 determines the direction.
Topic attachments
I Attachment Action Size Date Who Comment
jpgjpg 00000045.plaatje.jpg manage 1.9 K 23 Sep 2008 - 22:14 ArdVanBreemen  
jpgjpg 00000046.plaatje.jpg manage 1.6 K 23 Sep 2008 - 22:14 ArdVanBreemen  
jpgjpg 00000047.plaatje.jpg manage 2.2 K 23 Sep 2008 - 22:14 ArdVanBreemen  
jpgjpg 00000048.plaatje.jpg manage 1.8 K 23 Sep 2008 - 22:15 ArdVanBreemen  
pngpng asus1.dc0-stroom-day.png manage 30.2 K 23 Sep 2008 - 22:16 ArdVanBreemen Munin example power usage
pngpng asus1.dc0-stroomtotaal-day.png manage 24.6 K 23 Sep 2008 - 22:16 ArdVanBreemen Munin example total power usage
shsh countpulses.sh manage 1.5 K 23 Sep 2008 - 22:08 ArdVanBreemen The shell script that counts pulses in a multipart recording.
elseEXT countthem manage 0.3 K 23 Sep 2008 - 22:09 ArdVanBreemen The cron job that is run every minute
shsh parsemp.sh manage 0.5 K 23 Sep 2008 - 22:10 ArdVanBreemen Simple multipart unpacker test. Not needed, but handy.
elseEXT stroom manage 0.7 K 23 Sep 2008 - 22:11 ArdVanBreemen Munin plugin to register power averages.
elseEXT stroomtotaal manage 0.4 K 23 Sep 2008 - 22:12 ArdVanBreemen Munin plugin that basically is the total usage. Times a price equals the energy bill.
cc testjpg.c manage 11.4 K 23 Sep 2008 - 22:08 ArdVanBreemen The program that averages pixels and returns 0 or 1 for on or off.
Topic revision: r2 - 24 Sep 2008 - 09:19:16 - ArdVanBreemen
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback