Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Arduino AC Voltage Protection & Monitoring System | Under, Normal & Over Voltage
Arduino Projects

Arduino AC Voltage Protection & Monitoring System | Under, Normal & Over Voltage

Mamtaz AlamBy Mamtaz AlamUpdated:May 28, 20233 Comments7 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Under, Normal, Over AC Voltage Protection & Monitoring System using Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Overview

In this project, we will make a Smart Arduino Based AC Voltage Protection & Monitoring System with Under & Over Voltage Protection features. We can use a ZMPT101B voltage sensor to measure the current Voltage status and display it on LCD Display.

Nowadays there are a lot of AC Mains voltage fluctuations due to interruption of heavy load, thunder & lightning, and switching impulses. This can easily damage the electronics/electrical parts and sometimes lead to fire accidents. Voltage irregularities are the major issues in industries that often damage sensitive electronic equipment. In most cases, MCB is used as a protection system but it would be better if we implement our own system which could be cheaper and more advanced. Moreover, the system should have user input for under-voltage and over-voltage protection.

Many devices are available in the market for AC Voltage Monitoring along with Under, Normal & Over Voltage Protection features. But they are expensive and can’t have user input. This project aims to sort out all those drawbacks and develop protection & monitoring for the electrical equipment from over and under AC voltages using Arduino as a controller at a low cost. So we can use the ZMPT101B voltage sensor & Arduino to measure AC Voltage and based on under & over voltage detection, the Relay can turn off the entire system.




Bill of Materials

The following components are needed for this project. You can purchase the products from the given link.

S.N.ComponentsQuantityPurchase Link
1Arduino Nano1Amazon | AliExpress
216X2 LCD Display1Amazon | AliExpress
3. ZMPT101B Voltage Sensor 1Amazon | AliExpress
45V Relay Module1Amazon | AliExpress
5BC547 Transistor1Amazon | AliExpress
61N4007 Diode1Amazon | AliExpress
7Resistor 10K1Amazon | AliExpress
8Resistor 1K1Amazon | AliExpress
9Resistor 220-ohm1Amazon | AliExpress
10LED 5mm (Multicolor)3Amazon | AliExpress

What is Over Voltage & Under Voltage?

Over Under Normal Voltage

Overvoltages are the voltages that exceed the normal or rated values which cause insulation damage to electrical appliances leading to short circuits. To be more precise, it’s when a supply voltage of 10 percent and above the rated voltage occurs. The conditions may be hazardous. Depending on its duration, the overvoltage event can be transient—a voltage spike—or permanent, leading to a power surge.

Similarly, Undervoltage happens when the average voltage of equipment falls below the rated voltage amount. Frequent Undervoltage can result in a degradation in equipment performance and reliability.




Block Diagram: Arduino Over & Under AC Voltage Monitoring

Here is a simple block diagram of an AC Under Voltage Over Voltage Monitoring & Protection System with an Arduino Microcontroller.

AC Under Voltage Over Voltage Monitoring & Protection System with an Arduino Block Diagram

In Asia and most parts of the world, the usual AC supply voltage is between 220-240V. There is a +2% tolerance for Voltage fluctuations. In case there is an increase above the tolerance voltage over voltage is detected. We have also set the under voltage as 190V in this circuit. And test with variations in under and over voltage, we have used 220V Fan AC Dimmer. You can make your own AC Dimmer by referring to our previous post.

In the above block diagram, 200V AC Mains is supplied directly to the ZMPT101B Voltage Sensor. In this project, the input voltage is varied using the Fan AC Dimmer instead of a direct 220V Power Supply. The output of the ZMPT101B is an Analog voltage that is below 5V and can be fed easily to the Arduino Analog pin. The Arduino Nano Board and Relay are powered via a 5V Power supply or a 5V DC Adapter. A Load can be connected across the output of the Relay.

We have used a 16×2 LCD Display for displaying the Voltage Value and also the under, normal and over-voltage conditions. Whenever the voltage goes beyond 220V, the over-voltage condition is achieved and Relay disconnects all the electrical appliances. The LCD will display overvoltage message. Similarly, if the voltage lies between 220V-190V the Relay turns ON as Normal Voltage is displayed on the LCD. In case the voltage further drops below 190V, the under voltage condition is achieved. The Relay will shut down the system and the LCD displays the Under Voltage message.


Tripping Time Calculation

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



Circuit Diagram: Arduino Over & Under AC Voltage Monitoring

Using the block diagram from above, we can make a simple circuit diagram using Arduino and some active passive electronic components.

Arduino Over & Under AC Voltage Monitoring

Connect the 16×2 LCD Pin 4, 6, 11, 12, 13, and 14 to Arduino D3, D4, D5, D6, D7, and D8 Pin. Use a 10K Potentiometer at Pin 3 of LCD to adjust LCD Contrast. Supply 5V to LCD Pin 2 & 15. Connect LCD Pin 1, 5 & 16 to GND of Arduino.

Connect the Green and Yellow LED to digital pins D11 and D12 of Arduino. The LED1 is for Power indication. In order to control the Relay, we are using a BC547 transistor as a Switch. The diode 1N4007 which is across the Relay is serving as reverse voltage protection. You can connect multiple loads across the output of Relay. The load may be the AC Bulbs or any home appliances operating at 220V.

The ZMPT101B is an analog sensor. Therefore connect the analog pin of the sensor to Arduino A0 Pin. You can power the ZMPT101B, Relay Module using the 5V Pin of Arduino. The ZMPT101B accepts the input AC Voltage of 220V or over in our case. To test the Arduino Over & Under AC Voltage Monitoring Protection Circuit, AC Fan Dimmer is the best option.


