Electric imp Watt Meter

This project is a power meter based on the ADE7953 ic. It has origins back to the electric imp Becky reference design.

I have documented everything here

Watt meter project page

Warning: Dangerous voltages are present in this project. The design is intended as a reference and starting point for those experienced and knowledgable about power electronics. I am not a professional electrical engineer and the meter is not tested against safety regulations.

I know that others have put their projects on Instructables but this is not a good project for that site. I would not expect another person to build exactly what I have built. I only hope someone might find a use for some part of the project some day.

Some main features and notes

  • The documentation includes information on how to calibrate the meter and a google doc to help with this, some bits about the soldering of the QFN chip, most of the BOM, design files in Eagle and more examples of things I have measured.

  • Peter of electric imp helped make a really fast loop for reading the waveform register using SPI. he achieved really good results as you can see in the image above.

  • the waveform is passed from the device to the agent as a blob. The agent builds this out into JSON for passing to Highcharts. the responsiveness is quite good. This is not a function I call often because I don’t want to be greedy with the data.

  • the imp002 module and ADE7953 are connected in a way that SPI or i2c can be used without any hardware change - it is just software setup. It may be a good example for someone looking into this kind of communication. The code for both protocols was left in the device but only the SPI communication is called.

  • there is some code in the agent for logging to Tempo-db.com. It can be stripped off and everything else will work just fine.

  • There is some code in the agent also for logging with PHP to your own web hosting if you have it. Again, this can be stripped out if you favor something like Xively.

  • the work is licensed for “Creative Commons Attribution-ShareAlike 4.0 International License”. I hope this is the right thing. It is my first experience doing this.

  • iconj.com was used to host the favicon icon. I don’t know a lot about this but it seems to work

  • I attempted to clean the code but of course this can go on forever. For the most part anything that is commented-out is just log messages.

I would really like to have constructive criticism if anyone notices anything and can take the time to send a note. That said, the meter seems to be performing nicely so far - it is at least the 4th revision since I started tinkering with power measurement.

Mark

Well done, this is fascinating. I had considered a similar project, but didn’t progress it because I was concerned that the imp wouldn’t be responsive enough. I am interested in applications that continuously sample values (either direct with ADCs or through an IC), but figured that is would not be feasible on an imp until preemptive threading is available.

Thanks!

Well most of the time the device is only sending data every 90 seconds.

When I want to have a close look at the characteristics of the load, I hit that button on the Web app. It cancels the pending wakeup and then proceeds with the 2 sec trend or the 50 ms ‘snapshot’. Then it re - starts the slow reporting.

Update

have a final design, whew! Looking back my old designs are a bit embarrassing to see but that cannot be helped. This is not my profession it is my personal project for learning.

The updated design has the blink-up components on the board and what I think is a decent design for mechanical assembly that does not involve too much manual labor. It is a professional case and power socket. I even simplified the wiring by purchasing pre-terminated wires from McMaster-Carr. The hardest part is soldering the earth ground lead.

Here is a view showing the main blocks.

The board with the plugpack case

Additional documentation at this tumblr page

This page shows some of how I do the calibration, though it is a bit outdated compared to the exact method I currently use. It is so hard to keep up the documentation as this is just hobby work.

Calibrations

My intention is to keep the full documentation published in case anyone wishes to derive from this work. I have the BOM, 99% there, schematics and board layout, etc.

Very happy to take questions or critiques.

One of the things I am always looking at is how to get BlinkUp through the enclosure. Maybe mount side mount components on the board edge and cut slots or place short light pipes? Looks really nice!

thanks for the note, jwehr. You noticed that the blink-up and status LED are not visible/usable outside the enclosure. I took a shortcut here since I only designed this for a single user.

For the LED I like your idea to put an LED on the side of the board. Cutting a notch in the plastic where the two halves come together would not be very hard to do. Accomplishing blink-up through the side would be a little harder to do but possible. Both improvements would require slight changes to the board layout.

A big issue here is safety. In my preferred embodiment I wire this meter as high-side sensing. That causes virtually the entire board to be hot with respect to earth. In such a design it is best to leave this case totally closed. I can power the pcb from a lab power supply to accomplish the blink-up and avoid having any high voltage inside. Then I close the case and live life without the status led.

After initial blink-up the device code will switch between a list of known wifi networks. If I am out of range of the pre-programmed networks then I temporarily turn on the wifi hotspot on my phone to gain control and then shoot new code to the device with a new ssid and password for the new location. This can also be done in advance if you know this information.