The main target of this project is to design and develop an Arduino Based Smart Overvoltage and Undervoltage Protection System to protect the appliance from damage. Nowadays fluctuation in AC mains voltage is frequent in domestic houses and industries. The abnormal over and under voltages may be caused due to some reasons such as sudden interruption of heavy load, thunder lightning, switching impulses etc. It can easily damage sensitive electronic parts in these conditions. It is so preferable to have a tripping system such as MCB, MCCB to protect the appliances. But we build here an advanced system which can smartly control your whole house’s electric supply using the user’s choice. Yes, we can set our desired maximum and minimum voltage for our needs.
In today’s market, various types of smart Overvoltage and Undervoltage protection systems have come out. But these are a little bit costly. Our project aims at protecting the electrical equipment from over and under voltages using just an Arduino and voltage sensor at a low cost. Here we use the ZMPT101B voltage sensor which is more accurate than others also it is cost-effective. It detects any voltage greater than 230V AC and below than 190V AC (predefined value). If the voltage is across the limits than the predefined values, it sends a signal to the Arduino. Then it immediately trips the circuit breaker (here the relay module). Then the circuit breaker isolates the load from the main source.
In today’s power system, voltage quality is an important factor with their growth in power electronics and their high sensitivity of electronic components. Voltage quality covers a wide range of voltage disturbances and fluctuations in voltage magnitude or waveform from the maximum values. Daily operation of the power grid may result in disruption of voltage quality. Also, voltage irregularities are the major issues in the industries and domestic users are facing and often damages sensitive electronic equipment.
Must Read IoT Based Smart Energy Monitoring System
What is Overvoltage?
The word “Overvoltage” is in use since 1907. According to the IEEE standards, Overvoltage is defined as “Voltage between one phase and ground or between two phases, having a crest value exceeding the corresponding crest of maximum system voltage.” We can also define it as the voltage in a circuit being raised above its upper design limit which will be leading to damage or short circuits. Also, say when the supply voltage rises above the rated voltage of the equipment. Overvoltage can be caused by poor regulation of a power source from a utility company, oversized transformers, uneven or varying circuit loading, wiring errors, and electrical insulation or isolation failures. We can separate it in three basic ways that are:
- Internal Overvoltage
- External Overvoltage
- Temporary Overvoltage
What is Undervoltage?
Undervoltage is defined as when the applied voltage drops upto 90% of the rated voltage or less. Undervoltage conditions are caused by the undersized or overloaded utility and facility transformers. During peak demand periods, the demanded power exceeds the capability of the transformer and as a result, the voltage drops.
Project

Circuit Diagrams

Components Required
- Arduino Nano
- ZMPT101B Voltage Sensor
- 16×2 LCD Display
- I2C Module
- 5V Relay Module
- Hi-Link 5V AC-DC Converter
- Veroboard
- Wires
About Parts of Overvoltage And Undervoltage Protection System
Arduino

For the compact build, I choose Arduino Nano despite Arduino UNO. Arduino Nano is a small, flexible microcontroller board using an Atmega328p chip. It can also use as a substitute for UNO. All the functions are the same in these two boards. The size of its PCB is 18×45 mm. The clock speed is 16Mhz. Its input voltage is 5-12V. There are 30 pins including power pins, data pins, analog pins, serial pins on this board.
ZMPT101B Voltage Sensor

The 9V AC step-down transformer has been used here as a voltage sensor. But we could use ZMPT101B One-Phase Voltage Sensor for accurate sensing. It removes messy wire connections. But for reducing cost we use this method. The transformer provides insulation between high AC voltage and low AC voltage. The 9V transformer output terminal has been connected to the voltage divider circuit to bring this voltage to 0-5V. Thus voltage measurement can be made without requiring any high voltage operation. This sensor can measure upto 270V AC supply voltage.
16×2 I2C Module for LCD Display

16×2 LCD I2C module has an inbuilt PCF8574 I2C chip that converts I2C serial data to parallel data for the LCD display. These modules are currently supplied with a default I2C address of either 0x27 or 0x3F. Also, it has an inbuilt contrast adjustment potentiometer.
PCB Design
For removing messy wiring and give a clean look, I designed a PCB prototype for this project. It is also helpful for troubleshooting that runs great without any errors. To design this PCB board, I used EasyEDA as it is too easy to use. For ordering PCB for this, I prefer PCBWay.
Gerber file for Overvoltage And Undervoltage Protection System Gerber.
PCB View


