Smart under and over voltage protection system for home

Smart under and over voltage protection system for home is designed to insure protection of home devices like fan, light lamps, television, refrigerator and all other things you need to protect in case of under and over voltage in main supply. Although there are circuit breakers available in market to provide protection against under and over voltage. But once circuit breaker detect problem in main power supply voltage it turn off main power AC power supply to home devices permanently. Until someone manually press the button on circuit breaker again. The main disadvantage of circuit breaker is that you have to control it manually.The main objective of this project is to add automatic functionality to turn off and turn on main power supply to home devices in case of over voltage and under voltage of main power supply.

All electrical devices can bear voltage up to certain limits. For example your home fan normal operating voltage is 220 volt AC. If voltage input to fan become greater than or less than about 20%  of normal operating voltage of fan it many burn your fan and in case of less voltage fan excessive current may flow which in turn cause short circuit in your home wiring. To avoid all these issues this project is designed which automatically turn on and turn off main power supply in case of issue in AC main power supply and on one need to control it manually. Microcontroller is embedded into this system to make it smart enough to handle all the issues intelligently and to provide control signals to turn on and off AC main power supply.

Circuit diagram description :

Followings are the main components of  this project. I have explained function of each component used in this project. But you can modify each component rating according to your requirement.

Voltage sensor :

Voltage sensor is used to measure voltage of AC main power supply. Voltage sensor is used difference amplifier to to step down voltage level from 220 volt AC to  2.8 volt AC or 311 volt peak of AC voltage to 3.96 volt of peak voltage of sine wave. Difference amplifier is used as a signal conditioning circuit to convert high voltage of AC main supply into low voltage which microcontroller can easily read. Because microcotroller analog to digital converter can not read voltage more than 5 volt and voltage more than 5 volt damage microcontroller. So difference amplifier as a signal conditioning circuit is used to step down voltage by adjusting the gain of difference amplifier. If you want to know more about voltage sensor read following article :

Digital Alternating voltage meter using pic microcontroller 
High speed relay :

Relay is used to to turn on and turn off main power supply. Relay get control signal from microcontroller through a transistor. Diode is use in parallel with coil pin of relay to avoid sparking in case of back emf. Because coil is made of inductive material. Selection of relay depends on load of your home. For example maximum load of your home devices is 10 ampere. So should use 10 ampere relay. Another important thing while selecting relay for this circuit is switching speed of relay. Your relay speed should be as fast as possible. Because more the switching speed of relay, more protection it will provide to your devices by turning them on or off in minimum possible time.

Liquid crystal Display :

LCD is used to display value of voltage and status of your power supply. If  AC voltage of main power supply is greater than 20% of normal operating voltage, LCD display ” fault occur”. Otherwise LCD display ” No fault”. LCD also displays value of AC main voltage supply.

Voltage regulators :

7805 and 7812 is used to get regulated 5 and 12 volt which is supply voltage for microcontroller and relay respectively. 220 to 12 volt step down transformer and rectifier full bridge is used to produce DC voltage which is input of voltage regulators.

PIC16F877A microcontroller :

PIC16F877A microcontroller is use to make this project intelligent and smart. ADC of Pic microcontroller is used to measure analog AC voltage. Control signals from pic microcontroller is used to turn on or off transistor which control the relay. Microcontroller read the analog value of voltage and display it on LCD. Actually embedding this microcontroller make this project intelligent and smart enough so that it can take control actions automatically in case of under and over voltage.It can also automatically turn on or off power supply without having need of any person.

Circuit Diagram :

Circuit diagram of under and over voltage protection system is shown below. I have used just a lamp for simulation in this circuit. But you should connect this circuit at main panel of your home from where AC main power supply connections have taken for your home devices. Circuit diagram below shows when voltage is 220 volt AC or less than of normal operating voltage lamp is on and relay is working. Because relay is used as normally closed mode. But when voltage become greater than or less than normal operating voltage it will turn off relay in minimum possible time and relay in return turn off main AC power to ensure safety of devices.

circuit diagram of Smart under and over voltage protection system for home when no fault occur:

circuit diagram of Smart under and over voltage protection system for home
circuit diagram of Smart under and over voltage protection system for home

circuit diagram of Smart under and over voltage protection system for home when fault occur :

circuit diagram of Smart under and over voltage protection system for home when fault occur
circuit diagram of Smart under and over voltage protection system for home when fault occur

I have not used step down transformer along with full bridge rectifier in above circuit just for simulation purpose and I have connect 12 volt AC power supply directly with full bridge rectifier. While using this circuit practically you should use 220-12 step down transformer. Complete circuit diagram is shown in schematic below.

Schematic and PCB

Circuit diagram below shows schematic and PCB diagram of this project.

Smart under and over voltage protection system for home :
Smart under and over voltage protection system for home
Smart under and over voltage protection system for home

