The problem
A LoRa-Based Flood Alert System using ESP32 is a low-cost early-warning build that watches water level near rivers, drains and low-lying streets and warns residents before flood water reaches homes. An ESP32 sensor node mounted above the water measures the level with an ultrasonic sensor, checks rainfall with a rain sensor, and sends readings over a long-range LoRa radio link to a gateway, which shows live levels on a web dashboard and triggers SMS and buzzer alerts when the water crosses a set threshold. Floods cause damage mainly because warnings arrive late: water in a drain or nullah can rise several centimetres in minutes during heavy rain, while residents nearby have no instrument watching it. This project closes that gap with battery-friendly LoRa nodes that need no Wi-Fi or mobile data at the sensing point, giving a student a complete sensor-to-alert pipeline that is cheap enough to place at several points along one watercourse.
Measures the distance down to the water surface and turns the echo time into a water level in centimetres.
Follow the working sequence
How it works
The system works as a four-stage pipeline: sense, transmit, decide, and alert. First, an HC-SR04 ultrasonic sensor mounted at a fixed height above the water sends a sound pulse and times its echo; the ESP32 converts the echo time into distance and subtracts it from the mounting height to get the water level, while a rain sensor board reports whether rain is falling. Second, the ESP32 packs the level, rain flag, battery voltage and node ID into a LoRa packet and transmits it on 433 MHz through an SX1278 module. Third, the gateway — a second ESP32 with its own SX1278 — receives the packet, checks signal strength, and compares the level against two thresholds, warning at 8.0 cm and danger at 12.0 cm. Fourth, on a threshold crossing the gateway sounds the node buzzer, sends an SMS through a SIM800L GSM module, and marks the alert on the dashboard, which logs every reading for a 24-hour trend chart.
- The HC-SR04 ultrasonic sensor measures the distance from its fixed mounting point down to the water surface, and the ESP32 converts that distance into a water level in centimetres.
- The rain sensor board reports wet or dry; while rain is falling the firmware shortens the sampling interval so fast rises are caught early.
- The ESP32 packs the water level, rain flag, battery voltage and node ID into a short LoRa packet and transmits it at 433 MHz through the SX1278 module.
- The gateway ESP32 receives the packet with its own SX1278, records the received signal strength, and stores the reading with a timestamp.
- The gateway compares the level with the warning threshold of 8.0 cm and the danger threshold of 12.0 cm, both adjustable in firmware.
- On a threshold crossing the gateway triggers the node buzzer, sends an SMS to the configured numbers through the SIM800L GSM module, and flags the alert on the dashboard.
- The dashboard updates its live gauge, appends the reading to the 24-hour trend chart, and adds the event to the timestamped alert log.
Tech stack:
- ESP32
- SX1278 LoRa module · 433 MHz
- HC-SR04 ultrasonic sensor
- Rain sensor module
- SIM800L GSM module
- Arduino IDE · C/C++
- HTML · CSS · JavaScript dashboard
- OLED display · buzzer
| Parameter | Value |
|---|---|
| Controller | ESP32 (sensor node + gateway) |
| Communication | LoRa SX1278, 433 MHz |
| Water-level sensor | HC-SR04 ultrasonic, 2–400 cm (datasheet range) |
| Rain sensor | Resistive rain sensor board (wet/dry) |
| Alert thresholds | Warning 8.0 cm, danger 12.0 cm (configurable in firmware) |
| LoRa sensitivity | −148 dBm (SX1278 datasheet) |
| Link range | Design target up to 2 km line-of-sight (site-dependent) |
| Update interval | Every 10 s in alert mode, every 60 s in normal mode (configurable) |
| SMS alert | SIM800L GSM module at the gateway (needs SIM + coverage) |
| Power | 5 V USB adapter or 18650 battery; solar charging optional |
| Dashboard | Single-file web dashboard: live gauge + 24 h trend + alert log |
| Display | 0.96-inch OLED on node (level, status, RSSI) |
Project features
The build's four strongest capabilities are long-range wireless sensing, two-level threshold alerting, a live gateway dashboard, and multi-node coverage. Long-range sensing comes from the SX1278 LoRa module at 433 MHz, which carries small sensor packets over a design-target range of up to 2 km line-of-sight, so nodes can sit at a riverbank or drain far from any Wi-Fi router or mobile tower. Two-level alerting compares every reading against a warning threshold of 8.0 cm and a danger threshold of 12.0 cm, both adjustable in firmware, and fires a local buzzer plus an SMS on each crossing. The gateway dashboard shows a live water-level gauge, a 24-hour trend chart, per-node signal strength and battery, and a timestamped alert log. Multi-node coverage lets up to three nodes report to one gateway in the demo build, so one dashboard watches a riverside steps, a bridge pier and a low-lying street at once.
- [Ultrasonic water-level sensing] An HC-SR04 sensor mounted at a fixed height above the water measures the distance to the surface; the ESP32 converts the echo time into a water level in centimetres. The sensor's datasheet range is 2–400 cm, and the mounting height is set during calibration.
- [Rain detection] A rain sensor board reports wet or dry at the node, and the firmware raises the sampling rate while rain is falling so a fast-rising level is caught early.
- [Long-range LoRa link] An SX1278 module at 433 MHz transmits small sensor packets to the gateway with a datasheet receiver sensitivity of −148 dBm, so the node needs no Wi-Fi or mobile data at the sensing point.
- [Two-level threshold alerts] Every reading is compared with a warning threshold of 8.0 cm and a danger threshold of 12.0 cm, both adjustable in firmware; crossing either level fires the local buzzer and an SMS alert.
- [Gateway web dashboard] The gateway serves a live dashboard with a water-level gauge, a 24-hour trend chart, per-node signal strength and battery, and a timestamped alert log.
- [Multi-node monitoring] Up to three sensor nodes report to one gateway in the demo build, each with its own ID, location name and thresholds, so one dashboard covers several points along a watercourse.
- [Battery-friendly node design] The node sleeps between transmissions and wakes only to sense and send, with an optional solar charging add-on for longer unattended operation.
What is included
- Working LoRa sensor node prototype with ESP32, SX1278, HC-SR04, rain sensor, OLED and buzzer
- Gateway unit with ESP32, SX1278 and SIM800L GSM module
- ESP32 firmware for node and gateway, including threshold and alert logic
- Web dashboard (single-file HTML) with live gauge, 24-hour trend chart and alert log
- Circuit and wiring documentation with a labelled connection table
- Threshold calibration procedure for the student's own mounting height and test tank
- Project report PDF, PPT presentation and viva Q&A document
- Project abstract PDF
Limitations & prerequisites
- Ultrasonic readings shift with temperature, surface turbulence and floating debris, so levels are approximate and the calibration procedure must be run on the student's own setup.
- LoRa range is site-dependent: walls, trees and terrain reduce the 2 km line-of-sight design target, and the range must be verified at the actual installation points.
- SMS alerts need a working SIM card with balance and GSM coverage at the gateway; without coverage only the buzzer and dashboard alerts work.
- The rain sensor reports wet or dry only, not rainfall in millimetres; any mm/hr figure in the demo is a labelled estimate, not a measured value.
- This is a demonstration prototype, not a certified flood-warning installation, and it must never replace official flood warnings or evacuation orders.
- Battery runtime depends on the transmission interval, node count and solar input, and is not measured for every configuration.
Frequently Asked Questions
Is this project suitable for a final-year project?
Yes, for Electronics, Electronics & Telecommunication, Electrical and IoT programs, because it combines embedded sensing, wireless communication and a working dashboard in one demonstrable system. It covers ultrasonic sensing, LoRa radio configuration, threshold logic, GSM alerts and web visualization, giving the student a complete sensor-to-alert pipeline to explain in the viva, with a working prototype to demonstrate live.
How far can the LoRa link reach?
The design target is up to 2 km line-of-sight between node and gateway, based on the SX1278 datasheet receiver sensitivity of −148 dBm. In practice the range depends on the site: open riverside stretches approach the target, while buildings, trees and terrain shorten it. The range is verified during installation with the RSSI readout on the node OLED and the dashboard.
Does the system need Wi-Fi or internet?
No, the sensor nodes need neither Wi-Fi nor internet, because readings travel over the LoRa radio link to the gateway. Only two parts need a network: the SMS alert needs GSM coverage at the gateway for the SIM800L module, and the dashboard needs a local network connection to view it remotely. The node buzzer works even with no network at all.
What happens when the water crosses the danger level?
When the level passes 12.0 cm, the gateway treats it as a danger event: the node buzzer sounds, an SMS goes to the configured phone numbers through the SIM800L module, and the dashboard switches the node card and gauge to a red danger state. The event is written to the timestamped alert log, and an all-clear SMS is sent when the level falls back below the warning line.
Can more sensor nodes be added?
Yes, the gateway accepts packets from multiple node IDs, and the demo build ships with three nodes: a riverside steps, a bridge pier and a low-lying street. Adding a node means flashing the same node firmware with a new ID and location name and adding its card to the dashboard. More nodes increase gateway traffic, so the sampling interval is adjusted to keep packets from colliding.
What power supply does the node need?
Each node runs on 5 V from a USB adapter or a rechargeable 18650 battery, and the gateway runs on a 5 V USB adapter. The node sleeps between transmissions to save battery, and a small solar panel with a charging module can be added as an optional extra for longer unattended operation. Battery runtime depends on the transmission interval and is quoted as an estimate, not a measured figure.
Components & software requirements
- ESP32
- SX1278 LoRa module · 433 MHz
- HC-SR04 ultrasonic sensor
- Rain sensor module
- SIM800L GSM module
- Arduino IDE · C/C++
- HTML · CSS · JavaScript dashboard
- OLED display · buzzer
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.