Detection of AC Current Using Current Transformer and Arduino
Detection of AC Current Using Current Transformer and Arduino
com/contact)
How
(https://www.facebook.com/IoT-Design-Pro-284393472235331/)
to
(https://twitter.com/IoTDesignPro1) (https://www.pinterest.com/iotdesignpro)
Detect
ARDUINO 20 Aug, 2021 / 4and
Comments
Measure
How to Detect and
AC Measure AC Current using Current
Transformer and Arduino
Current
using
Current
Transformer
and
Arduino
1
Shares
Smart power monitoring is getting increasingly popular to improve energy e"ciency in
medium/small scale industries, multi-story buildings, etc. We have previously built a smart
energy meter (https://iotdesignpro.com/projects/iot-based-smart-energy-meter) which can
measure power and report usage online. While this type of system is popularly used in
energy meters, another most commonly available technique to measure current is by using a
current transformer (CT). CT can detect and measure AC current in machines and other AC
appliances to monitor the current consumption and thus the health of machine or AC
appliance.
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 1 of 19
:
In this project, we are going to measure the value of AC current with the help of a Current
Transformer (CT). The system also includes a rectifier and amplifier circuit for signal
conditioning. We have used a 16x2 LCD display with a monitor to display the measured value
of current. There are many ways to measure AC current like Inductive Sensor, Hall e#ect
sensor, etc. but we are using the current transformer in this project. Using this project, we
will be able to measure AC current of range 0.1Amp – 5 Amp.
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 2 of 19
:
Current Transformer (CT) is a current measuring device used to safely reproduce a low-level
current that accurately represents a higher current level for the purpose of metering or
protection. CTs are closed loop instruments consisting of a magnetic core and a secondary
winding around the core. For this tutorial, we will be using the HWCT-5A/5mA current
transformer which is shown below.
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 3 of 19
:
The primary winding of CT, the main loop has the wire with the current we wish to measure
passed through the center of the core. The primary winding that carries the main current is
said to have a single loop or winding. The wire produces the magnetic field that drives the
current on the secondary winding, which is used as output of the CT.
Turns Ratio = Np / Ns = Is / Ip
Where,
Np = Turns in Primary winding
Ns = Turns in Secondary winding
Ip = Current in primary winding
Is = Current in secondary winding
Calculation of Ns :
If the current ratio for given CT is 5A:5mA , then
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 4 of 19
:
Ns = ( Np * Ip ) / Is
Is =5 mA , Ip = 5 A , Np = 1
So, Ns = 1000
1 CT Window type 1
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 5 of 19
:
3 Op-amp LM358 IC 1
4 10K Resistor 1
5 20k Resistor 1
6 1k Resistor 1
7 2k Resistor 1
8 Breadboard Generic 1
10 Bulb 60 watt 1
11 Capacitor Electrolytic 1
12 AutoTransformer 0-440 V 1
15 Multimeter Digital 1
16 LCD display 16 * 2 1
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 6 of 19
:
Circuit Diagram to measure AC Current using Arduino
The below schematic shows the Circuit diagram for current measurement using the current
transformer.
In above circuit, we used 16 * 2 LCD but in project we have used I2C LCD display. For I2C LCD
display simply connect.
Arduiono Gnd – I2C Gnd
Arduino 5V - I2C Vcc
Pin A4 - I2C SDA
Pin A5 - I2C SCL
We have used AC voltage source as a Secondary winding voltage in above circuit diagram.
This is how Rectifier and amplifier circuit looks like in breadboard.
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 7 of 19
:
As we can see in this circuit, a red color wire passing through the current transformer, we are
going to measure current value passing through this wire. 20k + 2k resistances and Zener
diodes are connecting parallel with CT. This resistance is burden resistance of CT (22k) and
Zener diodes improve the safety of circuit. Here, we also connected one Schottky diode that
will behave as half wave rectifier.
Due to the AC current in the primary winding, AC voltage is induced in the secondary winding
as well. Now to convert this AC voltage into DC voltage, it is sent to half wave rectifier, half
wave rectifier is forward biased in positive half cycle and reverse biased in negative half cycle.
In figure, Vi is input sine wave pulse and Vo is output sine wave pulse.
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 8 of 19
:
An electrolytic Capacitor is added to the output of the have wave rectifier to receive only the
DC voltage. This capacitor only forwards the DC voltage in the circuit. The output voltage that
is obtained from the rectifier circuit is in very less magnitude, so we use amplifier. we have
used non inverting operational amplifier with 10k and 1k feedback resistor value.
As we know output of non-inverting operational amplifier is:
Where,
Rf = Feedback resistor value (10k)
R1 = 1k
Vout = Op-amp output voltage
Vin – Voltage applied at non inverting terminal of op-amp.
Vout = 11 * Vin
11 is close-loop gain for this op-amp. Now, the amplified output voltage is sent to the
Arduino, after that, the value of the primary winding current is received in the LCD screen.
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 9 of 19
:
The complete code is given at the end of this document. Here, we are explaining some
important parts of the arduino code.
The output of the operational amplifier is an analog voltage value, this analog value is
converted into digital value through inbuilt ADC in arduino. The ADC presents on arduino is a
10 bit ADC. It can detect 1024 discrete analog levels. ADC converts analog voltage value into
ADC reading using below formula.
The same formula written above is used to print the voltage value in the serial monitor.
The above formula is used to print the voltage value in the serial monitor.
readValue = analogRead(volValue);
Voltage = (5.0/1023)*readValue;
To convert voltage into current, divide by a constant 10.680, which comes from circuit
calculations.
Value = Voltage/10.680;
To print the primary winding current value in LCD display, wire.h, LiquidCrystal_I2C libraries
are used.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
Code:
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 10 of 19
:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
int volValue=A0;
int readValue;
float Value;
float Voltage;
int LED = 13;
void setup(){
lcd.begin();
lcd.backlight();
pinMode(LED, OUTPUT);
pinMode(volValue,INPUT);
Serial.begin(9600);
}
void loop(){
readValue = analogRead(volValue);
Voltage = (5./1023)*readValue;
Value = Voltage/10.680;
Serial.println(Value);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Current in Wire");
lcd.setCursor(6,1);
lcd.print(Value);
delay(1000);
}
Change in the value of the primary winding current is also visible in the LCD screen. As we
can see in the image below, the actual current value and measured current value is almost
same.
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 11 of 19
:
Measuring a smaller value (less than 0.2 A) of current shows a fluctuation in measured
current value at second decimal place. This happens because of the very small value of AC
current but if we measure a large value (more than 0.5A) of current, then fluctuation does not
appear. Here, we used metal film resistor but we can get more accurate results by using
precision metal film resistor.
Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
int volValue=A0;
int readValue;
float Value;
float Voltage;
int LED = 13;
void setup(){
lcd.begin();
lcd.backlight();
pinMode(LED, OUTPUT);
pinMode(volValue,INPUT);
Serial.begin(9600);
}
void loop(){
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 12 of 19
:
readValue = analogRead(volValue);
Voltage = (5./1023)*readValue;
Value = Voltage/10.680;
Serial.println(Value);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Current in Wire");
lcd.setCursor(6,1);
lcd.print(Value);
delay(1000);
}
Video
Where to Buy
Click here to view more results for ARDUINO
(https://analytics.oemsecrets.com/main.php?
utm_campaign=article&utm_source=iot-design-
pro&utm_content=header&utm_medium=cc&event_link=https%3A%2F%2Fptop.only.wip.la%3A443%2Fhttps%2Fwww.oemsecre
design-pro%26utm_content%3Dheader%26utm_medium%3Dct)
Part
Number
Distributor Stock
RS ABX000 162
https://iotdesignpro.com/projects/detect-and-measure-ac-current-using-current-transformer-and-arduino 15/05/24, 18 37
Page 13 of 19
: