Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO GSM-Controlled Cable Fault Detector with Relay Actuation and Alert System

View and Edit Project In Cirkit DesignerImage of Arduino UNO GSM-Controlled Cable Fault Detector with Relay Actuation and Alert System

Circuit Documentation

Summary

This circuit is designed to monitor the status of various cables using an Arduino UNO as the central processing unit. It features a GSM module (Sim800l) for sending SMS alerts, a 12V power supply, a 4-channel 5V relay module, a ULN2803 Darlington Array for driving the relays, multiple toggle switches, resistors, LEDs of different colors (red, yellow, blue), a buzzer, and a 16x2 LCD for displaying status messages. The circuit is capable of detecting faults in cables and alerting the user via SMS while also indicating the status through LEDs and an audible buzzer.

Component List

Wiring Details

Sim800l GSM Module

Arduino UNO

12V Power Supply

Relay 4 Channel 5V

ULN2803 Darlington Array

Toggle Switch

Resistor

LED (Red, Yellow, Blue)

Buzzer

16X2 LCD

MKE-M04 Potentiometer Module

Documented Code

#include <LiquidCrystal.h>
#include <SoftwareSerial.h>

// Pin Definitions
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  // LCD pins (RS, E, D4, D5, D6, D7)
SoftwareSerial sim800(7, 8);            // GSM module on pins 7 and 8

// Define pins for switches and LEDs
const int switch1 = A0;
const int switch2 = A1;
const int switch3 = A2;
const int switch4 = A3;

const int redLED = 9;
const int yellowLED = 10;
const int blueLED = 6;

const int relay1 = 13;
const int relay2 = 12;
const int relay3 = 11;
const int buzzer = 5;

void setup() {
  // Set up LCD and GSM module
  lcd.begin(16, 2);
  sim800.begin(9600);

  // Set pin modes
  pinMode(switch1, INPUT);
  pinMode(switch2, INPUT);
  pinMode(switch3, INPUT);
  pinMode(switch4, INPUT);
  
  pinMode(redLED, OUTPUT);
  pinMode(yellowLED, OUTPUT);
  pinMode(blueLED, OUTPUT);
  
  pinMode(relay1, OUTPUT);
  pinMode(relay2, OUTPUT);
  pinMode(relay3, OUTPUT);
  pinMode(buzzer, OUTPUT);

  lcd.print("Cable Monitor");
  delay(1000);
}

void loop() {
  int switch1State = digitalRead(switch1);
  int switch2State = digitalRead(switch2);
  int switch3State = digitalRead(switch3);
  int switch4State = digitalRead(switch4);

  lcd.clear();
  
  // Monitor switch1 (Cable 1)
  if (switch1State == LOW) {  // Fault detected
    lcd.setCursor(0, 0);
    lcd.print("R+ Fault Found");
    digitalWrite(redLED, HIGH);
    digitalWrite(relay1, HIGH);
    digitalWrite(buzzer, HIGH);
    sendSMS("Fault detected in R+ line");
  } else {
    digitalWrite(redLED, LOW);
    digitalWrite(relay1, LOW);
    digitalWrite(buzzer, LOW);
    lcd.setCursor(0, 0);
    lcd.print("R+ OK");
  }

  // Monitor switch2 (Cable 2)
  if (switch2State == LOW) {  // Fault detected
    lcd.setCursor(0, 1);
    lcd.print("Y+ Fault Found");
    digitalWrite(yellowLED, HIGH);
    digitalWrite(relay2, HIGH);
    digitalWrite(buzzer, HIGH);
    sendSMS("Fault detected in Y+ line");
  } else {
    digitalWrite(yellowLED, LOW);
    digitalWrite(relay2, LOW);
    digitalWrite(buzzer, LOW);
    lcd.setCursor(0, 1);
    lcd.print("Y+ OK");
  }

  // Monitor switch3 (Cable 3)
  if (switch3State == LOW) {
    lcd.setCursor(0, 1);
    lcd.print("B+ Fault Found");
    digitalWrite(blueLED, HIGH);
    digitalWrite(relay3, HIGH);
    digitalWrite(buzzer, HIGH);
    sendSMS("Fault detected in B+ line");
  } else {
    digitalWrite(blueLED, LOW);
    digitalWrite(relay3, LOW);
    digitalWrite(buzzer, LOW);
    lcd.setCursor(0, 1);
    lcd.print("B+ OK");
  }

  // Additional switches (like switch4) can be added similarly

  delay(1000);  // Delay to stabilize readings
}

// Function to send SMS using GSM module
void sendSMS(String message) {
  sim800.println("AT+CMGF=1");    // Set SMS mode
  delay(1000);
  sim800.println("AT+CMGS=\"+1234567890\"");  // Replace with your phone number
  delay(1000);
  sim800.print(message);
  delay(1000);
  sim800.write(26);  // Send Ctrl+Z to end the message
  delay(1000);
}

This code is responsible for reading the state of the switches connected to the Arduino UNO and activating corresponding LEDs, relays, and the buzzer based on the switch states. It also sends an SMS alert through the Sim800l GSM module when a fault is detected. The 16x2 LCD displays the status of each cable being monitored.