Order PCB From PCBWay
There are so many forums or communities for electronics online in today’s technical world, and one of the famous ones for PCB manufacturing is the PCBWay. PCBWay is a place that brings manufacturers and customers together. They have more than a decade of experience in this field of fabrication, prototyping and assembling PCBs. PCBWay have proved their focus to their customers’ needs in terms of cost-effectiveness, delivery, and quality.
Monthly Submission for PCBWay
Great opportunity for showing your creativity in electronics right now. PCBWay’s Open Source Community is a platform for sharing creative electronic projects and insightful knowledge for global project makers.
You can express your own ideas about electronics and also receive feedback from the community that is ready for you! Whenever you have some useful and practical ideas on how to design or develop an electronic project, or anything that you think should be discussed at PCBWay. By writing articles on your own unique ideas, you can earn reward points basis on your project as well as earn money. You are always welcome to post articles about electronic projects in their community. For detailed information just check out this link and start a fresh beginning. Monthly Submission for PCBWay.
How PCB Manufacturing Process Done in PCBWay
Standard quality for any product needs to be maintained using some parameters. PCBWay gives that opportunity by quality control in designing and manufacturing. At first, they ensure accuracy, clarity, validity of the PCB files that we sent to them.
Then all the boards will go through the most stringent tests other than the basic visual check. They adopt most of the testing and inspecting equipment used in the industry, such as Flying Probe Tester, X-Ray Inspection Machine, Automated Optical Inspection (AOI) Machine. PCBWay are having 50+ new engineers on the daily basis around the world using PCBs for their work, who trust for their reliable quality. They produce high-quality pink, orange, grey, even transparent solder mask. Moreover, according to people needs, they can also provide Black core PCB. Check it out for a High-Quality PCB solder mask. There are some pictures below of the new colours of solder musks.
Features of PCBWay
PCB Prototyping & Manufacturing: PCBWay produces FR-4 and Aluminum boards and advanced PCBs like Rogers, HDI, Flexible and Rigid-Flex boards, at a very reasonable price. Just check this Instant Quote to order premium PCBs for your hobby projects.
PCB Assembly: It not only offers PCB Prototyping but also offers PCB Assembly service. You can order a full PCB board with attached components by uploading your file. SMT & THT assembly starts from only 30$ including free stencil and worldwide shipping. The components can be sourced and provided by PCBWay, or by clients themselves.
Open Source Community: It not only offers PCB Prototype & Assembly service but also gives opportunities to students for sponsorships. I think this is so great. They feature their projects on the website also.
3D Printing & CNC: It also produces Rapid Prototyping like 3D printing, CNC Machining, Sheet Metal Fabrication, and Injection Molding. The quality of the product is too premium and reliable. And also the best part is that you will receive your order within a minimum of 3 days.
PCBWay Store: More boutique gift modules are waiting for you to discover, giving your creativity wings. You can order all types of electronic equipment, components and many more with exciting offers. Go with the link and buy your needs, PCBWay Store.
Services: PCBWay offers great servicing of their products. It takes only 3 to 15 days according to courier service to deliver your products. Also, it has a live support facility. Whenever you have any problems, you can always reach a live customer service person to respond to your emails or messages. They have the “Return and Refund” principle, for every unusable board caused by PCBWay, they will rebuild and refund the order soon.
Guide for Ordering PCB From PCBWay
Block Diagram Overvoltage And Undervoltage Protection System

Operation of Overvoltage And Undervoltage Protection System
The usual AC supply voltage at our home is 230V. Due to the voltage fluctuations according to the appliance load, it may vary. But it should be +2% tolerance. In case of an increase of above 2% or vice versa, the attached load may get damaged. In order to avoid this problem, we developed an over and under voltage protector. When the supply voltage exceeds the specified limit, the relay operates and isolates the load from the electrical circuit. After detecting the fluctuated voltage, an analog signal of the output voltage is fed to the Arduino. This voltage is unregulated and therefore it varies as the input voltage varies.
Arduino Nano has five analog input pins and thirteen digital pins. It has an inbuilt analog to digital converter. So, five different loads can be connected at the same time. The 13th pin contains an indication LED. Arduino takes an input voltage of 5 to 12 volts and gives an output upto 5V. A preset value with tolerance is given to the Arduino. The Arduino compares the preset value with the analog read value at A0. If it lies within the limit the relay does not operate. If it doesn’t lie within the limits, the Arduino checks if it falls into inverse characteristics or definite characteristics. The operating time for definite characteristics is given as 5 seconds, i.e. the relay operates after 5 seconds of occurrence of the fault. If it falls into inverse characteristics, the tripping time is to be calculated using the formula:
T= t/((V/Vs)-1)
Where T = Trip Time
t = Time Multiplier
V = Voltage at A0
Vs = Source Voltage
When the trip time will be set to zero, the relay will work and the circuit will be instantly tripped. When operating in the inverse characteristics or in the definite characteristics, if the voltage comes back to the rated voltage, then the relay will go again in reset mode.
Applications of Overvoltage And Undervoltage Protection System
- This system is effective in motor loads. It protects the motor from overvoltage.
- It protects home appliances from sudden voltage damage.
- In some areas where power flatuations are too much, there it is useful for protection.
Calibration Method for Voltage
First, we need to upload the below code to the Arduino. Then we need to open the Serial Plotter from the tools menu in Arduino IDE.
Calibration Code
1 2 3 4 5 6 7 8 9 10 | void setup() { Serial.begin(9600); } void loop() { Serial.println(analogRead(A0)); delay(50); } |

When you upload that code and after opening the serial plotter, you will see this type of signal where the upper part is plain.

By using the potentiometer of the ZMPT101B voltage sensor, you need to calibrate this signal into that sinusoidal signal. After adding some delay to the code to see the actual sinusoidal signal.
1 2 3 4 5 6 7 8 9 | void setup() { Serial.begin(9600); } void loop() { Serial.println(analogRead(A0)); delay(100); } |

I know there are some distortions that still exists on this waveform. But our voltage sensor is now ready for sensing the voltage.
Arduino Code
To compile the Arduino code, we need some libraries.
“Fliters.h” library, and “LiquidCrystal_I2C“ library.
Please only use Filter.h (version 0.1.1) library to avoid “runningStatistics was not declared in this scope” error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #include <Filters.h> //Easy library to do the calculations #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 16, 2); float testFrequency = 50; // test signal frequency (Hz) int Sensor = 0; //Sensor analog input, here it's A0 int relay = 9; //Define output pin for relay float intercept = 0.7; // To be adjusted based on calibration testing float slope = 0.04; // To be adjusted based on calibration testing float current_Volts; // Voltage unsigned long printPeriod = 1000; //Refresh rate unsigned long previousMillis = 0; void setup() { lcd.init(); lcd.backlight(); pinMode(relay, OUTPUT); lcd.print("Voltage:"); delay(1000); } void loop() { RunningStatistics inputStats; // Easy life lines, actual calculation of the RMS requires a load of coding while ( true ) { Sensor = analogRead(A0); // Read the analog in value: inputStats.input(Sensor); // Log to stats function if ((unsigned long)(millis() - previousMillis) >= printPeriod) { previousMillis = millis(); // Update time every second current_Volts = intercept + slope * inputStats.sigma(); // Calibartions for offset and amplitude current_Volts = current_Volts * (40.3231); // Further calibrations for the amplitude lcd.setCursor(9, 0); lcd.print(current_Volts); lcd.print("V"); } // Case 1 Under Voltage if ( (current_Volts > 0) && (current_Volts < 150) ) { lcd.setCursor(0, 1); lcd.print("Under Voltage"); digitalWrite(relay, LOW); } // Case 2 Normal Rated Voltage if ( (current_Volts >= 150) && (current_Volts <= 260) ) { lcd.setCursor(0, 1); lcd.print("Normal Voltage"); digitalWrite(relay, HIGH); } // Case 3 Over Voltage if ( current_Volts > 260 ) { lcd.setCursor(0, 1); lcd.print("Over Voltage"); digitalWrite(relay, LOW); } } } |
Liquidcrystal_i2c.h : no such library found error in main code please help
You need to install “Liquidcrystal_i2c.h” from the link I mentioned in the article or you can download and install it from Arduino IDE library.
Please how can I get all the components used on this project
From any online e-commerce site.
So AC dimmer circuit is safe or not?
Yes, it is safe. This is just varying the AC voltage to check whether the system is working or not. Otherwise, you can use the circuit without checking.
In voltage control I will used a 10k potential meter so it is ok or not?
You need to use an AC dimmer circuit for the PWM signal if you don’t have a variable transformer. Just using a potentiometer is risky to burn immediately even it does not control the voltage precisely.
Which converts are used in this project 5v 3w or 5v 5w and 5v 10w?
5V, 3 watt
Which relay channel are used in this project 4v relay channel or 1 volt relay channel
5-volt relay channel. But you don’t have to use multiple relays. Single-channel relay is preferred.
I need a video of this project
Ok I will add it.
It Says – “RunningStatistics” was not declared in this scope. I’ve installed it correctly (Version 0.1.2). But Still shows this error msg.
Please reinstall the filters.h version 0.1.1 and compile it. I recently checked it with this version and it doesn’t give a statistics error code. Also checked it with your version and it shows the error code that you said.
It still shows the error RunningStatistics
The code is saying 302 stray error….what’s wrong
It means you just copy the code from the website and paste it to IDE. You have ASCII codes copied that add spaces to your code. Go through each identified line and remove any extra spaces at the beginning and end of any identified line. Then go to TOOLS, then click Auto Format.
I need Thinkercard diagram video
Runningstatistis was not declared in this scop we have error pleas help
Reinstall filter.h version 0.1.1.
hi Mr Rafi Ul Mulk
How You clear this error from Arduino IDE
Just use Filter.h (version 0.1.1) not any higher version. That’s it
I install this version (0.1.1). But again and again error occurs please guide me about this .
Mail me through this: contact@circuitdiagrams.in