Over load monitoring and Protection using Arduino & ACS712 Current sensor
Table of Contents
Over Load monitoring ProjectDescription:
over load monitoring using Arduino- In this tutorial, you will learn how to make an overload monitoring system using Arduino and ACS712 current sensor. This is the second part of the SCADA application based grid station parameters monitoring system.
While the first part was based on the AC voltage monitoring system. In which we successfully monitored the Normal voltage, overvoltage, and under-voltage. So far we can monitor the voltage and load on our SCADA application, if we increase the voltage above a pre-defined value It will provide the automatic disconnection. while during the normal voltage the led remains ON. Now if I decrease the voltage below a certain pre-defined value, it will provide automatic disconnection and the led will be turned off. In the end, we will connect a relay with pin number 13 so that in case of overvoltage or under voltage the supply can be disconnected to protect our appliances from any damage.
For demonstration purposes, this project is designed in such a way that it shows normal load for one light bulb and overload status when another bulb is connected or the load is increased. For the best understanding watch video tutorial. The load value can be set in the programming as per your requirements….
In this tutorial, we will cover
- ACS712 current sensor Pinouts
- Complete circuit diagram
- Interfacing
- 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 is the ACS712 current sensor.
as you can see it has three male headers labeled as vcc..out and ground…vcc will be connected with the Arduino’s 5v..the out pin will be connected with the Arduino’s Analog pin A1 and the ground will be connected with the Arduino’s ground..
over load monitoring Circuit Diagram:
This is the complete circuit diagram of the over load monitoring system, this schematic is designed in cadsoft eagle 9.1.0 version. If you want to learn how to make schematics and pcb’s then watch my tutorial.
This is the ACS712 Current sensor, the vcc is connected with the Arduino’s 5v, the ground is connected with the Arduino’s ground and the out is connected with the Arduino’s analog pin A1…This current sensor is connected in series…The relay is connected with pin number 13 of the Arduino… This relay provides the disconnection when load is increased… For the relay driver circuit design calculations watch my tutorial, the link is given in the description.
Cut any of the two wires and connect the current sensor in series…now let’s fix the current sensor , Arduino and relay module on a hard board….Now its ready for the interfacing…connect red jumper wire with the vcc of the current sensor….connect yellow wire with the out pin of the sensor and finally connect white wire with the ground…now connect red wire with 5v, white wire with the ground and yellow wire with the analog pin A1…connect the relay module with pin number 13… and connect the blue wire which is the ground wire with the Arduino’s Ground…
Over load Monitoring Arduino Programming:
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 |
int x,y; const int currentPin = 1; // current sensor connected with analog pin A1 int relay1 = 13; int flag1 = 0; float load = 3; const unsigned long sampleTime = 100000UL; // sample over 100ms, it is an exact number of cycles for both 50Hz and 60Hz mains const unsigned long numSamples = 250UL; // choose the number of samples to divide sampleTime exactly, but low enough for the ADC to keep up const unsigned long sampleInterval = sampleTime/numSamples; // the sampling interval, must be longer than then ADC conversion time const int adc_zero = 510; // relative digital zero of the arudino input from ACS712 (could make this a variable and auto-adjust it) void setup() { Serial.begin(9600); pinMode(currentPin, INPUT); pinMode(relay1, OUTPUT); digitalWrite(relay1, LOW); } void loop() { unsigned long currentAcc = 0; unsigned int count = 0; unsigned long prevMicros = micros() - sampleInterval ; while (count < numSamples) { if (micros() - prevMicros >= sampleInterval) { int adc_raw = analogRead(currentPin) - adc_zero; currentAcc += (unsigned long)(adc_raw * adc_raw); ++count; prevMicros += sampleInterval; } } float rms = sqrt((float)currentAcc/(float)numSamples) * (75.7576 / 1024.0); //Serial.println(rms); //Serial.println("\n"); // delay(1000); Serial.println(currentAcc); delay(1000); if(( currentAcc >= 2500) && (flag1 == 1)) { digitalWrite(relay1, HIGH); Serial.println("load exceeded"); flag1 = 0; } if(( currentAcc < 2500) && (flag1 == 0)) { digitalWrite(relay1, LOW); Serial.println("normal Load"); flag1 = 1; } } |