Microcontroller Based Overvoltage and Ov
Microcontroller Based Overvoltage and Ov
SUBMITTED BY
SUPERVISED BY
_____________________
Md. Mehedi Hasan
ID: 152-33-2625
________________________
Partho Das
ID: 152-33-2712
Signature of Supervisor
ii
©Daffodil International University
ACKNOWLEDGEMENT
First and foremost, we give thanks to the Almighty. While bringing out this project
to its final form, we came across a number of people whose contribution in various ways
helped us and they deserve special thanks. We would want to take this occasion to thank
our project supervisor, Dr. Md. Rezwanul Ahsan (Associate Professor and Head) of the
Department of EEE, for his commitment to helping and motivating us. Without his helpful
guidance and assistance, this project would be impossible to complete. Thank him also for
giving us the opportunity to select this project.
We would also like to express our gratitude to Professor Dr. M. Shamsul Alam
Dean of the Faculty of Engineering & Professor of the Department of EEE, for his
assistance, support, and consistent encouragement.
Apart from that, we would like to express our gratitude to all of our friends for
sharing their experience and information with us, as well as for assisting us in making this
project a success. Also, thankful for letting we borrow some of their tools and equipment.
We want to express our heartfelt gratitude to our loving family for their
unwavering support, as well as their inspiration and encouragement throughout our time
at this university.
iii
©Daffodil International University
Dedicated
To
Our Beloved Parents
iv
©Daffodil International University
ABSTRACT
The design and modeling of a microcontroller-based overload and over voltage
protection device using a microcontroller, Current sensor, Voltage sensor and other discrete
components are shown in this paper.
The device's heart is a microcontroller, which handles all of the device's essential
functions. The device is easy to use and inexpensive. Our country is rapidly expanding, yet
many of our electrical protection and detection systems are outdated. As a result, we have
prototyped an electrical protection project for various types of loads. The voltage and current of
the load are also being monitored in real time. It can be used to safeguard loads such as
refrigerators, radio sets, computers, VCR/DVD players, and other electronic devices against
unwanted overvoltage circumstances, as well as surges induced by sudden mains power
failure/resumption.
To run the load with a reference value, the voltage delivered to the load, and current
drown must all be continually measured, every 16 seconds, the device updates the online status
of these cases. If the measured value deviates from the reference value, the load is protected by
cutting off power. This change or defect can be viewed on the device's display or via the
internet from anywhere on the globe.
v
©Daffodil International University
CONTENTS
Certification ii
Acknowledgment iii
Dedication iv
Abstract v
List of Abbreviations x
List of symbols xi
Chapter 1: INTRODUCTION 1- 5
1.1 Motivation 1
1.2 Procedure 1
1.2.1 Methods of detecting and protecting faults 1
1.2.2 Methods of sending fault data online 4
1.3 Objective 5
1.4 Scope 5
3.1 Introduction 7
3.2 Block diagram 8
3.3 Circuit diagram 9
3.4 Flow chart 10
3.5 Hardware 11
3.5.1 Introduction 11
3.5.2 Microcontroller 11
3.5.2.1 Specifications of Arduino Nano 13
vi
©Daffodil International University
3.5.2.2 Specifications of NodeMCU 14
3.5.3 DC-DC buck converter 15
3.5.4 Logic level converter 16
3.5.4.1 Logic level converter pin configuration 17
3.5.5 ZMPT 101B Voltage Sensor 18
3.5.6 220v to 12v Down Step 19
3.5.7 LCD Screen 20
3.5.7.1 Pin Configuration of LCD Screen 20
3.5.8 SCT013 100A Ac current Sensor 21
3.5.9 Load 22
3.5.10 Relay 23
3.5.11 Supporting Elements 23
3.5.12 Programming of the Microcontroller 25
3.5.12.1. Overview 25
3.5.12.2 The Arduino 26
Chapter 5: CONCLUSIONS 30
5.1 Remarks 30
5.2 Implementation 30
5.3 Benefits 30
5.4 Limitations 31
5.5 Work Scope in the Future 32
References 33
Appendix 33
vii
©Daffodil International University
LIST OF FIGURES
viii
©Daffodil International University
LIST OF TABLES
ix
©Daffodil International University
LIST OF ABBREVIATIONS
IC Integrated circuit
DC Direct current
IDE Integrated development environment
PCB Printed circuit board
LIPO Lithium polymer
GND Ground
VCC Voltage common collector
OPAMP Operational amplifier
IR Infrared
RAM Random access memory
I/O Input or output
x
©Daffodil International University
LIST OF SYMBOLS
+ Addition
- Subtraction
°C Degree Celsius
μA Micro ampere
kHz Kilohertz
mA Mill ampere
μs Microsecond
% Percentage
μF Microfarad
xi
©Daffodil International University
CHAPTER 1
INTRODUCTION
1.1 Motivation
Protection systems have become more complex as a result of advancements in
power systems. Traditional protective technologies are inadequate for the future vision of
electrical power networks. Overload and Overvoltage are the most common causes of short
circuits, which can result in fires in both industrial and household settings. Our
technological advancements necessitate a real-time monitoring system that provides
protection in the shortest amount of time. We dreamt a device can make this possible and
can be cost effective as well.
The foregoing factors prompted us to investigate and work on the causes of power
outages and protection. We were able to create a functional prototype. Our system can
continually monitor the voltage and current supplied to any load in real time. The reference
data was taken from the safe operating voltage range and maximum current and set them
in our device. It will compare the current state to the reference values on a regular basis to
detect and defend against defects, as well as to notify the user.
1.2 Procedure
Our project's goal is to make electrical equipment use safer. I'm particularly
interested in the power quality given to the equipment. Overvoltage and overload can and
will harm our electrical and electronic devices. We created a device that can detect, protect,
and notify users of defects via the internet.
1.3 Objectives
Overload protection is really overheated protection, which is triggered by a flow of
overcurrent within the circuit for a set period of time.
Overheating damages circuit components and increases the risk of fire, explosion, and
injury. Overheating frequently causes irreversible damage, and the only method to fix it is
to replace some components.
Our goal is to create a functioning prototype of a device that can monitor voltage, and
current and current delivered to a load and protect the load in the event of a power delivery
anomaly, as well as updating the current state power quality online.
i: Creating a fault detection device based on a programmable microcontroller.
ii: In the event of a power outage, the load is protected.
iii: Real-time fault data is uploaded to the internet.
1.4 Scope
The purpose is to keep electrical components safe. However, our gadget includes a
few extra characteristics, including real-time monitoring of voltage, and current data, as
well as digital logging of problem states. All of these aspects are extremely helpful in
protecting against a fault as well as understanding the malfunction so that action can be
taken to resolve the problem.
Our device has a wide range of applications in various industries and residential
In today's world, difficulties with AC Induction motors are frequent. In this case, a
novel low-cost and reliable protection mechanism is used [1]. When it comes to power
related protection, the major significant elements that are examined in this similar area are
disconnection speed, dependability, and cost [2]. The manual technique of power supply
changeover is still used in most businesses, and it has a number of drawbacks, including
time waste, demanding labor, fire hazard, and high maintenance frequency [3]. The fear
that comes with a persistent or regular power failure or outage limits the amount of money
that can be invested in power-related projects, stifling the growth of companies and
international Operations [4]. Previous research has shown that in the event of a failure with
the AC main power supply, the protection device will automatically turn on and off the
main power supply, removing the need for anybody to operate it manually. Its purpose is
to protect household equipment like fans, televisions, refrigerators, and other electronics
from under and overvoltage in the main power supply [5]. Using a microprocessor,
transistor, and other discrete components, the suggested device protects industrial,
commercial, and residential equipment by monitoring under voltage, overvoltage, and
overcurrent problems. The microcontroller, which performs the majority of the gadget's
control, is at the heart of this protective device [6]. Another breakthrough that we must
address regarding the research which is the Internet of Things (IOT) paradigm enables
access to and control of devices from anywhere and at any time. The trend in this area is
for various devices to interface with the ESP8266 Node MCU module. Further research
has revealed that the gadgets can even be managed in relation to the ESP stations in use
[7]. Voltage fluctuations are one of the most serious power quality issues that industry and
home appliances encounter, and they can cause serious damage to expensive electrical
equipment. Electrical Power System Protection is essential to protect both users and system
equipment from failures; as a result, electrical appliances are not permitted to run without
a protective device installed [8].
.
3.1 Introduction
Microcontrollers are used in our project to process and act on data. This has been coded by
us and can be programmed again in the future. Our goals are to continuously measure
voltage and current and compare the results to a reference value. If the real-time data
overshoots, the microcontroller will turn off the power to the load. In addition, the fault
state is updated on a regular basis on the website via the internet. We utilized an
Atmega328p microprocessor to prototype our gadget. This is where the device's brain is
located. It contains inputs for data and sensor values, as well as outputs for sending
compliments. We utilized an ESP8266 Node MCU to communicate with the internet and
send data to an online server. This is a microcontroller with a Wi-Fi module attached to it.
It has I/O pins that are used to feed data from the Microcontroller to an online server over
the internet.
This block diagram depicts how components communicate with one another as well
as the overall process. I'm gathering information from the sensors. Temperature, voltage,
and current sensors are included. Current sensors are connected to the power supply line,
whereas temperature sensors are connected to the load and voltage.
Fig 3.1: Power Supply Block Diagram with Load Fault Detection, Protection, and
Online Monitoring
As a result, this diagram depicts how inputs and outputs are connected, as well as
who they are related to. Sensor data is analyzed in the microcontroller, and the
microcontroller determines whether or not a fault has occurred based on that data. In the
event of a fault, the microcontroller will send a signal to the relay, which will switch off
the power and send data to the NodeMCU, which will interact with the remote server. The
state of the load can be monitored at any time using LCD monitors controlled by the
microcontroller.
Fig. 3.2: Power Supply, Load Fault Detection, Protection, and Online
Monitoring Circuit Diagram
NO
Yes
Fig 3.3 Power Supply and Load Fault Detection, Protection, and Online Monitoring flow
chart.
3.5 Equipment
3.5.1 Overview
We utilized a variety of electrical and non-electrical components to construct our
prototype, including PVC board, nuts and bolts, glue, holding brackets, and so on. Because
this was an electrical project, we concentrated on the electrical components.
Microcontrollers have been used to process diverse data in order to identify errors. There
is also a Wi-Fi gadget to connect to the internet and interact. We used a relay that is
controlled by microcontrollers and is used to turn off the electricity when it is no longer
needed. We used two tungsten light bulbs to mimic load and failures. This is the load I
chose because it draws a lot of current and heats up quickly.
3.5.2 Microcontroller
The Arduino Nano is a compact, comprehensive, versatile, and breadboard-friendly
Microcontroller board based on the ATmega328p. It was designed by Arduino.cc in Italy
in 2008 and includes 30 male I/O headers set in the DIP30 manner. There are 14 digital
pins, 8 analog pins, 2 reset pins, and 6 power pins on this board.
The Arduino Nano is basically a smaller version of the Arduino UNO, and the two boards
have nearly identical functionality. It has a 5V operational voltage, however the input
voltage can be anywhere between 7 and 12V. The maximum current rating of the Arduino
Nano is 40mA, so the load connected to its pins should not drain more than that.
Architecture AVR
Operating Voltage 5V
Flash Memory 32kb of which 2kb used by boot load
SRAM 2kB
Clock speed 16MHz
Analog IN Pins 8
EEPROM 1kB
DC Current per I/O Pins 40mA *I/O Pins)
Input voltage 7-12 V
Digital I/O Pins 22 (6 of which are PWM)
PWM Output 6
Power Consumption 19mA
PCB Size 18 × 45 mm
Weight 7g
Product Code A000005
Table 3.1: Technical specification of Arduino Nana
NodeMCU based on ESP8266 was also used. It's a Lua-based open-source firmware and
development board aimed at IoT applications. The ESP8266 Wi-Fi SoC firmware is
included. We are connecting with this module to the internet and sending data to the
"thingspeak" server on the "thingspeak" website, we are uploading and displaying fault
state.
The supplied voltage and operational voltage of the components of our or any
device will not be the same, and various components in the same device may have different
voltage levels. Our power source is a 220v stepped down to 12v, but most of our
components require 5 volts to function, so I must scale it down.
We are using a DC-DC buck converter to scale down the voltage. Buck converters
are commonly used to reduce DC voltage. LM2596 buck converter module is the buck
converter we used.
This buck conversion was chosen since it is inexpensive and readily available. Even
though this model's maximum current flow rate is limited, it won't be an issue because our
equipment uses extremely little power.
Its auxiliary circuitry, which is focused on the LM358 twin op-amp chip, also
includes an inbuilt multiturn trim pot for modifying the isolated analog output. The
module's recommended operating voltage is 5VDC.
To get 12 volts from a 12-0-12 transformer, connect the transformer’s two side
terminal wires to the diodes and leave the transformer’s center terminal alone. There is no
way to link anywhere. Using a 12-0-12 transformer, this connection produces a full-wave
12v output. There will be no reduction in current. As we used full bridge rectifier to get
12V, we need to add a filter capacitor and the reason is that there is no full AC conversion
into DC during the rectification process; some AC signals arrive without conversion and
behave like harmonic noise or ripple at the load section. The important attribute of a
capacitor is that it only allows AC to pass through while blocking DC. As a result,
Fig 3.11: 12v DC output using 12-0-12 transformer full bridge rectifier.
We are showing the real data of two parameters: voltage and current on a 3.5.5
LCD display. We're also employing a 16x2 "Liquid Crystal Display" to show these
numbers.
A liquid crystal display, or LCD, gets its name from its definition. It is made up of
two different states of matter: solid and liquid. A liquid crystal is used to create a visible
image on an LCD. Liquid crystal displays (LCDs) are ultra-thin display screens that are
commonly seen in laptop computers, televisions, cell phones, and portable video games.
Specifications:
The split core type, such as the CT shown above, is ideal for our purpose since it can be
clipped directly on to either the live or neutral wire coming into the building without
requiring any high-voltage electrical work.
3.5.9 Load
We need to create false fault to prove that our project works. For this we need a
load and it can be anything.
We are utilizing a 5v operate relay, which implies that if the coil is powered by 5
volts, the relay will flip positions. The reason for using a relay in our project is that it is
simple to control with a microcontroller and has a rapid switching response time. In the
event of a fault, the microcontroller sends a signal to the relay, which turns off the power
supply to the load.
3.5.11.2 Capacitor
A capacitor is a device that stores a small amount of charge. It has a wide range of
applications. We are utilizing capacitors in our project to fill in power gaps and smooth out
voltage curves.
3.5.11.3 Resistor
It opposes current flow, as the name implies. The resistance of a resistor is
determined by its resistivity in Ohm (Ω) and the voltage applied across it. A resistor is
required in almost every electronic circuit. I used resistors in our project for a variety of
purposes, including pull down resistors, LCD led current limiters, and so on.
3.5.11.6 Regulator
We have used a movable type fan regulator to increase and decrease the voltage
level. As we have to show the under voltage faults and over voltage faults we have
selected a threshold value. When we move the regulator anti-clock wise the voltage
decrease because of the capacitor inside the regulator discharging slowly and it will show
the under voltage fault once comes down the lower threshold value. It is used for the
Demonstration only
©Daffodil International University 26
Our system whenever detect the changes comparing the threshold value the relay will trip
and the appliance will be cut off.
3.5.12.1 Overview
Our goal is to create a smart wheel chair that is both economical and safe. To
create this project, we used a variety of electrical components, sensors, and other
materials. The microcontroller is one of the most important components. It serves as the
project's brain. This is where all of the data from the user to the sensors is processed. It
sends an output signal to the motor driver, which drives the motors, based on the values
of the inputs.
We used the "Arduino IDE" to program the microcontroller. The Arduino
Integrated Development Environment (IDE) is a cross-platform application for Windows,
macOS, Linux, and other operating systems written in C and C++. It's used to write and
convert projects to Arduino feasible sheets, as well as other merchant advancement sheets
with the help of outsider centers.
Our first focus was on the protection of the equipment’s we used so we have added a
circuit breaker for any uncertain situation. A 240V to12v ac to dc transformer was added then
to get the desired voltage 5V to run the heart of our project the ‘Microcontroller’. As we
stated above the operating voltage is 5V for the microcontroller.
To get the 5V DC we have added a DC to DC buck converter to scale the 12V dc. As
we have used two microcontroller, one to detect the data another to command the Relay to
trip.
This project was built with a variety of electronics and electrical components. The
following is a price list:
No. Name of the component Price Quantity Total price
1. Atmega328p 80 tk 4 pc 650 tk
2. NodeMCU 350 tk 1 pc 350 tk
4. Capacitor 470uf 5 tk 2 pc 10 tk
6. Logic level converter 180 tk 1 pc 180 tk
7. 220v ac to 12v dc 230 tk 1 pc 230 tk
transformer
8. LCD 16x2 90 tk 2 pc 180 tk
9. DC-DC buck Converter 150 tk 1 pc 150 tk
10. Relay 80 tk 1 pc 80 tk
11. ADS1113 250 tk 1 pc 250 tk
12. Registers 0.001 tk 8 pc 0.008 tk
13. Bulb 50 tk 1 pc 50 tk
14. SCT-013 100A AC 350 tk 1pc 350 tk
current sensor clamp
type
15. Wire 3 tk 5 set 15 tk
16. Ac Voltage sensor 180 tk 1 pc 180 tk
Total 2645.008 tk
Table 4.1: Price List
5.1 Conclusion
Our goal was to provide something new, better, and more modern to protect
electrical loads from problems. Our project uses the internet to identify, protect, and notify
real-time electrical issues, as well as to continuously update the power state.
Microcontrollers are being used to measure real-time data such as voltage, current, and
temperature. We utilize those characteristics as our reference values because every load
has safe operating parameters (voltage, temperature, etc.). When a malfunction occurs, the
microcontroller turns off the power to the load immediately, saving the load. It is critical
to inform/monitor the state of the defect before taking action to rectify it. Every 15 seconds,
we update the state of fault or no-fault circumstances over the internet.
Moreover, the device can detect faults and monitor real-time metrics, as well as
send out alerts via the internet when a fault occurs.
5.2 Implementations
Our project has a wide range of applications because it provides protection for any delicate
electrical and electronic equipment. Here are a few examples:
5.3 Benefits
Our device is cutting-edge and outperforms standard options. The following are a few
advantages:
• The response time is quite quick.
• Because there are no mechanical parts, there is no mechanical wear and tear.
• Data is sent over the internet and may be viewed from any location.
5.4 Limitations
Nothing is perfect, and every device has limitations, but I will continue to strive to improve
it in the future. The following are a few drawbacks:
[2] Arpit Rana, Jeet Shah, Anuradha Deshpande, “Simulation for Power Transformer
Protection Using Microcontroller Relay.” International Journal of Scientific Engineering
and Technology, Volume-4. ISSN: 2277-1581. June 2015.
[4] Ehiabhili, John. C and Ezeh, Chioma. V and Orji, Onyeka. V, Single Phase
Microcontroller-Based Automatic Changeover Switch (February 28, 2018). International
Journal of Electronics, Communication & Instrumentation Engineering Research and
Development (IJECIERD), Vol. 8, Issue 1, Feb 2018, 7-16.
[5] Sarder, M. A., Rahman, M., Mostakim, M. N., Rahman, M. M., & Islam, M. S. A
Prototype of AC Voltage Measurement and Over & Under Voltage Protector Using
Arduino.
[6] Naik, S. G., Ravi, V., & Arshiya, R. (2018). Programmable protective device for
LV distribution system protection. Protection and Control of Modern Power Systems, 3(1),
1-6.
[7] Naik, S., Ravi, V. & Arshiya, R. Programmable protective device for LV
distribution system protection. Prot Control Mod Power Syst 3, 28 (2018).
https://doi.org/10.1186/s41601-018-0101-5
[8] Raju, K. L., Chandrani, V., Begum, S. S., & Devi, M. P. (2019, March). Home
automation and security system with node MCU using internet of things. In 2019
International Conference on Vision Towards Emerging Trends in Communication and
Networking (ViTECoN) (pp. 1-5). IEEE.
#include <ESP8266WiFi.h>
#define LEDonBoard 2
String apiKey = "O53XW0J11ACKUWBY";
const char* ssid = "MiNAKAMiKA 2G";
const char* password = "0000000X";
const char* server = "api.thingspeak.com";
WiFiClient client;
void setup() {
Serial.begin(115200);
delay(500);
delay(500);
WiFi.begin(ssid, password);
Serial.println("");
pinMode(LEDonBoard, OUTPUT);
digitalWrite(LEDonBoard, HIGH);
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
digitalWrite(LEDonBoard, LOW);
delay(250);
digitalWrite(LEDonBoard, HIGH);
delay(250);
}
digitalWrite(LEDonBoard, HIGH);
Serial.println("");
pinMode(4, INPUT);
pinMode(5, INPUT);
}
void loop() {
int A = digitalRead(4);
int B = digitalRead(5);
//int V = digitalRead(14);
if (client.connect(server, 80)) {
String postStr = apiKey;
postStr += "&field1=";
postStr += String(A);
postStr += "&field2=";
postStr += String(B);
postStr += "\r\n\r\n";
Serial.print("A: ");
Serial.print(A);
}
client.stop();
Serial.println("Waiting...");
digitalWrite(LEDonBoard, LOW);
delay(250);
digitalWrite(LEDonBoard, HIGH);
delay(750);
}
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "EmonLib.h"
#define VOLT_CAL 480
#define CURRENT_CAL 36
EnergyMonitor emon1;
void setup()
{
Serial.begin(9600);
emon1.voltage(1, VOLT_CAL, 1.7);
emon1.current(0, CURRENT_CAL);
lcd.begin();
Serial.print("Voltage: ");
Serial.println(supplyVoltage);
Serial.print("Current: ");
Serial.println(currentDraw);
Serial.print("Watts: ");
Serial.println(currentDraw * supplyVoltage);
Serial.println("\n\n");
if (currentDraw>5 || supplyVoltage>250)
{
digitalWrite(9,LOW);
if(currentDraw>2){
digitalWrite(10,HIGH);
lcd.setCursor(0,1);
lcd.print("OVER LOAD");
delay(500);
lcd.setCursor(0,0);
lcd.print("V=");
lcd.setCursor(2,0);
lcd.print(supplyVoltage);
lcd.setCursor(0,1);
lcd.print("I=");
lcd.setCursor(2,1);
lcd.print(currentDraw);
lcd.setCursor(11,0);
lcd.print("Watts");