Updated: Removing OLED Functionalities
Watch it on TikTok: Video Demonstration
This is an IoT-based flood detection system using ESP8266, HC-SR04 ultrasonic sensor, and the Blynk IoT platform.
Features:
- Distance monitoring in cm & inches
- LED indicators for water level thresholds
- Buzzer alarm for high water levels
- Optional cloud logging via
Blynk.logEvent("high_water_levels")
This project is intended for educational and prototyping purposes only. It should not be relied upon as a primary flood warning system for life safety or property protection.
Always use certified and government-approved flood detection/alert systems in real-world applications.
The Author are not responsible for any damage, loss, or injury that may result from the use of this project.
| Component | Description |
|---|---|
| ESP8266 NodeMCU | Main Wi-Fi microcontroller |
| HC-SR04 Ultrasonic Sensor | Measures water level |
| Buzzer | Audible alert |
| Red, Blue, Green LEDs | Visual alerts for water levels |
| Yellow LED | Blynk connection indicator |
| 220Ω Resistors (x3) | LED current-limiting |
| Jumper Wires | Connections |
| Breadboard | Prototyping |
| Component | Pin Label | ESP8266 GPIO | NodeMCU Pin |
|---|---|---|---|
| Ultrasonic | Trig | GPIO12 | D6 |
| Echo | GPIO14 | D5 | |
| Buzzer | + | GPIO13 | D7 |
| Red LED | + | GPIO3 | RX (D9) |
| Blue LED | + | GPIO2 | D4 |
| Green LED | + | GPIO15 | D8 |
| Yellow LED | + | GPIO16 | D0 |
-
Install Blynk IoT App (Android/iOS)
-
Create a New Template:
- Name:
Flood Detection - Hardware:
ESP8266, Wi-Fi - Save Template ID, Device Name, Auth Token
- Name:
-
Create a New Device using your template
-
Add Label/Gauge widgets:
V1→ Distance (cm)V2→ Distance (inches)
-
Insert credentials into Arduino code:
#define BLYNK_TEMPLATE_ID "YourTemplateID"
#define BLYNK_TEMPLATE_NAME "Flood Detection"
#define BLYNK_AUTH_TOKEN "YourAuthToken"
char ssid[] = "YourWiFiSSID";
char pass[] = "YourWiFiPassword";- Optional: Enable cloud events in Blynk and trigger using
Blynk.logEvent("high_water_levels")
BlynkESP8266WiFi
Note: OLED libraries are not required for this version.
- Connect ESP8266 via USB
- Open
.inosketch and insert Wi-Fi & Blynk credentials - Click Upload
- Open Serial Monitor at
115200baud to verify connection
- Monitor V1 (cm) & V2 (inches) on Blynk dashboard
- Optional: set alerts for
high_water_levels
This project is licensed under the Apache License 2.0. See the LICENSE file for full details.
- Created with passion ❤ by: Roy Cuadra
- Updated Date: 10-24-2025
Thank you for checking out this project! You are welcome to fork, improve, or use it for learning purposes.
