as it is programmed currently the kit will send logging items and error messages as needed via the arduino println command. This should be easy to parse out and display as needed.

If the string that you parse out contains an equals sign then it is a value assignment. The value assignments will look like:





After it sends a packet of those values it will accumulate data for 5 seconds, upon receiving one more pulse after the 5 seconds have elapsed it will send another packet of those data lines. So the interval will never be less than 5 seconds and will be more than 5 seconds by the time to receive the next pulse from the meter.

3 seconds after powerup, in order to give the xBee some time to find the network, you will receive the message “XTension Smart Meter Reader version 2.0 Startup.”

Then the device then sends the message “scan for moving average value…” and goes into a scan mode where it is reading the levels coming from the sensor. Here it averages and accumulates the noisy analog values and figures out a good conversion level for assuming a high level vs a low level. This average and accumulator are maintained regularly and will re-adjust as ambient light changes. A single fixed value for deciding on/off could only be used if the sensor were in a dark room or completely covered. The upshot of this is a good pulse reading in widely varying ambient light levels and less of a need to cover the meter, the downside is that there is more processing going on while sampling that make the instantaneous power usage level less accurate. Just counting pulses though is very accurate. So the power used count will be very accurate.

Once the scan is complete it will send a “FIRSTPULSE” message to let you know that it’s now calibrated and working.

If a pulse is sensed at a very high level, one that would assume a usage above 150 amps in the current version of the software, you’ll get an “out of band pulses” message and a count of how many it received before it calmed back down. If you’re seeing a lot of these messages then you need to re-align the sensor, shade the meter or verify that the phototransistor was connected properly.

The sensor board will accept 3 different command characters. The commands are just single characters send to it.

Ping: if you send an “I” the board will respond with a “PING”

Reset: if you send an “R” it will reset the watt hour accumulator counter. Send this every night just before midnight to start over for the next day.

Rescan: if you send an “S” it will force the board to go rescan the analog value accumulator to recalculate the on/off point for received pulses. You shouldn’t have to do this as it will adjust over time, but if you significantly changed the setup or are getting garbage data still after fixing the attachment of the scanner this will force it to catch up more quickly.

If you wish to use an alternative method to get the data into XTension rather than an xBee radio the 5v TTL level serial is brought out to clearly labeled pads on the board. The baud rate is 57600.

The rest of the pins from the xBee are brought out to pads as well. All of them except the serial data lines are available for other data collection or monitoring or control tasks. For example use them to get garage door status into XTension or read the outside temperature.

If you wish to reprogram the atmega you’ll need a 5v TTL FTDI cable. In the Arduino IDE set the board type to “Arduino Duemilanove w/ATmega328” and be sure to remove the xBee radio before programming or it will cause the upload to fail.

kits/meterreader/details.txt · Last modified: 2015/05/08 12:43 by James Sentman
CC Attribution-No Derivative Works 3.0 Unported Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0