Split Single-phase Energy Meter
The CircuitSetup ATM90E32 Split Single Phase Energy Meter can monitor the energy usage in your entire home in real time. It can easily be hooked up to an ESP8266 or ESP32 to wirelessly transmit energy usage data into a program like EmonCMS or ESPHome/Home Assistant. It can also be used to monitor solar power generation to keep track of how much power you are making.
The Energy Meter kit available on CrowdSupply:
If you purchased an energy meter kit EmonESP is pre-loaded onto the included ESP32. You can skip this section and go to Setting up EmonCMS
There are a few options for doing this: - You can use the EmonCMS.org service, which costs roughly $15 a year with the data that we send from the energy meter (you don't have to send all of the data) - Install on a computer within your network. To do this, you will need to have apache/php/mysql installed) This can also be done with a Raspberry Pi. - Install on a remote web server. There are some very cheap ways this can be done if you're familiar with setting up web applications.
If you install EmonCMS on a remote web server, or if your home network has a public facing port, this will make it possible to see data on the EmonCMS app (Android or iOS) when your phone is outside of your network.
For all but the EmonCMS.org service, (currently for EmonCMS.org these feeds and inputs have to be setup manually) you can automatically setup the energy meter device in EmonCMS: 1. Install the device plugin - this is now included in the default configuration 2. Upload this file to the Modules > device > data > CircuitSetup folder. 3. Once the folder is created and json file is uploaded, go to Setup (top left) > Device Setup > New Device (lower right) 4. Click on CircuitSetup in the left menu You will see this: 5. Fill in the Name and Location and click save. 6. You will then see the fields and inputs - click Initialize: 7. You should now see this under Feeds: 8. And this under Inputs:
If you would like to use something other than EmonCMS, you can do that too! Make sure the ATM90E32 library is included in the sketch. See the examples folder for examples of how things could be done using JSON or MQTT. Users have already setup feeds to Home Assistant, Influxdb, and Graphina.
If you purchased an energy meter kit you can skip this section and go to Installing the Energy Meter
Connect the pins on the Energy Monitor to your MCU. If you have the adapter board, everything should already be connected properly. The following are the default for each, but they can be changed in software if you are using these pins for something else.
For the ESP32: * 5 - CS * 18 - CLK * 19 - MISO * 23 - MOSI
For the ESP8266: * D8/16 - CS * D5/14 - CLK * D6/12 - MISO * D7/13 - MOSI
Don't forget to hook up the 3V3 and GND pins!
The energy meter can supply up to 500mA of 3.3v power to your controller, so no other external power source should be needed. Some ESP32 dev boards may use more than 500mA when trying to initially connect to WiFi. If this is the case, you may not be able to connect to WiFi. If this happens, we recommend using another power source for the ESP32 - either a 5v DC adapter or a USB phone charger that outputs at least 500mA. It is not recommended to leave USB power plugged into an ESP at the same time as the energy meter's power 3V3 output. This can damage components.
Other pins on your controller can be connected to the WARN and IRQ outputs, but they are not yet implemented in the default software.
More than one meter can be hooked up to a single MCU to monitor a solar grid, for example.
To do this: - Connect all CLK, MISO, and MOSI pins together - Connect the GND and 3V3 from one meter to the MCU - Connect the CS pin of one energy meter to an open GPIO on your MCU, and the CS pin on the second energy meter to another open GPIO on your MCU. These pins must be set in the software. See the examples folder for the example with more than one energy meter. - If you would like to monitor voltage from two sources, you will need two AC transformers. If only one voltage, you can split the output of 1 AC transformer using a 2.5mm DC jack Y-cable.
You can also purchase a solar adapter here.
To install the current transformers to measure current, your breaker panel must be opened to clamp them around your mains wires. High voltage AC power is VERY dangerous! If you are not comfortable working around AC voltage, we strongly encourage you to hire a qualified electrician.
The Split-Single Phase Energy Meter should be installed by a qualified professional, and in compliance with all local electrical codes that apply. CircuitSetup, and its parent company Sugarman Studios, LLC, cannot be held liable for damages or injury incurred by incorrectly installing the Split-Single Phase Energy Meter.
The Split Single Phase Kit:
Take note of the side of the split phase that the breaker for the AC transformer is on. This is important for connecting the CTs in the correct direction (see below section) 3. If you wish to read the voltage from both sides of your panel : - Hook up a second AC transformer to a single pole breaker, or a second outlet, that is wired to the opposite phase of the first AC transformer. If the breaker for the first outlet is on the left of your panel, you will need to wire the second AC transformer or outlet to a breaker on the right of the panel (single split phase breaker panels) - Sever jumper JP3 on the back of the energy meter before hooking up the second AC transformer. - Solder 2 pin headers, or a female pigtail that matches your second AC transformer plug, to the left of the main AC power plug labeled GND and VC+. - Hook up the second AC transformer to the “GND” (neutral) and “VC+” pins. You want the wire that is intended to be neutral for the AC transformer to go on the GND terminal of the meter. This wire usually has a white stripe on it. If the wires are swapped the 2 AC transformers will be in phase, and your current readings will output as negative.
Before connecting the current transformers around your mains wires, plug them into the energy meter.
If your current transformers (CTs) have 3.5mm phono connectors, you hopefully have the version of the Energy Meter with these connections (v1.3+ has footprints for both). If you have the screw connectors, the phono connectors will have to be cut off. There should only be two wires regardless. For the screw connector version, be careful to connect the positive to the correct terminal. If these are reversed, things will not be damaged, but the reading will read negative.
If your current transformers have a built-in burden resistor, sever the jumpers on the back of the board to disable the 12ohm burden resistors. Alternatively, if you are reading smaller loads and would like more accurate readings, you can insert your own higher value burden resister across the positive and negative screw terminals.
If you purchased an energy meter kit with the black SCT016 current transformers, or have the blue SCT-013-000, these do not have a built-in burden resistor, but have a TVS diode instead.
The solar kit comes with 2 meters, 4 current transformers, and optionally, 2 AC transformers.
The 1st AC transformer, L1, should be plugged into an outlet the same way as noted above in the "Plug in the AC Transformer" section
The 2nd AC transformer, L2, for the solar kit should be plugged into an outlet that is on the opposite phase than the first AC transformer. If you do not have an outlet, we recommend having a licensed electrician install one.
It is possible to power both energy meters with one AC transformer, you will just need a Y splitter. Close attention needs to be paid to the direction of the current transformers to properly measure the direction current is flowing.
The mains current transformers (CT1, CT2) should be connected the same way as noted above starting with section "Connect Current Transformers to the energy meter"
Current transformers to measure solar energy generation (SCT1, SCT2) should be connected to the wires coming into your panel from your solar inverter. This is usually a dual pole breaker with 2 hot wires (in the US). The arrows on the CTs should be opposite eachother, like with the mains CTs. The wire that is connected to the side of the panel that is the same as the solar AC transformer will point towards the panel. It may take some trial an error to get this correct.
Energy generated by solar, but not used by your house will register on the mains CTs as negative, since energy is flowing back to the grid. In EmonCMS this calculation is done automatically assuming you have set up the "Solar Kit" device.
If you purchased a kit that came with current transformers and an AC Transformer, you should not have to calibrate anything unless you want to. If you are providing your own AC Transformer, you will need to calibrate the voltage.
The default configuration of the Energy Meter software is set to use the SCT-016 120A/40mA current transformers, and the Jameco Reliapro 9v AC transformer. There are also values for 100A Magnalab, SCT-013 100A 50mV current transformers, and the 12v version of the AC transformer located in the energy_meter.h file, and in the EmonESP web interface. Simply change the values under CALIBRATION SETTINGS if you are using a 12v AC Transformer or the Magnalab current transformers. If you are using any of these you likely will not need to calibrate, but if you want to be sure your readings are the most accurate then calibration is recommended.
Alternatively, if you have equipment that can read active and reactive energy pulse outputs, CT1-CT4 pins can be used for this. It is recommended that these connections are opto-isolated to prevent interference.
New VoltageGain = (your voltage reading / energy monitor voltage reading) * VOLTAGE_GAIN
VOLTAGEGAIN is the value currently set for the voltage gain parameter in energymeter.h.
Test again after adjusting the value and re-uploading the sketch to your ESP. If it is still off, do the procedure again, but replace VOLTAGE_GAIN with the last value used.
If you are not located in the US and have 50hz power, change the Frequency value to 389
For calibrating CurrentGainCT1 & CurrentGainCT2:
New CurrentGainCT1 or CurrentGainCT2 = (your current reading / energy monitor current reading) * CURRENT_GAIN_CT#
CURRENTGAINCT# is the value currently set for the current gain parameter in energy_meter.h.
Test again after adjusting the value and re-uploading the sketch to your ESP. If it is still off, do this again, but replace the CURRENTGAINCT# with the last value used. It is possible that the two identical current sensors will have different CurrentGain numbers due to variances in manufacturing, but it shouldn't be drastic. Note that the positioning of the CT sensor on the hot wire can influence the current reading.
For more details, see the Calibration Procedure in the Microchip Application notes.
If you have an energy meter kit: - Check that the ESP32 is seated properly. Take it all the way out, then back in again to make sure. It should click into place. If you find you're only getting a signal when holding down the ESP32, you can try removing the black plastic around the base of the pins of the esp32, to push it down further. This is best accomplished with flush cutters. If you rather not do that, please contact us. - If you're getting all 0 readings from the meter, try the steps above. If that does not work, please contact us.
If you do not have a kit: - If you are getting all 65535 readings from the meter, then the connection from the ESP32 to the meter is not correct. Please check your wires.
One of your CT clamps is probably backwards - flip it around. If they are both oriented in the same direction, this will not happen.
Make sure that the ESP32 has a good WiFi signal. The RSSI (viewable in the EmonESP web interface) should be, at the least, -70db.
For the CircuitSetup version of EmonESP: - If the ESP32 loses the connection to the configured access point it will try 3 times over a 30 second period to reconnect. - If it cannot reconnect, it will go into SoftAP mode and broadcast a signal so it can be reconfigured via the web interface, if necessary. - If nothing happens after 5 minutes, it will try to reconnect to the configured access point again.
See the steps above for staying connected to WiFi. If that does not work, try one of the following: 1. Load the latest firmware via the EmonESP web interface. - Download the latest .bin file from the link above - Open http://EmonESP_IP/upload (6. Firmware) - Click "Choose File", select the .bin file, then "Update Firmware" - The file will upload to the ESP32, and it will reset - After about 20 seconds the upload page will reload - you can return to the main page to verify everything is working properly
To do this you'll have to reset EmonESP to default. This will erase any saved settings, like wifi configuration and connections.
Documentation license: CC BY 4.0