[button-brown url=”http://store.microcontrollerslab.com/product/smart-under-and-over-voltage-protection-system-for-home/” target=”_blank” position=”center”]Buy code and proteus simulation in 40$[/button-brown]

you can also add more functionality in this project by adding GSM to send value and status of AC main power supply to your home cell number. If you have any issue after reading this article, your comments are welcome. I recommend you to write your own code for this project.  But if you want to purcahse circuit diagram, PCB and code of this project, comment on this post with your email address.

89 thoughts on “Smart under and over voltage protection system for home”

  1. thanks for you , it is avery good project , can you send to me the circuit diagram , the code and the pcb , and thanks for you .

    Reply
  2. hi for ac voltage measurements i usually rectifier the ac voltage and then step down the voltage using a voltage divider network to scale it to 5volts and usually insert a filtering cap of 10uf this is then sent to any adc channel
    in my code i use a multiplication factor for instance
    peak ac voltage 400vac
    mult fac=400/1023=0.391/step
    so if adcvalue is 614 we would have 0.391*614=240vac this works well for me

    Reply
    • yup this is another way to measure AC voltage but it need more components and it is expensive method. I have used just simple amplifier to do all these things.

      Reply
  3. Idea of this circuit is good. But I am confused that in worse case Transformer will burn out due to over voltage, so how to protect it? and due to transformer burning, whole circuit will be switched off and then supply would be bypassed directly with control.

    Reply
  4. Hi Bilal Malik,

    As our local electricity supply is 230V 50Hz, I would like to know if it can be modified from 220V to 230V.

    Can we adjust the high limit voltage to 245V and the low limit to 200V?

    Does your Smart device incorporate a retriggerable monostable as a form of delay to accommodate the short-lived voltage drop in mains supply?

    Is it possible to adjust the delay from 15s to 5 minutes?

    Do you have ready assembled PCB with microcontroller?

    Thanking you before hand.

    Reply
  5. Hi,

    Please send circuit diagram, PCB and code of this project for me.

    Thanks and best regards,

    M I Joomun

    Reply
  6. As our local electricity supply is 230V 50Hz, I would like to know if it can be modified from 220V to 230V.

    Can we adjust the high limit voltage to 245V and the low limit to 200V?

    Does your Smart device incorporate a retriggerable monostable as a form of delay to accommodate the short-lived voltage drop in mains supply?
    Is it possible to adjust the delay from 15s to 5 minutes?
    instead of using difference amplifier can I use potential transformer and voltage divider circuit so that we can map the voltage to the range required by pic for measurement and doing decission of cut off according to the high and low voltage range we need?
    Transformer will burn out due to over voltage, so how to protect it?
    THANK YOU
    Do you have ready assembled PCB with microcontroller?

    Thank you

    Reply
  7. Sir,
    This is a very good article. I would like to develop one like this for a current control purpose. That is for over current and under current alarms. The idea is to pass current thru a known resistance and convert in to voltage and to use a modified code of yours. Please provide me the code for this project.
    Regards
    Muhamed Salim

    Reply
  8. Sir,

    May i ask if the primary voltage of transformer is 220V? then the supply for electronic component (micro controller) is the secondary volts which may be around 3 to 12V? if the device sense a over/under voltage like 250V or 190V what will be the secondary voltage output to supply for micro controller and other electronic component to run? maybe it will cause a failure for device first? or is there any other supply for electronic component like battery to run in its desired voltage input?

    Reply
  9. Good design idea Bilal,
    But my worry is the safety of your design when in use. Using an Opamp to sense high voltage a.c gives me goose bumps.
    Wouldn’t a step down transformer do the job? At least it provides isolation.

    Reply
  10. thnaks for this tourmondes project realy .i like this project specialy for my country .i am 5th year electrical and computer engineering and i am trying to do this project for my final sinor project .i don’t have a way to pay u b/c we don’t have such a system to pay u i need the pcb and code of this project please can i have them.if u can help me send me pcb and the code with this email hizkielgeremew@ymail.com

    Reply
  11. write c#program 16f877a microcontroller based overvoltage and undervoltage protective device
    when voltage>242 is overvoltage,voltage<198 is undervoltage and voltage between 198 and 242 is normal

    Reply
  12. Thank you so much, this site is going to be very helpful to me and i guess to others too.
    Please i am very interested in this automatic over-voltage and under-voltage protector project, i want to practically build one for my house. Can you be of help?

    Reply
  13. Hello Bilal Malik Sir,
    I have a query. I have downloaded the “PROTECTION.hex” file you have provided and integrated in the PIC16F877A. In the difference amplifier, I am giving the Amplitude of 311V (for 220v), the LCD is showing 220v (No Fault) and for for the amplitude of 340V (240V), the LCD is showing 240v (No Fault). Everything is working really fine.
    Then I realized that the circuit trips (Shows fault) when the voltage reaches to 260V in the LCD.
    I want to change this part. As I have .HEX file, is there any way where I can convert the .hex to C language ? And Can you please point out that which part of this code is needed to change?
    Your project is really awesome, but if you help me a little, it will be very much appreciable.
    Thanks in advance

    Reply
  14. HI BOOSE BILAL Malik
    I LIKE TO SAY THANKS FOR YOUR EFFORT AND YOUR PROJECT IS SO IMPORTANT
    BUT I NEED TO SEND ME THE CODE OR PROGRAM AND VALUES FOR RESISTERS AND CAPACITORS

    Reply
  15. hello Mr. BILAL Malik
    I like your project much
    But try to help us to get a circuit diagram, PCB and code of this project
    The way you are giving us to download is not work help us!!!!

    Reply

Leave a Comment