In this article, we are going to learn how to make a simple voltage protector for your appliances. A small device can save lots of money, saving your appliances from voltage spike/surge/sag and unacceptable voltage range. So let’s make it!
Disclaimer:
Handling electricity carries inherent risks. It’s essential to have the appropriate skills to manage it safely. Proceed at your own risk, as the author disclaims responsibility for any misuse, harm, or errors. All content on this website is unique and copyrighted; please avoid unauthorized copying. While most articles are open-source for your benefit, feel free to use the knowledge provided. If you find our resources helpful, consider purchasing available materials to support our work.
For assistance or guidance, leave a comment below; the author is committed to helping. Some articles may contain affiliate links that support the author with a commission at no additional cost to you. Thank you for your understanding and support.
Table of Contents
What is spike/surge/sag?
Usually, your home supply voltage is either 220V or 110V depending on your region. But this voltage is not always constant. Due to various issues (like switching a large load or line faults and so on) this line voltage can carry a high or low voltage pulse for a short period of time. A voltage spike is a sudden increase in voltage that lasts for less than three nanoseconds & A sudden increase in voltage that lasts for three nanoseconds or more is called a voltage surge.
Voltage sag on the other hand is similar but a sudden voltage drop due to other loads like a heavy motor or heavy switch is turned on. This may also hamper your appliances creating a sudden voltage drop which can generate a restarting issue.
A surge can burn the internal components of your appliance if there is no protection for the spike. Especially the electronic devices are mostly affected by spike & surge. Sag can also damage your appliance but a burning case is rare. A Sag normally interrupts the operation like your PC can be restarted while you are working on an important task on your PC.
These are sudden problems but besides this, a high or low voltage also can happen.
High/Low voltage effect on appliances:
A high or low voltage can appear on your supply line and can stay for a while. That definitely will damage your appliance if it is out of tolerable range. Some appliances may have internal protection but most of them have nothing.
Low voltage also can damage your appliances especially the inductive loads like motors. Because, due to low voltage the motor can stop rotating and once the rotation is stopped, a high current flows through the coils. That kills the coil.
High voltage can also burn the appliances but inductive loads can take little high voltage for a while without problem. Electronic appliances are mainly get harmed due to high voltage.
Protections:
For surge/spike, a MOV or metal-oxide varistor can be used. But complete isolation is always better.
A fuse in first and then a MOV in parallel with the load can effectively protect the appliances from the spike.
This can be applied only for spike/surge but for sag, there is no such easy way to prevent it without using some kind of complex circuit. You can convert the AC supply into DC, store it in capacitors, step up a little bit, then again convert this DC into AC. This way sag can be prevented. But in simple, cutting off the line is possible for while.
Our solution:
To make a device to prevent voltage issues, we can use microcontrollers with some associative circuits. A display can make it user-friendly. So let’s make the circuit diagram first.
Circuit diagram:
Circuit Description:
First, you may use any pins serially for the display but here in my circuit, I used without any serial because of my PCB design. I designed keeping in mind the PCB first. Anyway, among other parts of this circuit is a capacitor power supply.
You can read my article on capacitor power supply from here.
This power supply is suitable for small loads like our project here. The benefits of this type of power supply are these are extremely cheap and durable. One can last a long period of time. One of mine is being running since 2014. Here the circuit is simply reducing the AC 220voltage into 12V DC across the D1. Then a 5V regulator makes a 5V output for our MCU. R3 is important for longer operation and R1 is important to reduce inrush current through C1. C1 should be X2 type, but you can use other types of similar ratings if its quality is good.
On the left side, VR1 is a varistor (MOV). You can keep the Fuse and MOV out of the PCB if you want. In my case, I kept it outside PCB and these are direct fit with the input and output line. Relay here is used for bypassing the input to output.
I used some resistors for sensing the line voltage directly as we are not touching the circuit while it is operating. So, we can use resistors for measurement rather than using any other isolation or transformers. The concept is pretty easy, R9 + RV1 are used to make the fine-tune job. & R8+C6 are for the R-C filter.
PCB:
As I always try to make anything like a usable product, so I design PCBs for them. Similarly here for this project, I designed my PCB and printed it. You can follow my design or you can do it yourself.
And in real life the circuit is:
Programming:
I use mikroC pro for PIC from programming PIC MCUs. Here is the basic code of our voltage protector.
/******************************************************************************* Program for Dual Display voltage Stabilizer v8.2 Program Written by_ Engr. Mithun K. Das; mithun060@gmail.com Compiler: mikroC pro for PIC v7.6.0; Xtal:8Mhz; Date: 10-04-2021 *******************************************************************************/ //pin declerations #define a RB5_bit #define b RB7_bit #define c RC5_bit #define d RB0_bit #define e RC7_bit #define f RB6_bit #define g RB4_bit #define dot RC6_bit #define D1 RB1_bit #define D2 RB2_bit #define D3 RB3_bit //relays #define Relay RC3_bit #define LED RC4_bit void mark(int digit) { switch (digit) { case 0: a=0;b=0;c=0;d=0;e=0;f=0;g=1;dot=1;break; case 1: a=1;b=0;c=0;d=1;e=1;f=1;g=1;dot=1;break; case 2: a=0;b=0;c=1;d=0;e=0;f=1;g=0;dot=1;break; case 3: a=0;b=0;c=0;d=0;e=1;f=1;g=0;dot=1;break; case 4: a=1;b=0;c=0;d=1;e=1;f=0;g=0;dot=1;break; case 5: a=0;b=1;c=0;d=0;e=1;f=0;g=0;dot=1;break; case 6: a=0;b=1;c=0;d=0;e=0;f=0;g=0;dot=1;break; case 7: a=0;b=0;c=0;d=1;e=1;f=1;g=1;dot=1;break; case 8: a=0;b=0;c=0;d=0;e=0;f=0;g=0;dot=1;break; case 9: a=0;b=0;c=0;d=0;e=1;f=0;g=0;dot=1;break; case 10: a=1;b=1;c=1;d=1;e=1;f=1;g=1;dot=1;break; } } void InitTimer0() { OPTION_REG = 0x82; TMR0 = 68; INTCON = 0xA0; } int cnt=0,disp_digit[6]; unsigned int number1=0,number=0; unsigned int display1=0,display2=0; bit dot_en,delay_toggle; int min=0,sec=0,loop; unsigned int line_voltage=0,output_voltage=0; long max_point=0,temp=0,line_voltage_raw=0,output_voltage_raw=0; unsigned int k=0,i=0; void convert_digit() { disp_digit[0] = number/100u; disp_digit[1] = (number/10u%10u); disp_digit[2] = (number/1u%10u); } void Interrupt() iv 0x0004 ics ICS_AUTO { if (TMR0IF_bit) { TMR0IF_bit = 0; TMR0 = 68; number = display1; if(cnt==1) { mark(disp_digit[0]); D1 = 1; D2 = 0; D3 = 0; } else if(cnt==3) { mark(disp_digit[1]); D1 = 0; D2 = 1; D3 = 0; } else if(cnt==5) { mark(disp_digit[2]); D1 = 0; D2 = 0; D3 = 1; } else { mark(10); D1 = 0; D2 = 0; D3 = 0; } if(cnt>=9) { cnt = 0; } cnt++; } } void Read_input_voltage() { //read input voltage ADCON1 = 0x04; ADCON0 = 0x01; //AN0 line_voltage_raw = 0; max_point=0; temp=0; for(i=0;i<10;i++) { for(k=0;k<600;k++) { if(temp=ADC_Read(0),temp>max_point) { max_point = temp; Delay_us(1); } asm CLRWDT; } line_voltage_raw+= (max_point*218/151); asm CLRWDT; } line_voltage=0; line_voltage=(int)line_voltage_raw/10; //get average value line_voltage_raw=0; ADCON1 = 0x07; ADCON0 = 0x00; //AN0 } void main() { TRISA = 0b00010011; TRISB = 0x00; TRISC = 0x00;//all output PORTC = 0x00; PORTB = 0xFF; ADCON1 = 0x04;//ADC settings InitTimer0(); display1 = 0; convert_digit(); Delay_ms(15000);//initial delay for 15s while(1) { Read_input_voltage(); display1 = line_voltage; convert_digit(); if(line_voltage>175 && line_voltage<245) { LED = 1; Relay = 1; } else { LED = 0; Relay = 0; Delay_ms(10000);//10sec } }//while(1) }//end of void main() //
Once you learn this basic code, you can add other features to this product as I did in mine. But this basic code also works fine with your circuit.
There are other functions you can add like delay display, high or low voltage indication, transient trip, permanent trip, and so on.
If you are interested, you can get the PCB and project files from here.
Result:
Here is my product, I tested it with added features.
Conclusion:
You can make one or you can get one, it’s your choice. I gave you both options. But to make a product it needs time and money, so if you want to get one you should pay a little for that. But it’s not forced on you at least. It’s your choice. Anyway, if you read the above article, it will be easy to make your own voltage protector. Thanks, see you in the next article soon.
For Professional Designs or Help:
Read more:
- Connect to Raspberry Pi from your Laptop/Desktop using VNC Viewer
- How to reduce noise from DC motor
- Read ThingSpeak Channel using ESP8266 and Arduino
- Reading SMS with Arduino
- Caller ID detection using Arduino
- Energy-saving innovative power switch for microcontroller circuit
- STM32 as USB Device
- Send SMS from Raspberry Pi using the GSM module
- Make an MPPT Solar charge Controller with Synchronous Buck Converter
12 Comments
R K Hamy · 24/10/2021 at 10:57 am
Many Thanks.
Joy · 25/10/2021 at 8:27 am
Nice. Many Many Thanks.
Moses · 16/12/2021 at 1:47 pm
Sir l do not want the mcu display part. I want to use 3LED OF DIFFERENT COLORS to indicate high, low and normal voltage. Please can you design a schematic for me in that respect just from the one you have given here above.
MKDas · 18/12/2021 at 10:44 am
Simply use 3 LEDs from the pins used for the segment.
Dinesh · 30/12/2021 at 9:28 pm
what is the function of 470k resistor between neutral and ground in schematic..?
MKDas · 30/12/2021 at 9:37 pm
A voltage divider, Explained in https://i0.wp.com/labprojectsbd.com/wp-content/uploads/2021/10/sec.png?ssl=1.
Just not connecting the neutral directly with GND.
Mihail · 02/07/2022 at 4:54 pm
Hi. that is, if we do not touch the microcircuit and the board, then we do not use an operational amplifier to simplify the circuit?
and if we feed the microcircuit from one power source, for example, from a 12v power supply. and we do not use an operational amplifier, but apply voltage directly – what will happen in this case then?
MKDas · 02/07/2022 at 6:10 pm
Can not understand what you are trying to express. Kindly explain.
Salman · 27/04/2023 at 1:30 am
How to download this project
MKDas · 30/04/2023 at 1:44 pm
That option is disabled right now. You can contact via WhatsApp if you need.
KOBIR · 27/01/2024 at 12:14 pm
Sir I wanted to order this voltage protector pcb from you. Because I think you have some mistake or problem in this code. The display I run this code on doesn’t work.
MKDas · 28/01/2024 at 4:18 pm
Use Whatsapp