Arc faults detection system is a system that will automatically detect arc faults, cut power occurring at the electrical circuit system in-house, and reports the situation to the appropriate personnel. In an electric power system, a fault is detected by any abnormal electric current follows. There are two types of an arc fault, series, and parallel arc fault.
System Requirement Analysis
Functional requirements
1. The system shall be able to detect the occurrence of arc fault
2. The system shall be able to provide a mechanism for electrical disconnection to isolate the entire system on the occurrence of a fault
3. The system shall be able to send SMS to the consumer’s mobile phone reporting the occurrence of a fault
4. The system should be able to respond to consumer’s commands whenever is necessary
Non-functional requirements
Hardware Requirement
It will be programmed to be able to control the Ethernet shield to send a report to the user through the internet.
With the presence of this shield the Arduino data can be accessed anywhere in the world since the module can be programmed to have IP, MAC address, subnet mask, and default gateway hence even telnet functionality is possible because of the module
The purpose of changing those ac currents from ac to DC with the same values it’s to enable us to control that accrued behavior of passing currents to determine the presence of arc fault.
Hardware requirement for power supply design: Transformer, Rectifier (bridge rectifier), Capacitor, Voltage regulator, Circuit board, Wires.
Software Requirement
Software like Platform IDE is used for writing and running (executes) codes during the programming of Arduino microcontroller
This is used to simulate the circuit so that the Arduino library in it could give the desired output.
Source Code
//Arc fault detection project
#include <SPI.h>
#include <Ethernet.h>
#include<LiquidCrystal.h>
//LiquidCrystal lcd(13, 12, 7, 6, 5, 4); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)
LiquidCrystal lcd(14, 15, 16, 17, 18, 19);
// ethernet configuration
byte mac[] = { 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };
byte ip[] = { 192, 168, 137, 160 }; // arduino ip in lan
byte gateway[] = { 192, 168, 137, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(80); // port 80 is default for HTTP
// initial
int value;
const float vpp = 0.004887;
float voltage;
float current;
int GreenLed = 22;
int YellowLed = 24;
int RedLed = 26;
int RELAYA = A1;
int Relay1 = A2;
int Relay2 = A3;
int Relay3 = A4;
int Relay4 = A5;
char c = 0; // received data
char command[10] = "\0"; // command
void setup()
{
lcd.begin(16,2);
Ethernet.begin(mac, ip);
server.begin();
Serial.begin(9600);
pinMode(GreenLed, OUTPUT);
pinMode(YellowLed, OUTPUT);
pinMode(RedLed, OUTPUT);
pinMode(RELAYA,OUTPUT);
digitalWrite(RedLed, LOW);
digitalWrite(YellowLed, LOW);
digitalWrite(GreenLed, LOW);
analogWrite(RELAYA,HIGH);
digitalWrite(Relay1, HIGH);
digitalWrite(Relay2, HIGH);
digitalWrite(Relay3, HIGH);
digitalWrite(Relay4, HIGH);
//LCD initialization
lcd.setCursor(0,0);
lcd.write("ARC FAULT SYSTEM");
delay(10);
noTone(1);
tone(28, 950, 1000);
delay(300);
noTone(1);
tone(28, 550, 500);
delay(200);
noTone(1);
tone(28, 550, 500);
delay(200);
noTone(1);
tone(28, 1050, 600);
delay(3000);
}
void loop()
{
EthernetClient client = server.available();
// detect if current is the first line
boolean current_line_is_first = true;
if (client) {
// an http request ends with a blank line
boolean current_line_is_blank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
// if we've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so we can send a reply
if (c == '\n' && current_line_is_blank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
// auto reload webpage every 5 second
client.println("<META HTTP-EQUIV=REFRESH CONTENT=5 URL=>");
// webpage title
client.println("<center><p><h1>Arc fault detection and reporting system control center</h1></p><center><hr><br />");
// read analog pin A0 for the value of current sensor
value= analogRead(A0);
value = value - 512;
voltage = value * vpp;
current = voltage/0.066;
client.print("<p><h2>Current (Amps) = <font color=indigo>");
client.println(current, 2);
client.println("</font></h2></p>");
//Display status to the webpage and on the LCD display
if((current >= 0.0)&& (current < 1.28)) {
client.println("<p><h2><font color=red>Current Overlimit!</font></h2></p>");
Serial.println(current);
digitalWrite(RedLed,LOW);
digitalWrite(YellowLed,LOW);
digitalWrite(GreenLed,HIGH);
//Sound Alarm + LCD display
for (int i=0; i<=5; i++){
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Circuit operate");
noTone(1);
tone(28, 494, 500);
delay(500);
}
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Working!");
delay(500);
lcd.clear();
lcd.setCursor(0,1); // Sets the location at which subsequent text written to the LCD will be displayed
lcd.print("Current= "); // Prints string "current" on the LCD
lcd.print(current); // Prints the current value from the sensor
lcd.print("Amp");
delay(500);
digitalWrite(GreenLed, HIGH);
}
else if((current >= 1.29) && (current < 2)) {
client.println("<p><h2><font color=yellow>Current is increasing</font></h2></p>");
Serial.println(current);
digitalWrite(YellowLed, HIGH);
digitalWrite(RedLed, LOW);
digitalWrite(GreenLed, LOW);
digitalWrite(RELAYA, HIGH);
noTone(1);
tone(28, 950, 100);
delay(300);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Current increases");
delay(500);
lcd.setCursor(0,1); // Sets the location at which subsequent text written to the LCD will be displayed
lcd.print("Current= "); // Prints string "current" on the LCD
lcd.print(current); // Prints the current value from the sensor
lcd.print("Amp");
delay(500);
}
else if(current >=2.1){
client.println("<p><h2><font color=green>Normal current</font></h2></p>");
Serial.println(current);
digitalWrite(RedLed,HIGH);
digitalWrite(YellowLed, LOW);
digitalWrite(GreenLed, LOW);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Arc faults");
delay(1000);
digitalWrite(RELAYA,LOW);
delay(500);
lcd.setCursor(0,1); // Sets the location at which subsequent text written to the LCD will be displayed
lcd.print("Current= "); // Prints string "current" on the LCD
lcd.print(current); // Prints the current value from the sensor
lcd.print("Amp");
delay(500);
}
else {
digitalWrite(RELAYA, HIGH);
}
// button functions
client.println("<form method=get name=form>");
client.println("<button name=b value=1 type=submit style=height:80px;width:150px>Turn ON System</button>");
client.println("<button name=b value=2 type=submit style=height:80px;width:150px>Turn OFF System</button>");
client.println("</form><br />");
client.println("<form method=get name=form>");
client.println("<button name=b value=3 type=submit style=height:80px;width:150px>Turn ON Relay 1</button>");
client.println("<button name=b value=4 type=submit style=height:80px;width:150px>Turn OFF Relay 1</button>");
client.println("</form><br />");
client.println("<form method=get name=form>");
client.println("<button name=b value=5 type=submit style=height:80px;width:150px>Turn ON Relay 2</button>");
client.println("<button name=b value=6 type=submit style=height:80px;width:150px>Turn OFF Relay 2</button>");
client.println("</form><br />");
client.println("<form method=get name=form>");
client.println("<button name=b value=7 type=submit style=height:80px;width:150px>Turn ON Relay 3</button>");
client.println("<button name=b value=8 type=submit style=height:80px;width:150px>Turn OFF Relay 3</button>");
client.println("</form><br />");
client.println("<form method=get name=form>");
client.println("<button name=b value=9 type=submit style=height:80px;width:150px>Turn ON Relay 4</button>");
client.println("<button name=b value=10 type=submit style=height:80px;width:150px>Turn OFF Relay 4</button>");
client.println("</form><br />");
// webpage footer
client.println("<p>This page will automatically refresh every 5 seconds.</p></center>");
break;
}
if (c == '\n') {
// we're starting a new line
current_line_is_first = false;
current_line_is_blank = true;
}
else if (c != '\r') {
// we've gotten a character on the current line
current_line_is_blank = false;
}
// get the first http request
if (current_line_is_first && c == '=') {
for (int i = 0; i < 1; i++) {
c = client.read();
command[i] = c;
}
// LED control
if (!strcmp(command, "1")) {
digitalWrite(RELAYA, HIGH);
}
else if (!strcmp(command, "2")) {
digitalWrite(RELAYA, LOW);
}
if (!strcmp(command, "3")) {
digitalWrite(Relay1, HIGH);
}
else if (!strcmp(command, "4")) {
digitalWrite(Relay1, LOW);
}
if (!strcmp(command, "5")) {
digitalWrite(Relay2, HIGH);
}
else if (!strcmp(command, "6")) {
digitalWrite(Relay2, LOW);
}
if (!strcmp(command, "7")) {
digitalWrite(Relay3, HIGH);
}
else if (!strcmp(command, "8")) {
digitalWrite(Relay3, LOW);
}
if (!strcmp(command, "9")) {
digitalWrite(Relay4, HIGH);
}
else if (!strcmp(command, "10")) {
digitalWrite(Relay4, LOW);
}
}
}
}
// give the web browser time to receive the data
delay(1);
client.stop();
}
else {
// read analog pin A0 for the value of current sensor
value= analogRead(A0);
value = value - 510;
voltage = value * vpp;
current = voltage * 500;
if(current <= 1.28) {
Serial.println(current);
digitalWrite(YellowLed, LOW);
digitalWrite(RedLed, LOW);
//Sound Alarm + LCD display
for (int i=0; i<=5; i++){
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" System Normal");
digitalWrite(GreenLed, HIGH);
noTone(1);
tone(28, 494, 500);
delay(500);
}
lcd.clear();
lcd.setCursor(0,0);
lcd.print("System working");
delay(500);
lcd.clear();
lcd.setCursor(0,1); // Sets the location at which subsequent text written to the LCD will be displayed
lcd.print("Current="); // Prints string "current" on the LCD
lcd.print(current); // Prints the current value from the sensor
lcd.print("Amp");
delay(500);
}
else if((current >= 1.29) && (current < 2)) {
Serial.println(current);
digitalWrite(YellowLed, HIGH);
digitalWrite(RedLed, LOW);
digitalWrite(GreenLed, LOW);
digitalWrite(RELAYA, HIGH);
noTone(1);
tone(28, 950, 100);
delay(300);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Standard");
delay(500);
lcd.setCursor(0,1); // Sets the location at which subsequent text written to the LCD will be displayed
lcd.print("Current= "); // Prints string "current" on the LCD
lcd.print(current); // Prints the current value from the sensor
lcd.print("Amp");
delay(500);
}
else if(current >=2 ){
Serial.println(current);
digitalWrite(GreenLed, LOW);
digitalWrite(YellowLed, LOW);
digitalWrite(RedLed, HIGH);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Arc Faults");
delay(500);
digitalWrite(RELAYA,LOW);
lcd.setCursor(0,1); // Sets the location at which subsequent text written to the LCD will be displayed
lcd.print("Current="); // Prints string "current" on the LCD
lcd.print(current); // Prints the current value from the sensor
lcd.print("Amp");
delay(500);
}
else {
digitalWrite(RELAYA, HIGH);
}
}
}
//mussacharles60.blogspot.com