irmetermon Code
irmetermon now hosted at https://github.com/foxharp/irmetermon
Status: Beta
Brought to you by:
pgf
File | Date | Author | Commit |
---|---|---|---|
avr | 2012-10-16 |
![]() |
[4caf60] switch from sputstring/sputchar/sgetchar to put... |
blog | 2012-06-06 |
![]() |
[70210f] revised for republishing. grrrrr. |
doc | 2011-05-15 |
![]() |
[8419e4] don't bother doing averaging to create the watt... |
host | 2012-09-25 |
![]() |
[4e60a7] fix formatting |
plot | 2012-09-25 |
![]() |
[c753af] switch calculating plot-based minima to daily m... |
AAA_rehosted_at_github | 2013-04-27 |
![]() |
[8ed1b8] irmetermon now hosted at https://github.com/fox... |
Makefile | 2011-05-11 |
![]() |
[87f05e] add diff_install target |
README | 2013-04-27 |
![]() |
[1a07eb] irmetermon now hosted at https://github.com/fox... |
irmetermon now hosted at https://github.com/foxharp/irmetermon irmetermon -- Paul Fox, April 2011 Many modern electric meters deployed in the US now have wireless connectivity to enable the electric utility to read them from a vehicle in the street, rather than requiring someone to approach each meter physically. While in principle one might be able to get access to the meter's data via the electric utility's radio interface, a) the equipment would be expensive, and b) the data stream is likely (hopefully!) encrypted. Whether for testing convenience, or required for calibration purposes, these meters also all seem to be equipped with an infrared LED that emits one pulse for every watt-hour consumed. (Think of this pulse as the modern equivalent of the spinning disk that existed in older meters.) Rather than trying to use the radio interface, it's far, far, easier to simply watch for pulses of the little IR led. This project does just that. I've played with two circuits for detecting the IR pulses using an IR phototransistor. The simple schematics appear in the doc subdirectory (schematic.breakdetect and schematic.adc). There's also a screen grab of a scope trace of the IR pulse in doc/irpulse.png. One circuit, which interfaces directly to a serial port, is quite simple, and the software to gather the input pulses equally trivial -- the software looks for ANSI "break" conditions on the serial port, which will occur once per pulse. (Using a unix tty driver, "break" conditions can be made to appear as if a NULL character was received on the port.) Unfortunately, I wasn't able to make that trivial circuit work across varying ambient light levels. I'd be pleased if someone could make this scheme work -- the absence of a microcontroller makes this method much simpler, and therefore more accessible to more people. The other (more successful) circuit uses an Atmel AVR micro to monitor the phototransistor's output, and does edge detection in software to detect the pulses. This makes it easy to ignore changes in ambient light. Again, a serial interface is used, though in this case actual ASCII messages carry information about the the pulses. The host side software in either case logs the number of pulses (each representing a watt-hour consumed) per minute. Charting software (using gnuplot) makes those results visible on a webpage. The host s/w is split in two: read_ir.c (or read_ir_breakdetect.c for the simpler circuit) reads data from the serial port, timestamps it, and forwards it across a pipe to ir_meterlog.c, which does the logging. Daily logs are kept on both a 1 minute and 10 minute basis. (Disk is cheap, and while 1 minute logs are very interesting on a daily basis, it probably makes more sense to keep 10 minute logs long-term.) In addition, a simple file is continuously maintained which records the current power consumption, based on the timing of the most recent two pulses. There are more detailed construction and operation notes in the doc directory in "Installation". paul ---------- Thanks where thanks is due -- I was inspired to tackle this by some earlier investigation into the IR LED by "Dave K", on his "Tech Blog": http://davestech.blogspot.com/2008/02/itron-remote-read-electric-meter.html as well as by "blalor" who posted some scope trace pictures: http://www.flickr.com/photos/blalor/3876765214/in/photostream/