Arduino UNO GSM-Controlled Cable Fault Detector with Relay Actuation and Alert System
View and Edit Project In Cirkit Designer
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
- Sim800l GSM Module: A GSM/GPRS module for cellular communication, capable of sending SMS messages.
- Arduino UNO: A microcontroller board based on the ATmega328P, used for controlling the logic of the circuit.
- 12V Power Supply: Provides the necessary power to the circuit.
- Relay 4 Channel 5V: A module with 4 relays to control high power devices.
- ULN2803 Darlington Array: An 8-channel Darlington transistor array for driving high current loads.
- Toggle Switch: A switch to manually open or close the circuit.
- Resistor: A component used to limit current or divide voltages in the circuit.
- LED (Red, Yellow, Blue): Light Emitting Diodes used as visual indicators for circuit status.
- Buzzer: An audible alarm device to indicate different statuses.
- 16X2 LCD: A liquid crystal display for showing messages or status information.
- MKE-M04 Potentiometer Module: A module with a potentiometer used for analog input.
Wiring Details
Sim800l GSM Module
- NET: Not connected in this documentation.
- RST: Not connected in this documentation.
- VCC: Connected to the 12V power supply and Arduino UNO Vin.
- RXD: Connected to Arduino UNO D1 (TX).
- TXD: Connected to Arduino UNO D0 (RX).
- GND: Connected to the ground of the 12V power supply and Arduino UNO GND.
Arduino UNO
- Vin: Connected to the 12V power supply.
- GND: Common ground for the circuit.
- 5V: Powers the 16X2 LCD and MKE-M04 Potentiometer Module.
- A0-A3: Connected to toggle switches through resistors.
- D0-D13: Various connections to the Sim800l, ULN2803, 16X2 LCD, LEDs, and buzzer.
12V Power Supply
- +: Powers the Arduino UNO Vin, Sim800l VCC, and Relay 4 Channel 5V VCC.
- -: Common ground for the circuit.
Relay 4 Channel 5V
- GND: Connected to the common ground.
- IN1-IN4: Controlled by the ULN2803 Darlington Array outputs.
- VCC: Powered by the 12V power supply.
- COM1-COM4: Connected to the 12V power supply.
- NO1-NO4: Connected to resistors leading to toggle switches.
ULN2803 Darlington Array
- I1-I8: Inputs from Arduino UNO D2-D5.
- O1-O4: Outputs to Relay 4 Channel 5V IN1-IN4.
- GND: Common ground.
- COMMON: Connected to Arduino UNO Vin.
Toggle Switch
- COM: Connected to resistors and relay NO contacts.
- L1: Not connected in this documentation.
- L2: Connected to resistors and other toggle switches.
Resistor
- pin1: Connected to various components such as Arduino UNO analog pins, LEDs, and toggle switches.
- pin2: Connected to common ground or other resistors.
LED (Red, Yellow, Blue)
- cathode: Connected to common ground.
- anode: Connected to resistors which are then connected to Arduino UNO pins.
Buzzer
- POSITIVE: Connected to Arduino UNO D12.
- NEGATIVE: Connected to common ground.
16X2 LCD
- VSS, RW, K: Connected to common ground.
- VDD, A: Powered by Arduino UNO 5V.
- V0: Connected to MKE-M04 Potentiometer Module SIG.
- RS, E, D4-D7: Connected to Arduino UNO digital pins.
MKE-M04 Potentiometer Module
- GND: Common ground.
- 5V: Powered by Arduino UNO 5V.
- SIG: Connected to 16X2 LCD V0.
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.