How to Make an AC Over and Under Voltage Protection Device with Arduino
This article explains how to design and build an AC over and under voltage protection device using Arduino. The AC over and under voltage protection device helps safeguard electrical appliances from voltage fluctuations. By following this step-by-step guide, you will learn the circuit diagram, working principle, and the bill of materials needed for the AC over and under voltage protection device. The AC over and under voltage protection device uses an LM358 IC, resistors, relay, and Arduino.
You will also learn how the AC over and under voltage protection device senses voltage levels, disconnects unsafe supply, and reconnects automatically when conditions are stable. This AC over and under voltage protection device project is beginner-friendly yet practical for home and industrial applications. Build your own AC over and under voltage protection device today to protect equipment effectively.
Introduction
Voltage fluctuations are common in many areas and can lead to premature failure of appliances. An AC over and under voltage protection device is designed to automatically cut off the load when the voltage is outside a safe range. This prevents overheating, insulation damage, and malfunction of electronic systems.
Using Arduino as the control unit, this project provides flexibility, ease of calibration, and visual monitoring with an LCD.
Working Principle
The device continuously senses the input AC voltage through a resistor divider network. This reduced voltage is fed into the LM358 operational amplifier, which acts as a buffer and comparator. The processed signal is read by the Arduino’s analog input pin.
- If the voltage is within the set safe range (e.g., 190–250V AC), the relay energizes and powers the load.
- If the voltage goes below or above the threshold, Arduino deactivates the relay, disconnecting the load instantly.
- The LCD shows real-time voltage readings and the relay status.
- Push buttons allow setting upper and lower cut-off values as per requirement.
Circuit Diagram Explanation
- Voltage Divider Network: Multiple 470kΩ resistors in series reduce the high AC voltage to a safe measurable level for Arduino (0–5V).
- LM358 IC: Conditions the signal, ensures stability, and isolates the microcontroller.
- Arduino Uno/Nano: Reads analog voltage, compares it with threshold limits, and controls the relay.
- Relay Driver (BC547 Transistor + Diode): Transistor amplifies current to drive the relay coil. The diode provides flyback protection.
- Relay: Connects/disconnects the AC line to the load.
- LCD (I2C): Displays voltage and system status.
- Push Buttons: Allow calibration and setting of under/over-voltage limits.
Download Circuit Diagram

Materials for the Project
Component | Value/Model | Quantity | Buy Link |
---|---|---|---|
Arduino Nano | ATmega328P | 1 | Buy Here |
LM358 IC | Dual Op-Amp | 1 | Buy Here |
Resistors | 470kΩ, 10kΩ, 4.7kΩ, 2.2kΩ, 1kΩ | As per circuit | Buy Here |
Transistor | BC547 NPN | 1 | Buy Here |
Relay | 5V SPDT | 1 | Buy Here |
Diode | 1N4148 | 1 | Buy Here |
Push Buttons | Momentary | 3 | Buy Here |
LCD Display | 16×2 with I2C module | 1 | Buy Here |
Terminal Blocks | 2-pin | 3 | Buy Here |
Jumper Wires | Male/Female | As required | Buy Here |
Power Supply | 5V regulated | 1 | Buy Here |
Useful Tools
Tool | Quantity | Purpose / Notes | Click & Buy |
---|---|---|---|
Soldering Iron Kit | 1 | For making permanent connections | Click & Buy |
Solder Wire (60/40, 0.8mm) | 1 | Electrical soldering | Click & Buy |
Wire Stripper & Cutter | 1 | Stripping jumper wires | Click & Buy |
Mini Screwdriver Set | 1 | For module and relay terminal screws | Click & Buy |
Multimeter | 1 | Testing voltages and continuity | Click & Buy |
Hot Glue Gun (optional) | 1 | Securing components in place | Click & Buy |
Small Pliers | 1 | Holding and bending wires | Click & Buy |
Heat Shrink Tubing Set | 1 | Insulating exposed wires | Click & Buy |
Step-by-Step Building Guide
Step 1: Power Connections
- Connect a 2-pin terminal block to Arduino’s 5V and GND.
- This supplies power to external components.
Step 2: LM358 IC Setup
- Pin 4 → GND,
- Pin 8 → +5V.
- Connect 10kΩ resistor between pins 6 and 7.
- Connect 4.7kΩ resistor from pin 6 to GND.
- Connect 2.2kΩ resistor from pin 5 to GND.
- Series of 470kΩ resistors form the voltage divider from AC line to pin 5.
Step 3: LCD Connection
- VCC → 5V,
- GND → GND,
- SDA → A4,
- SCL → A5.
Step 4: Push Buttons
- First button: D3 → GND.
- Second button: D4 → GND.
- Third button: D5 → GND.
Step 5: Relay Driver Circuit
- BC547 transistor: Pin 3 → GND.
- 1kΩ resistor from Arduino D2 → base of BC547 (pin 2).
- Relay coil: one end → +5V, other → transistor collector (pin 1).
- Flyback diode (1N4148) across relay coil.
Step 6: Relay to Load
- AC Line → Relay common terminal.
- Relay NO (normally open) → Output terminal block.
- Neutral connected directly to load.
Arduino Code Upload
Upload the Arduino sketch to read ADC values, calculate AC RMS voltage, compare with thresholds, and control the relay accordingly. The code also handles LCD display and button calibration.
Arduino Code
Testing and Operation
- Power up the circuit.
- Set under and over-voltage limits using buttons.
- Observe LCD showing real-time voltage.
- When voltage goes outside the safe range, relay clicks OFF.
- When voltage stabilizes, relay automatically clicks ON, reconnecting the load.
Applications
- Protecting refrigerators, air conditioners, and washing machines.
- Safeguarding computers, routers, and sensitive electronics.
- Industrial motor protection against voltage fluctuations.
- Automatic cut-off for rural areas with unstable power supply.
FAQs
Q1: Can I set custom voltage limits?
Yes, the push buttons allow you to set desired upper and lower thresholds.
Q2: What happens if the Arduino hangs?
A watchdog timer or hardware bypass can be added for extra reliability.
Q3: Can I use ESP32 instead of Arduino?
Yes, ESP32 provides extra features like Wi-Fi monitoring of voltage data.
Q4: Is the circuit safe for direct AC?
The voltage divider ensures safe scaling, but always use proper insulation and caution when working with mains AC.
Q5: What load capacity can this handle?
Depends on relay rating. A 5A or 10A relay is suitable for most home appliances.
Conclusion
The AC over and under voltage protection device is a practical DIY solution to protect electrical appliances from dangerous voltage fluctuations. Using Arduino, LM358 IC, and a simple relay driver circuit, this project is affordable and reliable for both home and small industrial use. By building this device, you gain hands-on experience with analog sensing, voltage dividers, and relay control.