Flood Monitoring System Using ESP8266-Sayed-1
Flood Monitoring System Using ESP8266-Sayed-1
Esp8266 Projects
Table of Contents
1. Introduction
2. Components Needed
2.1. ESP8266
2.2. 16×2 LCD Display
2.3. GSM module (SIM800l)
2.4. Float Sensor
3. Circuit Diagram
4. Source Code
5. Video
6. Conclusion
Introduction
In this article, we will explore the design and implementation of a
Flood Monitoring System using various components such as a
16×2 LCD with I2C, ultrasonic sensor, float sensor, and SIM800L
module.
1 ESP8266 1
GSM module
2 1
(SIM800l)
Ultrasonic
3 1
Sensor
4 Float Sensor 1
16x2 LCD
5 Display With 1
I2C
6 Zero PCB 1
5v Power
7 1
Supply
ESP8266
ESP8266 is a Wi-Fi module developed by Espressif Microcontroller
Systems. In the board is a microcontroller unit And a built-in Wi-Fi
Chip, It is the low-cost solution for Wi-Fi connectivity to various
projects.
16×2 LCD Display
This is a basic 16-character by 2 lines Alphanumeric display. Black
text on Green background. Utilizes the extremely common
HD44780 parallel interface chipset. Interface code is freely
available.
GSM module (SIM800l)
Ultrasonic Sensor
Ultrasonic sensors find out the distance of the water level of the
dam. And the Sensor mount on the top of the dam.
Circuit Diagram
Source Code
LiquidCrystal_I2C
Board Selection
1 //Prateek
2 //www.justdoelectronics.com
3
4 #include <LiquidCrystal_I2C.h>
5 #include <ESP8266WiFi.h>
6 #include <SoftwareSerial.h>
7 #include <Wire.h>
8
9 SoftwareSerial mySerial(D6, D7);
10 LiquidCrystal_I2C lcd(0x27, 16, 2);
11
12 int FloatSensor = D5;
13 int buttonState = 1;
14 const int trigPin1 = D3;
15 const int echoPin1 = D4;
16 unsigned long startMillis;
17 unsigned long currentMillis;
18 const unsigned long period = 10000;
19 long duration1;
20 int distance1;
21
22 void setup() {
23
24 Serial.begin(9600);
25 mySerial.begin(9600);
26 Wire.begin(D2, D1);
27 pinMode(FloatSensor, INPUT_PULLUP);
28 lcd.init();
29 lcd.backlight();
30 lcd.setCursor(0, 0);
31 lcd.print(" WELCOME TO");
32 lcd.setCursor(0, 1);
33 lcd.print(" OUR PROJECTS");
34 delay(2000);
35 lcd.clear();
36 lcd.setCursor(0, 0);
37 lcd.print(" SMART");
38 lcd.setCursor(0, 1);
39 lcd.print(" DAM MONITORING");
40 delay(3000);
41 lcd.clear();
42 pinMode(trigPin1, OUTPUT);
43 pinMode(echoPin1, INPUT);
44 }
45 void loop() {
46
47 ultersonic();
48
49 if (buttonState == HIGH) {
50 Serial.println("WATER LEVEL -HIGH");
51 lcd.clear();
52 lcd.setCursor(0, 0);
53 lcd.print(" HIGH ALERTS");
54 lcd.setCursor(0, 1);
55 lcd.print("WATER LEVEL-");
56 lcd.setCursor(13, 1);
57 lcd.print(distance1);
58
59 } else {
60 Serial.println("WATER LEVEL - LOW");
61 lcd.clear();
62 lcd.setCursor(0, 0);
63 lcd.print(" LOW ALERTS");
64 lcd.setCursor(0, 1);
65 lcd.print("WATER LEVEL-");
66 lcd.setCursor(13, 1);
67 lcd.print(distance1);
68 }
69 if (distance1 < 10) {
70
71 } else {
72 }
73 currentMillis = millis();
74 if (currentMillis - startMillis >= period) {
75 startMillis = currentMillis;
76 }
77 }
78
79
80 void ultersonic() {
81 digitalWrite(trigPin1, LOW);
82 delayMicroseconds(2);
83 digitalWrite(trigPin1, HIGH);
84 delayMicroseconds(10);
85 digitalWrite(trigPin1, LOW);
86 duration1 = pulseIn(echoPin1, HIGH);
87 distance1 = duration1 * 0.207 / 2;
88 Serial.println(distance1);
89 buttonState = digitalRead(FloatSensor);
90 delay(100);
91 }
Video
Watch on
Conclusion
This system enables early detection of floods, allowing authorities
to take immediate action and mitigate potential risks.
One Comment
Samir Khanal
06/02/2025 at 10:42 pm