Project PCB Gerber File & PCB Ordering Online

If you don’t want to assemble the circuit on a zero PCB and you want PCB for the project, then here is the PCB for you. I used EasyEDA to design the PCB. The PCB Board for AC Voltage Monitoring System looks something like below.

The Gerber File for the PCB is given below. You can simply download the Gerber File and order the PCB from ALLPCB at 1$ only.

Download Gerber File: Over/Under Voltage Monitoring System

You can use this Gerber file to order high quality PCB for this project. To do that visit the ALLPCB official website by clicking here: https://www.allpcb.com/.

You can now upload the Gerber File by choosing the Quote Now option. From these options, you can choose the Material Type, Dimensions, Quantity, Thickness, Solder Mask Color and other required parameters.

After filling all details, select your country and shipping method. Finally you can place the order.

You can assemble the components on the PCB Board.




ZMPT101B Voltage Sensor Calibration

Initially the ZMPT101B Voltage Sensor requires calibration as it doesn’t come pre-calibrated. First upload the following code to the Arduino Board.

1
2
3
4
5
6
7
8
9
10
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println(analogRead(A0));
delay(100);
}

After uploading the code, open the Serial Plotter. If the Serial Plotter doesn’t show the sine wave, then rotate the potentiometer to calibrate the sensor. Once it shows a proper sine wave, you can assume it as a proper calibration.


Source Code/Program

The following is the code for Over and Under AC Voltage Protection system using Arduino. Copy the code and paste it on the Arduino editor. The select the Arduino Nano Board from Board Manager and also the right COM port. Then you can upload the code.

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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include <Filters.h>
#include <LiquidCrystal.h>
 
const int rs = 3, en = 4, d4 = 5, d5 = 6, d6 =7, d7 = 8;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
float testFrequency = 50;  
int Sensor = 0;
int relay = 10;  
int yellow = 12;
int green = 11;  
float intercept = 0.7;
float slope = 0.04;
float current_Volts;
unsigned long printPeriod = 1000;
unsigned long previousMillis = 0;
void setup()
{
lcd.begin(16, 2);
  pinMode(relay, OUTPUT);
    pinMode(yellow, OUTPUT);
      pinMode(green, OUTPUT);
  lcd.print("Voltage:");
  delay(1000);
}
void loop()
{
  RunningStatistics inputStats;            
  while ( true )
  {
    Sensor = analogRead(A0);
    inputStats.input(Sensor);  
    if ((unsigned long)(millis() - previousMillis) >= printPeriod)
    {
      previousMillis = millis();  
      current_Volts = intercept + slope * inputStats.sigma();
      current_Volts = current_Volts * (40.3231);            
      lcd.setCursor(9, 0);
      lcd.print(current_Volts);
      
      lcd.print("V");
    }
 
    if ( (current_Volts > 0)  &&  (current_Volts < 190) )
  {
    lcd.setCursor(0, 1);
    lcd.print("Under Voltage");
    digitalWrite(relay, LOW);
     digitalWrite(yellow, LOW);
      digitalWrite(green, HIGH);
  }
  if ( (current_Volts >= 190)  &&  (current_Volts <= 220) )
  {
    lcd.setCursor(0, 1);
    lcd.print("Normal Voltage");
    digitalWrite(relay, HIGH);
    digitalWrite(yellow, LOW);
      digitalWrite(green, LOW);
  }
  if ( current_Volts > 220 )
  {
    lcd.setCursor(0, 1);
    lcd.print("Over Voltage");
    digitalWrite(relay, LOW);
    digitalWrite(yellow, HIGH);
      digitalWrite(green, LOW);
  }
  }
}



Testing: Under & Over Voltage Protection System

After uploading the code, the circuit is ready for testing. Under normal conditions, i.e when the voltage is between 190V to 220V, the load turns on and the system keeps working.

AC Voltage Monitoring System Arduino

If the voltage goes beyond 220V, the load turns off and LCD Displays an Over Voltage message.

Over Voltage Monitoring System Arduino

If the voltage goes below 190V, the load turns off and LCD Displays Under Voltage message.

Under Voltage Monitoring System Arduino

This is how you can monitor the over-voltage and under voltage parameters using Arduino and ZMPT101B Voltage Sensor.


Video Tutorial & Guide

AC Over Voltage & Under Voltage Protection & Monitoring System with Arduino & ZMPT101B
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleBME280 & Raspberry Pi Pico W Web Server Weather Station
Next Article DIY Water Filling Machine using Flow Sensor & Arduino

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 3 Comments

3 Comments

  1. omar on March 27, 2023 6:52 AM

    will i rum the code its give me error

    1nz5vd5.5wql\sketch_mar27a\sketch_mar27a.ino:1:10: fatal error: Filters.h: No such file or directory
    #include
    ^~~~~~~~~~~
    compilation terminated.

    exit status 1

    Compilation error: Filters.h: No such file or directory

    Reply
  2. GIDION on May 28, 2023 3:05 PM

    Error while running the program, how to fix because many lines are subjected to error?

    Reply
  3. Kersi on January 19, 2024 5:28 PM

    Error while compiling in void loop : RunningStatistics not declared in this scope.
    Please advise

    Reply

CommentsCancel reply

Latest Posts

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 14, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • IoT Based PM & Air Quality Monitoring System using ESP32
    IoT Based PM & Air Quality Monitoring System using ESP32
  • How to use LDR Sensor Module with Arduino
    How to use LDR Sensor Module with Arduino
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
    ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
  • Silicon Controlled Rectifier (SCR): Construction, Working & Applications
    Silicon Controlled Rectifier (SCR): Construction, Working & Applications
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.