This guide outlines how to create an IoT-based system to monitor power failures in a three-phase electrical setup and receive SMS alerts. The system uses sensors and IoT technology to detect power outages and notify users via SMS.
Components Required
- Microcontroller (e.g., Arduino, ESP8266, or ESP32)
- Three-phase voltage sensor
- SIM800L or GSM module for SMS functionality
- Power supply for the microcontroller and GSM module
- Connecting wires and breadboard
- Enclosure to house the electronics
- SIM card with SMS capability
Setting Up the Hardware
Follow these steps to set up the hardware:
-
Connect the Voltage Sensor
Wire the three-phase voltage sensor to the microcontroller. The sensor will monitor the voltage levels of each phase. Ensure the sensor is rated for the voltage you are monitoring.
-
Connect the GSM Module
Connect the GSM module to the microcontroller using serial communication. This module will be used to send SMS alerts. Ensure the SIM card is properly inserted and the module is powered.
-
Power the System
Connect a suitable power supply to the microcontroller and GSM module. Ensure the power supply provides stable voltage and current for both components.
-
Encase the Electronics
Place the assembled components in an enclosure to protect them from environmental factors and provide a user-friendly interface.
Programming the Microcontroller
Write the code to monitor the voltage levels and send SMS alerts. Here is a basic outline of the code for an Arduino with a GSM module:
#include <SoftwareSerial.h>
#define PHASE1_PIN A0
#define PHASE2_PIN A1
#define PHASE3_PIN A2
#define SMS_PIN 7
SoftwareSerial gsmSerial(10, 11); // RX, TX
void setup() {
pinMode(PHASE1_PIN, INPUT);
pinMode(PHASE2_PIN, INPUT);
pinMode(PHASE3_PIN, INPUT);
pinMode(SMS_PIN, OUTPUT);
gsmSerial.begin(9600);
Serial.begin(9600);
sendSMS("Power monitoring system initialized");
}
void loop() {
int phase1 = analogRead(PHASE1_PIN);
int phase2 = analogRead(PHASE2_PIN);
int phase3 = analogRead(PHASE3_PIN);
if (phase1 < threshold || phase2 < threshold || phase3 < threshold) {
sendSMS("Alert: Power failure detected in one or more phases!");
}
delay(60000); // Check every minute
}
void sendSMS(String message) {
gsmSerial.println("AT");
delay(1000);
gsmSerial.println("AT+CMGF=1"); // Set SMS mode to text
delay(1000);
gsmSerial.println("AT+CMGS=\"+1234567890\""); // Replace with your phone number
delay(1000);
gsmSerial.println(message);
delay(1000);
gsmSerial.write(26); // Send SMS
}
This code reads the voltage levels from each phase. If any phase drops below a predefined threshold, it sends an SMS alert to the specified phone number.
Testing the System
Test the system to ensure it correctly detects power failures and sends SMS alerts:
-
Simulate Power Failure
Simulate a power failure by disconnecting one or more phases. Verify that the system sends an SMS alert when a phase fails.
-
Check SMS Delivery
Ensure that SMS messages are received promptly and contain the correct alert information.
-
Adjust Thresholds
Adjust the voltage thresholds in the code if necessary to better match the specific requirements of your monitoring system.
Conclusion
This IoT-based power failure monitoring system provides an effective way to detect and receive alerts for power failures in a three-phase setup. By combining voltage sensing with SMS notifications, you can ensure timely awareness and response to power issues.