A NodeMCU shield to measure Real Power by sampling Voltage and Current from the mains. The current is sampled through a clip-on current transducer and the voltage is sampled through an isolation transformer. The voltage sampling circuitry is also used to power the system.
I wanted to have a custom wifi connected solution to sample my energy usage without the need for an extra microcontroller. I looked at existing Arduino + nRF/RFM based solutions. While they had lower power usage and could run off batteries they needed a custom base station for web connectivity.
NodeMCU provides both the microcontroller and wifi functionality. The shortage of ADC channels on the ESP8266 is circumvented by the use of the ADS1115. No extra power supply is needed since the AC waveform used for sampling is rectified and used to power the system. Once installed the system will run until it breaks.
This project runs Arduino based code to upload data every 20s to Thingspeak.
The final assembled system is now complete and available on Tindie.
ESP8266 USB enabled dev board
16bit D/S ADC
XP Power 5V
DC-DC Buck converter high efficiency
This basic version is for
apparent power only. To keep component count low and the circuit as
simple as possible the ADS1115 is used in differential mode eliminating
the need for bias resistors. The hard part is getting a licensed
electrician to wire up the clamp on current sensor to the main wire
coming into the premises. Since we have only 1 channel we are going to
monitor overall power rather than power per circuit. Follow the Fritzing
diagram below to wire up the prototype on a breadboard. Powering the
NodeMCU near the switchboard might be an issue as well, so I installed a
DIN rail power socket, this will come in handy for real power
measurement later on.
Programming the NodeMCU
chose to use the Arduino IDE to program the NodeMCU due to the easy
availability of relevant libraries and my personal familiarity with the
platform. You can get started quite easily using the latest incarnation
of the Arduino IDE and the instructions here. The code running on it for basic apparent power is available here.