|Number of watchers on Github||47|
|Number of open issues||0|
|Open pull requests||0+|
|Closed pull requests||0+|
|Last commit||over 3 years ago|
|Repo Created||over 3 years ago|
|Repo Last Updated||11 months ago|
|Organization / Author||hwstar|
|Do you use HW-AC-Emeter? Leave a review!|
|View HW-AC-Emeter activity|
|View on github|
|Fresh, new opensource launches 🚀🚀🚀|
Trendy new open source projects in your inbox! View examples
This is the hardware implementation for my Atmel 90E24 power line monitor project. The Atmel 90E24 is a complete energy management solution on a chip. It allows voltage, current, true power, apparent power, reactive power, power factor, phase angle, and line frequency to be accurately measured. Additionally it can measure energy and with firmware, you can convert the energy pulses into kilowatt hours.
This board contains an ESP12 module, and an Atmel 90E24 Energy monitor chip. The board can be powered from any floating voltage source from 5V to 12V. You can optionally stuff an ESP8266 or an 8 pin connector for use with an AVR (Arduino board) or other microprocessor which has 3 free GPIO pins. The board partially shown on the far right is used to isolate the serial data signals from the ESP8266 from mains potential to protect your computer (see NB below). I have a separate project on Github for the isolated USB serial port
The board is inserted into a the live (phase) and neutral leads going to a a load which runs on mains voltages.
There is a 1 milliohm current shunt on the live side of the connections. This allows up to 24 amps to be measured.
NB: See the disclaimer below. This project is not for beginners. THE LOGIC GROUND FOR THE ATMEL 90E24 IS CONNECTED DIRECTLY TO THE AC LIVE LEAD. This means you must heed the following warnings:
If you want to use test equipment on this project, an isolation transformer with floating live and neutral leads is ABSOLUTELY REQUIRED if you want to keep your scope or other grounded test equipment from being BLOWN UP.
The SPI signals going to your microprocessor are not isolated from mains so your whole system will be at line potential. Hooking these up to something which is not floating WILL cause everything connected to be DESTROYED.
The serial data signals on the ESP8266 version are also not isolated and are at line potential. It is absolutely required that you use an isolated USB serial interface to prevent your computer from being BLOWN UP.
The power supply for Atmel 90E24 must be floating. Do not use your lab power supply or any other power supply which is not floating. Use an ungrounded 5 volt wall wart for testing.
This board was designed using KICAD.
This is the challenging part. I took some shortcuts and cut some corners. Read the 90E24 data sheet about how to go about this correctly. You need to have some way of presenting known AC loads to the unit, and correlating the results seen in the registers. I used a 60 watt bulb as a resistive load. This is really far from ideal as your wall socket mains voltage will vary enough to make the effort challenging and error-prone. If you have access to a stable AC power source (K$) and precision resistive and reactive AC loads (K$), then the calibration will be much easier. The firmware will save calibration values to non volatile memory.
Here is my procedure for the ESP8266 version (which can probably be improved)
XXXX} Where XXXX is a 4 digit hex number. Read back voltage values using the query command, and adjust Ugain until you achieve reasonable correlation. It helps to do this when your mains voltage is the most stable (Early in the morning). The Ugain calibration values on I saw were between 0x6410 and 0x6460
resetkwh}. Arm a stopwatch. Turn on the load and start the stopwatch simultaneously. Run for 6 minutes, and turn off the load. Note the kWh returned with a query command. This will be 1/10 of the desired value. If it is off, adjust the value in the Lgain register at address 0x23, reset the kwh accumulator, and repeat until correlation is acheived. The values I saw were between 0xF200 and 0xF300.
Note that this procedure does not encompass using small power mode as recommended in the datasheet.
There are 2 registers used for adjusting the reactive measurements. Lphi (0x24) which adjusts the phase angle and power factor, and QoffsetL (0x38) which adjusts reactive power (Qmean) offset. Once the calibration procedure above is completed, adjust Lphi to get the power factor to match a calibrated meter.
5cm x 10cm
Creative Commons Attribution Share-Alike license. (CC-BY-SA)
Build and use at your own risk. This board uses potentially lethal mains voltages.
I will not be responsible for any damages including but not limited to: errors or omissions, loss of life, or property damage. You have been warned.