Flood Early Warning System
An ultrasonic sensor over the river, a buzzer on the post and a phone app that turns centimetres into Safe, Alert, Standby or Danger.
- My role
- Device, firmware and the monitoring app.
- Field
- IoT & Embedded
Overview
Riverside neighbourhoods usually learn about a flood from the water itself. The idea here was to hang a cheap sensor over the river and give people a few minutes of warning: the ESP32 sends an ultrasonic pulse down, times the echo, and converts it into the distance between the sensor and the surface. The smaller that distance, the higher the water.
There is no server of our own in the middle. The board writes each reading to a single node in Firebase Realtime Database, overwriting the last one, so the database always holds the current state of the river. The mobile app, built with MIT App Inventor, listens for that node to change and compares the new value against the thresholds.
A number in centimetres means little at two in the morning, so the app reduces it to one word and one colour — Safe, Alert, Standby, Danger — next to the live distance and a water gauge. A buzzer on the post covers the people who are not looking at a phone, sounding more urgently as the level climbs.
In pictures



Function
- Input
- Ultrasonic distance from the sensor down to the water, about once a second
- Link
- ESP32 writes the reading straight to Firebase Realtime Database
- Output
- Buzzer on site and a colour-coded status in the mobile app
What it does
- 01Ultrasonic distance measurement from above the water, so nothing sits in the river.
- 02Readings written to Firebase Realtime Database about once a second.
- 03Mobile app that reacts to each change and shows the live distance and a water gauge.
- 04Four colour-coded statuses: Safe, Alert, Standby and Danger.
- 05Buzzer on site for people without a phone at hand.
Technical notes
- Firebase path
- /kondisi — {"jarak": 87}
- Formula
- distance = echo time × 0.0343 / 2 (cm)
- Status
- The original app is no longer available; images are illustrations