Arduino AC voltage Monitoring “Over voltage, Normal voltage and Under-voltage
Table of Contents
AC Voltage Monitoring Project Description:
AC voltage Monitoring using Arduino- This tutorial is about the AC voltage monitoring and Protection against Overvoltage and Under voltage. This is part 1 and we will be displaying the voltage on a 16×2 LCD. While in part 2 we will design a SCADA application for monitoring voltage, frequency, load, and disconnection. I will be using the same circuit in part2 as well. In this, we will cover:
- Voltage sensor calculation for monitoring voltages up to 310 volts.
- Complete circuit diagram explanation.
- Programming and finally
- Testing
Amazon Links:
Arduino Nano USB-C Type (Recommended)
*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.
This project is basically based on my previous two tutorials.
This tutorial covers the basics of 16×2 LCD and I have explained everything from soldering to interfacing, so I will be using the same LCD connections. You should watch this tutorial for the best understanding.
While in this tutorial I explained everything about the voltage sensor and how to modify this sensor for monitoring higher voltages. You should watch this tutorial.
As explained in my previous tutorial, this voltage sensor simply consists of two resistors connected in series. the maximum input voltage of this voltage sensor is 25volts. So for 25v we get exactly 5 volts.
Vin = 25v
R1 = 30k ohm
r2 = 7.5k ohm
We can find out the Output voltage, by using the voltage divider formula which is
Vout = ( r2 x vin ) / ( r1 + r2)
vout = (7.5 x 1000 x 25) / (30k + 7.5k)
vout = 187500 / 37500
vout = 5 Volts
If we increase the input voltage the output voltage will also increase above 5v which can damage the analog pin of the controller. So for this we need to add another resistor in series. Let’s say we want to monitor voltages up to 310 volts. Let’s first of all find the current of the voltage sensor.
Using v = ir
v = IR we can find the current
I = V / R
I = 25 / ( 30k + 7.5K)
I = 25 / 37.5K
I = .000666 amps
I = 666 micro amps.
Now lets calculate the value of the resistor, which can be used in series with this voltage sensor to monitor 310volts.
Vx = 310 which is the input voltage
Rx = (Vx – 25 ) / 666 micro amps
Rx = 310 – 25 / 666 micro amps
Rx = .427 x 1000000
Rx = 428k ohm
Using this value of the resistor we can monitor voltages up to 310 volts.
Circuit Diagram of the AC voltage monitoring:
Ac voltage is fed to the bridge rectifier through a fan regulator. This fan regulator will be used for varying the ac voltage, to check if we can successfully detect the over-voltage, normal voltage and under-voltage. This is a full-wave bridge rectifier. The +ve leg of the bridge rectifier is connected with the VCC of the voltage sensor through a 428K ohm resistor, this is the resistor that we just calculated and the ground of the bridge rectifier is connected with the ground of the voltage sensor. A 10uf capacitor is connected with the voltage sensor to get stable values. The s pin of the sensor is connected with the A1 pin of the Arduino and – the pin is connected with the ground.
As you can see ground is connected with pin number 1, 5 and pin number 16…5v from Arduino is connected with pin number 2 and pin number 15…the middle pin of the variable resistor or potentiometer is connected with pin number 3 of the LCD, using this potentiometer we can control the LCD contrast.…while the other two pins are connected with the ground and 5v. Pin’s 4 to 7 of the Arduino are connected with pins D7 to D4 of the LCD.
Pin number 8 of the Arduino is connected with the enable pin of the LCD….pin number 9 of the Arduino is connected with the RS pin of LCD…
Interfacing:
For the interfacing watch video Tutorial given at the End.
AC Voltage Monitoring Arduino Programming:
For the program explanation watch video tutorial given at the end.
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 |
#include <LiquidCrystal.h> #define rs 9 #define en 8 #define d4 7 #define d5 6 #define d6 5 #define d7 4 // initialize the library with the numbers of the interface pins LiquidCrystal lcd(rs, en, d4, d5, d6, d7); String TextForSms ; // FOR THE VOLTAGE SENSOR float correctionfactor = 26; // 77 int analogInput = A1; float vout = 0; int vin = 0; // if we add 428k ohm resistor in series with the module // we can monitor the line voltage upto 310.048 float R1 = 30000 + 428000; // these are the 30k and 428k resistors float R2 = 7500; // 7.5 k int value = 0; void setup() { Serial.begin(9600); // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("Voltage:"); pinMode(analogInput, INPUT); } void loop() { Voltage(); } void Voltage() { // read the value at analog input value = analogRead(analogInput); vout = (value * 5.0) / 1023.0; // see text vin = vout / (R2/(R1+R2)); vin = vin + correctionfactor; //Serial.print("INPUT V= "); //Serial.println(vin); delay(500); lcd.setCursor(10,0); lcd.print(vin); if ( (vin > 0) && (vin < 150) ) { lcd.setCursor(0,1); lcd.print("Under Voltage"); } if ( (vin >= 150) && (vin <= 190) ) { lcd.setCursor(0,1); lcd.print("Normal Voltage "); } if ( vin > 190 ) { lcd.setCursor(0,1); lcd.print("Over Voltage "); } } |
Sir what is the output of the bridge rectifier in ac over and under voltage monetering project….
220v A.c vooltage stabilizer with transformer I need
how did you come about correction factor value of 27??