The problem
Railway and road underpasses flood fast during heavy rain — a dip that looks harmless can hold over a metre of water within minutes. Vehicles stall mid-passage, engines hydrolock, and pedestrians wade into water hiding open manholes. Municipal teams usually react only after someone calls it in, because no sensor is watching the water inside the underpass. This project mounts an ultrasonic water-level sensor at the underpass, wired to an ESP32 that samples depth continuously. Readings stream over Wi-Fi to a cloud dashboard so the water level is visible from anywhere, while a SIM800L GSM module fires SMS alerts to officials and nearby residents the moment a threshold is crossed. A red beacon hooter at the site warns drivers on the spot even when phones are out of reach. It is a complete IoT loop — sense, decide, communicate, alert — built around a problem Indian cities face every monsoon.
Ultrasonic sensor above the underpass roadbed firing 40 kHz pulses and measuring echo return time.
Follow the working sequence
How it works
- The HC-SR04 ultrasonic sensor, mounted at a known height above the underpass road surface, fires 40 kHz pulses and measures the echo return time (datasheet range 2 cm–400 cm).
- The ESP32 converts echo time to distance, subtracts it from the mounting height to get water depth, and smooths readings with a moving-average filter at approximately 1 reading per second (design target).
- Each smoothed reading is compared against the configured caution threshold (default 15 cm) and flood-alert threshold (default 30 cm).
- Readings publish over Wi-Fi to the cloud broker every 60 seconds (configurable 30 s–5 min); the dashboard updates the live gauge, trend chart and event log.
- When a threshold is crossed, the ESP32 commands the SIM800L via AT commands to send an SMS to the configured recipients and drives the on-site beacon hooter through a relay.
- When the level falls back below the thresholds, an all-clear SMS is sent and the hooter switches off; the dashboard retains the full event history.
Tech stack:
- ESP32 microcontroller (Wi-Fi)
- HC-SR04 ultrasonic sensor
- SIM800L GSM module (AT-command SMS)
- Arduino IDE (firmware)
- MQTT/HTTP cloud publishing
- HTML/CSS/JavaScript dashboard
- Relay-driven beacon hooter
- 12 V DC power supply
| Parameter | Value |
|---|---|
| Controller | ESP32, 240 MHz dual-core, Wi-Fi 802.11 b/g/n |
| Level sensor | HC-SR04 ultrasonic, 2 cm–400 cm (datasheet range) |
| Depth resolution | Approximately 1 cm after filtering (design target) |
| Sampling | Approximately 1 reading per second (design target) |
| Cloud update interval | 60 s default, configurable 30 s–5 min |
| Caution threshold | 15 cm default (configurable) |
| Flood-alert threshold | 30 cm default (configurable) |
| GSM module | SIM800L quad-band GSM/GPRS 850/900/1800/1900 MHz (datasheet) |
| Alert latency | Design target: under 60 s from threshold crossing to SMS delivery |
| Local alarm | 12 V beacon hooter via relay |
| Power | 12 V DC adapter (base); solar + battery optional |
| Dashboard | Live gauge, 24 h trend, event log, GSM alert simulator |
Project features
- [Ultrasonic water-level sensing] [Implemented] An HC-SR04 sensor mounted above the underpass roadbed measures water depth by echo time-of-flight; the firmware converts distance to level and smooths noisy readings with a moving-average filter.
- [Two-stage threshold alerts] [Implemented] A caution level and a flood-alert level trigger different responses; crossing the flood threshold also sounds the on-site hooter and beacon so drivers get a warning at the spot.
- [SMS alerts via GSM] [Implemented] The SIM800L module sends text alerts to up to three configured numbers when thresholds are crossed or cleared, working independently of Wi-Fi availability.
- [Live cloud dashboard] [Implemented] Level readings publish over Wi-Fi to a cloud dashboard showing the live gauge, 24-hour trend chart and event log, viewable from any phone or PC.
- [Configurable thresholds and recipients] [Configurable] Caution/alert depths, sampling interval and alert phone numbers are firmware constants — changed in minutes to adapt the system to a different underpass, with no code rewrite.
- [Battery-backed power option] [Optional] The base build runs on a 12 V DC adapter; a solar panel plus Li-ion backup for sites with unreliable mains can be added as an optional customization.
- [Multi-node city deployment] [Future scope] The firmware and dashboard design allow additional nodes later, scaling the same build to a ward-level flood map — not included in the single-node project.
What is included
- Assembled flood-monitor prototype (ESP32, HC-SR04, SIM800L with antenna, beacon hooter, wiring)
- Firmware source code (Arduino IDE) with commented threshold and number configuration
- Live cloud dashboard setup (gauge, trend chart, event log)
- Wiring diagram and sensor-mounting guide for the underpass
- Project report PDF (background, methodology, circuit, results)
- PPT presentation for final review
- Viva Q&A preparation document
Limitations & prerequisites
- The HC-SR04 is not waterproof — the sensor head must be sheltered from direct rain; splashing on the transducer face can corrupt readings.
- Ultrasonic readings drift with temperature and scatter off rippled or debris-covered water; the moving-average filter reduces noise but cannot remove it entirely.
- The SIM800L is a 2G (GSM/GPRS) module — it needs a carrier with active 2G coverage and a SIM with SMS balance; where 2G is sunset, a 4G module variant is an optional upgrade.
- Cloud dashboard updates need Wi-Fi at the installation site; SMS alerts work without Wi-Fi but still need cellular signal.
- The prototype is a demonstration build, not a municipal-grade flood installation — no IP67 enclosure or calibrated gauging is included in the base build.
- SMS delivery time depends on the cellular network; the under-60-second figure is a design target, not a measured guarantee.
Frequently Asked Questions
Which controller and sensor are used, and why?
The ESP32 gives built-in Wi-Fi plus enough UART and GPIO lines for the GSM module and the hooter relay, and the HC-SR04 ultrasonic sensor measures depth without touching the water (datasheet range 2 cm–400 cm). Contact probes corrode in floodwater; non-contact ultrasound avoids that failure mode entirely.
Does it work without Wi-Fi?
The SMS alerts do — the SIM800L sends threshold alerts over the cellular network independently. Only the cloud dashboard needs Wi-Fi; without it, readings are still evaluated locally and the hooter still sounds, but remote monitoring is unavailable until connectivity returns.
Can the alert thresholds and phone numbers be changed?
Yes. Caution/alert depths, sampling and publish intervals, and up to three recipient numbers are configuration constants at the top of the firmware — changed in minutes without touching the sensing or alerting logic.
What power supply does it need?
A 12 V DC adapter for the base build. For underpasses with unreliable mains, an optional solar panel with Li-ion backup keeps the node alive through outages; that is priced as an add-on, not included in the base prototype.
What will I receive with the project?
The assembled prototype, firmware source, wiring diagram and sensor-mounting guide, the live cloud dashboard, project report PDF, review PPT and a viva Q&A document — everything needed to demonstrate and defend the build.
Is this project suitable for a final-year project?
Yes — for Electronics & Telecommunication, Electrical, Instrumentation and IoT programs. It demonstrates non-contact sensing, embedded firmware, wireless communication, cloud dashboards and real-world alerting in one complete system.
Components & software requirements
- ESP32 microcontroller (Wi-Fi)
- HC-SR04 ultrasonic sensor
- SIM800L GSM module (AT-command SMS)
- Arduino IDE (firmware)
- MQTT/HTTP cloud publishing
- HTML/CSS/JavaScript dashboard
- Relay-driven beacon hooter
- 12 V DC power supply
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 email — the synopsis PDF downloads immediately. We may send occasional project updates; no spam, unsubscribe anytime.