Wednesday, February 29, 2012

Metering The Smart Meter, part: the first

A subcontractor of the local electric company was banging around behind my house the other day installing a smart meter. Someday the electric company might produce a web page where I can go to look at my electric usage, but it seems that most or all of the models being rolled out in the US provide an IR led on them that pulses with each interval of electric usage. So you can count them in any given time period to measure usage and measure the time between them for an instantaneous load measurement. There are many ways to measure power load, XTension supports 2 different clamp on current meters that need to be installed inside your breaker panel but if you’re not comfortable working inside your panel or if you don’t wish to hire an electrician to do the work then you’re out of luck. As time goes on though these meters are being rolled out to practically everybody and DIY reading of these pulses doesn’t look like it’s going to be that bad.

This is just proof of concept that I know how to read them, not yet a finished project. Just flashing an LED on the sensor when I receive a pulse with an old Arduino and an IR remote receiver from SparkFun.com.



There are many other similar projects out there you can google for and some good arduino source code examples. Ultimately this will get connected to an xBee for data transmission up to XTension. The next step will be some kind of bracket/case to hold the sensor against the electric meter without looking too frightening to any meter reader that may be back out at any time in the future.

I’m pretty sure that someone will be back out, the meter isn’t really installed straight, I dont know why it should be bent up ever so slightly,but it doesn’t give me great confidence that the connections are solid inside.  I”m going to call the electric company and ask them to verify the install later on today as a matter of fact.

(part 2: making the sensor)

Friday, February 10, 2012

Wiznet Configuration Update

(Updated 6/10/12: see below)

While updating the MaxSonar driver in XTension to support connections to TCP/Serial adaptors I discovered an important error in the last version of the Wiznet Configurator for Macintosh. The documentation available on the web of the protocol for talking to these devices is actually incorrect in the settings for the client/mixed/server mode byte. If you’re thinking of working on one of these yourself you’ll want to know that the proper values are 0=client, 1=mixed and 2=server. The documentation shows server and mixed swapped which causes all the reconnection problems that some people have mentioned.

The download links to the updated versions are below.

Wiznet makes an excellent ethernet to serial board that is inexpensive and is fully supported by XTension unfortunately they never had a Mac version of their configuration utility that lets you give it an address and setup the serial port.

I noticed yesterday that they had published the specs for talking to the boards making it possible for me to throw a configuration utility for the Mac together. I could theoretically compile it for Linux and Windows too if anybody is interested let me know, I just dont have a machine handy for testing those targets so I haven't done so yet.

The program seems to work and implements all of the available fields though some of them appear to be different in the version of the firmware that I've got than what is documented. Indeed in the documentation even the length of the data packets is wrong so i'm not sure the things i haven't tested actually work.

To use it plugin a 5v power supply and ethernet to your wiznet board. It will assign itself an address or take one from your DHCP server depending on. To find it run the software and all wiznet boards found will be displayed. Double click one in the list to edit it.


To use one with XTension it needs a static IP address and be in Server mode. Then setup the serial port for whatever settings are needed for the particular device. This should work with CM11's and W800's and Weeder chains and just about every other device in XTension that supports a remote TCP connection instead of a local serial port.


I was unable to make the direct connection to the device work, so the configuration is returned via a UDP broadcast. What this will mean for having multiple devices on your local network I dont know yet, I only have the one but i've just ordered some more, and some with multiple ports to experiment with further.


This is released as freeware and AS IS. Let me know if it gives you any trouble and please feel free to make a small donation via paypal to james@sentman.com if it turns out to be useful to you.


(update: 2/8/11 added the linux compile. I haven't even tried to run it but it might help someone out, please let me know if anybody finds it useful)

(update: 2/10/12 now at version 1 because of fixes to server/client/mixed setting and the proper setting of the serial debug mode flag which is 1 for off and 0 for on, go figure)

(update: 6/10/12 new version fixes UDP/TCP setting bug please visit: here for new version)


wiznet devices can be purchased from Sparkfun as well as Saelig Electronics
.code { background:#f5f8fa; background-repeat:no-repeat; border: solid #5C7B90; border-width: 1px 1px 1px 20px; color: #000000; font: 13px 'Courier New', Courier, monospace; line-height: 16px; margin: 10px 0 10px 10px; max-height: 200px; min-height: 16px; overflow: auto; padding: 28px 10px 10px; width: 90%; } .code:hover { background-repeat:no-repeat; }