Arduino Projects

# Arduino Home Energy Monitor using CT Clamp Current Sensor & ZMPT101B AC Voltage Sensor

## Arduino Home Energy Monitor:

Arduino Home Energy Monitor using CT Clamp Current Sensor & ZMPT101B AC Voltage Sensor- In this article, you will learn how to make Arduino Home Energy Monitor using CT Clamp Current Sensor, ZMPT101B AC voltage Sensor, and an SSD1306 I2C supported Oled display module. Instead of using the Arduino Nano you can also use Arduino Uno.

After calculating voltage, current, and power, you can easily calculate the units. You can calculate how much electricity you have used in a day or even in an entire month. When you have the values of voltage, current, and power, you can calculate anything by using the desired formula.

Anyway, in my case, I already have the main energy meter, which keeps track of the units. So, from here, I can calculate how much electricity I have used. You can see, this energy meter is installed outside the house. And when I am at home, I have no idea when and how much load is there, and most importantly, what the voltage is. Nowadays, the temperature here ranges from 44 degrees Celsius to 49 degrees Celsius. Due to this, the voltage often drops significantly. A few days ago, the voltage dropped below 100 volts, which caused the AC compressor to malfunction. Because I had no idea about the voltage.

So, what I want to say is that I am going to use this Arduino Home Energy Monitor for monitoring the voltage, current, and power. So, if in case there is a high load or low voltage, I can turn off sensitive loads.

During the practical demonstration, I am going to use an ampere meter for measuring the actual current and then I will compare it with the current value measured with my designed Arduino Home energy meter. And the same thing I am going to do for the AC Voltage. I will measure the voltage using this multimeter and then I will compare it with the voltage; measured with my designed Arduino Home Energy Monitor. This testing is important for several reasons because most of the time the measured values are different from the actual values. In such situations, we need to calibrate our sensors, which I will explain later in this video. So, without any further delay, let’s get started!!!

Arduino Nano USB-C Type (Recommended)

ZMPT101B AC voltage sensor

SSD1306 Oled display Module

CT Clamp Current Sensor

Other Tools and Components:

ESP32 WiFi + Bluetooth Module (Recommended)

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

## About the Current Sensor and Voltage Sensor:

You can see the CT Clamp Current Sensor and the ZMPT101B AC Voltage Sensor. If you want to know about their technical specifications and how to use these sensors individually, then you can read my getting started articles on the CT Clamp Current Sensor and ZMPT101B AC Voltage Sensor.

Gravity: Analog AC Current Sensor (20A)

When you want to measure the AC current, are you still having trouble cutting the wires, wiring, or soldering. Gravity: Analog AC Current Sensor comes to the rescue, eliminating the need to cut wires or reconnect circuits. Simply clamp the AC transformer probe on the AC line, and then plug the 3.5mm headphone jack into the signal conversion module to read the current AC current value. The analog output is designed to be compatible with 3V3/5V micro-controller. It can be conveniently used for AC current measurement to monitor AC motors, lighting equipment, air compressors, etc.

### Pin Description:

 LABEL NAME Function Description 1 – GND 2 + Power Input (3.3V-5.5V) 3 A Signal Output (0.2-2.8VDC) 4 Φ3.5mm 3P plug AC Transformer Input Signal

### FEATURES

• Non-contact measurement, high safety
• Multiple ranges for various measurement scenarios
• Compatible with 3V3/5V micro-controller

### APPLICATIONS

• AC motor automatic monitoring
• Lighting and electrical equipment measurement

### SPECIFICATION

AC Current Signal Conversion Module

• Input Voltage (VCC): 3.3V-5.5V
• Interface: Gravity Analog (PH2.0-3P，analog voltage output 0.2-2.8V DC)
• AC Voltage Input Range: 0-1V (AC RMS)
• Relative Error: ±4%
• Dimension: 32×27 mm /1.26×1.06 in
• Weight: 5g

Open Type AC Transformer Probe

• AC Current Range: 0-20A
• Signal Output (standard Φ3.5mm 3P plug): 0-1V AC voltage, linear corresponding range 0-20A
• Accuracy: ±1%
• Non-linearity: ≤±0.2%
• Frequency Range: 50Hz~1kHz
• Cable Length: 1m
• Working Temperature: -25 ℃~+70 ℃
• Opening Size: 13×13 mm / 0.51×0.51 in
• Weight: 50g

## ZMPT101B 230 volts AC Mains Voltage Sensor:

This module is based on a high precision ZMPT101B voltage Transformer. This module makes it easy to monitor AC mains voltage up to 250 volts. This module comes with Multi-turn trim pot which can be used for adjusting the Analog output.Using ZMPT101B  AC Voltage Sensor you can easily measure main voltage using Arduino or even Raspberry Pi (external ADC required).

