Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flood-Watch: Sri Lanka

Real-Time Flood Early Warning System (Edge Node)

Status: Prototype (Tested on Magicbit Neo)
Built after: Cyclone Ditwah (2025)


📌 What is Flood-Watch?

Flood-Watch is a low-cost flood monitoring device designed for riverbank and flood-prone communities in Sri Lanka.

Instead of relying on cloud servers, this system performs edge computing to detect flood risks locally and trigger alerts instantly — even when internet connectivity fails.


Why Flood-Watch?

Traditional flood warning systems often fail due to:

  • Internet outages
  • Central server delays
  • Late emergency alerts

Flood-Watch solves this by providing real-time, local flood alerts directly to the community.


Main Features

🚦 Traffic Light Warning System

Color Meaning Alert
🟢 Green Safe No sound
🟡 Yellow Warning Slow beeps
🔴 Red Danger / Evacuate Continuous siren

Flash Flood (Surge) Detection

  • Measures how fast the water level rises
  • Uses a 5-second moving average to reduce noise
  • Triggers a FLASH FLOOD alert if:

Works Without Internet

  • No cloud dependency
  • Alerts continue during network failures

Live Display

  • Onboard OLED screen
  • Displays:
    • Water depth
    • Alert status
    • Water level graph

Hardware Used

Component Purpose
Magicbit Neo ESP32-based controller
HC-SR04 Ultrasonic water level sensor
OLED Display Visual alert output
Piezo Buzzer Audio alarm
Power Bank 5V power supply
Jumper Wires Wiring connections

Wiring Connections

Ultrasonic Sensor → Magicbit Neo

Sensor Pin Board Pin
VCC 5V
GND GND
TRIG D32
ECHO D33

Notes:

  • Buzzer is connected to Pin 25
  • OLED uses built-in I2C pins

⚙️ Setup Instructions

Step 1: Install Software

  • Arduino IDE (Version 2.0 or higher)

Step 2: Install Board Support

  • Open Boards Manager
  • Install Magicbit or ESP32

Step 3: Install Libraries

  • NewPing
  • Adafruit GFX Library
  • Adafruit SSD1306

Step 4: Upload the Code

  1. Open FloodWatch_Main.ino
  2. Select Magicbit Neo as the board
  3. Select the correct COM port
  4. Click Upload

How It Works

Water Depth Levels

Sensor height is fixed at 25 cm.

Depth Status
< 12 cm Safe
12 – 18 cm Warning
> 18 cm Evacuate

Flash Flood Logic

  • Measures water level every second
  • Groups readings into 5-second blocks
  • Calculates rise speed using:

If velocity exceeds 2 cm/s, the system:

  • Overrides depth rules
  • Triggers a Rapid Surge Alert

Future Improvements

  • Waterproof ultrasonic sensor (JSN-SR04T)
  • LoRaWAN connectivity for long-range alerts
  • Solar-powered operation

🇱🇰 Project Goal

To build a simple, affordable, and reliable flood early warning system that protects lives when centralized systems fail.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages