Home
About Us
Achievement
Home
Raspberry-Pi Projects
_Raspberry Pi 4 Complete Guide
Arduino Project
_All Projects
Esp8266 Project
_All Projects
Esp32 Project
_Automation-with-feedback
Rain Alert System Using Arduino
Just Do Electronics
November 29, 2021
Circuit Diagram :-
Code :-
//Prateek //wwww.prateeks.in //https://www.youtube.com/c/JustDoElectronics/videos #include
#define RAIN_SENSOR A0 int rain_value = 0; int rain_default=10; boolean rain_flag = 0; const String PHONE = "+918830584864"; #define rxPin 2 #define txPin 3 SoftwareSerial sim800L(rxPin,txPin); void setup() { Serial.begin(115200); sim800L.begin(9600); pinMode(RAIN_SENSOR,INPUT); Serial.println("Initializing..."); sim800L.println("AT"); delay(1000); sim800L.println("AT+CMGF=1"); delay(1000); } void loop() { while(sim800L.available()){ Serial.println(sim800L.readString()); } rain_value = analogRead(RAIN_SENSOR); rain_value = map(rain_value,0,1023,225,0); if(rain_value>=rain_default) { if(rain_flag == 0) { Serial.println("Rain is Detected."); rain_flag == 1; send_sms(); make_call(); } } else { if(rain_flag == 1) {Serial.println("Rain is not Detected.");} rain_flag = 0; } } void make_call() { Serial.println("calling...."); sim800L.println("ATD"+PHONE+";"); delay(20000); //20 sec delay sim800L.println("ATH"); delay(1000); //1 sec delay } void send_sms() { Serial.println("sending sms...."); delay(50); sim800L.print("AT+CMGF=1\r"); delay(1000); sim800L.print("AT+CMGS=\""+PHONE+"\"\r"); delay(1000); sim800L.print(" Rain Alarm Plz Check Your Window"); delay(100); sim800L.write(0x1A); delay(5000); }
GitHub Link :-
Code
Video :-
0 Comments
Newer
Older
ESP32 Interfacing With LDR Sensor
How To Make RFID & Keypad Based Door Lock
IoT Based Fingerprint Biometric Attendance System Using NodeMCU (Esp8266)
Esp32 Cam Based Face Unlock
NRF Based Servo Motor Control
Ultrasonic Sensor as a Counter with Arduino
ESP32 Led Blink With Push Button
How to Make a Conveyor Belt System | Counter Machine
IoT Based Patient Health Monitoring System Using Blynk App
Arduino ebook
YouTube
Like on Facebook
Follow on Twitter
Follow on Google+
Follow on Instagram
Subscribe on Youtube
Hi WelCome To My Website If you have a creative mind and want to learn Electronics even without studying it then FRIENDS this Website And Youtube Channel is for you, I am crazy creators who love making Electronics things. I have a bunch of more than 130 Tutorial Videos on My YouTube Channel and I upload a new Tutorial every Sunday.
Tags
Arduino Project
Esp32 Project
Esp8266 Project
0 Comments