### Features of ZMPT101B AC voltage sensor Module

1. Voltage upto 250 volts can be measured
2. Light weight with on-board micro-precision voltage transformer
3. High precision on-board op-amp circuit
4. Operating temperature: 40ºC ~ + 70ºC
5. Supply voltage 5 volts to 30 volts

### Advantages of ZMPT101B AC voltage sensor

1. Analog output corresponding quantity can be adjusted.
2. Pcb board size: 49.5 (mm) x19.4 (mm)
3. Good consistency, for voltage and power measurement
4. Very efficient and accuracy

## Arduino Home Energy Monitor, Circuit Diagram:

As usual, I am using my designed Arduino Nano and LoRa based development board, but you can also do the same exact connections on a breadboard. Forget about the relays, LoRa, and 5v Buzzer. Just concentrate on the connections; I am about to explain.

Connect the VCC and GND pins of the ZMPT AC voltage sensor to the Arduino 5V and GND. In my case I have connected the VCC wire to the Arduino Vin pin which is connected to the regulated 5v and 3A power supply. Connect the Out pin of the ZMPT voltage sensor to the Arduino Analog pin A0.

Connect the VCC and GND wires of the AC Current Sensor to the Arduino 5V and GND. But, in my case I have connected it to the external 5V and 3A power supply. Connect the output signal wire A to the Arduino Analog pin A1.

Connect the VCC and GND pins of the SSD1306 Oled display module to the Arduino 3.3V and GND pins. Connect the SCL and SDA pins to the Arduino Analog pins A5 and A4 respectively. A5 is the SCL and A4 is the SDA.

Or you can follow this circuit diagram if you want to use 7805 Voltage regulator.

You can read my article, on how to make yourself an Arduino development board. In that article, I have explained in detail why not to use 7805 voltage regulator.

You will also need to download the ZMPT101B library. Go to the Sketch menu > then to Include Library > and click on the Manage Libraries. Search for the ZMPT101B library and install it.

## Arduino Home Energy Monitor Programming:

The purpose of this code, is to measure the AC Voltage, Current, Power, and to print all these measured values on the Oled display module. I am not going to explain this code line by line, because I have already explained it in my previous getting started tutorials on the AC current Sensor and ZMPT AC Voltage sensor. I have just combined the two codes and that’s it. Now, let’s go ahead and start our practical demonstration.

## Altium Designer + Altium 365 + Octopart:

Get real-time component insights as you design with Octopart built into Altium 365. Octopart is the fastest search engine for electronic parts and gives you the most up-to-date part data like specs, datasheets, cad models, and how much the part costs at different amounts etc. Right in the design environment so you can focus on your designs. Start with Altium Designer and Activate Altium 365. Search for electronic parts on Octopart.

## Arduino Home Energy Monitor, Demonstration:

All the values are zero, because I have not yet connected the voltage and current sensors.

I connected the ZMPT101B voltage sensor to the AC voltage and the current sensor is not yet connected. So, that’s why the current value is zero, and also the power value is zero. You can see the actual AC voltage on the multimeter which fluctuates between 179 and 181 volts. And you can see the measured AC voltage which is a bit OFF. So, let’s go ahead and calibrate the AC voltage sensor.

You can use this potentiometer to fine tune the value. While calibrating the sensor make sure you don’t touch ac voltage wires or the contacts on the bottom side of the PCB. As it can be really dangerous.

The voltage sensor has been calibrated, and you can clearly see the measured voltage value is pretty close to the actual voltage. Now, let’s start with the Current Sensor.

Next, I am going to measure the current of a Bulb and let’s see if I am going to get the exact current value.

The measured current value fluctuates around 0.1 amps while the actual current value on the ampere meter fluctuates between 0.31 and 0.32A. The difference is high, so we need to calibrate the current sensor.

Unlike the ZMPT101B the CT Clamp Current sensor doesn’t have a potentiometer. So, we can’t do calibration on the sensor side. So, we will have to do it through the programming.

I have defined this correctionfactor variable to fine tune the measured current value. Keep changing this value until you are happy with the final measured value. In my case the value 9 worked, and I re-upload the program.

Now, the measured current value is pretty close to the actual measured value. Both the sensors are calibrated and now my Arduino Home Energy meter is ready for the final testing, so let’s go ahead and do it.

This Bulb draws around 0.32A, the voltage is around 174 volts, and the power is around 55 watts.

Next, I checked the Voltage, Current, and Power of the AC Room Cooler.

So, that’s all for now.