Project-R.I.V.E.R.
R.I.V.E.R.
An IoT-based flood-monitoring and early-warning system integrating physical sensing, GSM communication, machine learning, PostgreSQL, and web/mobile applications.

On this page
Archived research prototype from 2025; no longer maintained or intended for operational flood warning.
Overview
R.I.V.E.R. (Real-time IoT-based Visualization and Early-warning for Resilience) is an IoT-based flood-monitoring and early-warning research prototype developed for the 2025 Science and Technology Fair. The project explored how environmental sensing, remote communications, automated warnings, data visualization, and machine-learning weather prediction could be combined to help communities monitor conditions associated with potential flooding. It was my first project integrating hardware, backend services, a database, machine learning, and web/mobile applications into one system.
The physical system was organized around two monitoring locations. An upstream Arduino-based device collected water-level and other environmental readings, while a downstream device was positioned closer to residents and included a relay-controlled siren. The downstream warning hardware was designed to respond to abnormal upstream conditions, bringing alerts closer to the people who might need them. SIM modules supported communication for the IoT devices. The design depended on coordinated operation between the devices, their network connections, and the warning hardware.
The software architecture connected these devices to a Node.js and Express backend responsible for receiving, processing, and distributing monitoring information. PostgreSQL stored collected observations, and a browser-based interface made those readings accessible through visualizations. An Android application offered another way for civilian users to access the system. A middleware layer connected the interfaces and backend, with supporting services for communication and notifications. This introduced me to API integration, databases, and Linux server hosting.
R.I.V.E.R. also included an experimental Python machine-learning component for weather prediction using historical observations. The original implementation required at least 500 hourly data entries, approximately 21 days of readings, before it could generate predictions. Project notes reported temperature differences of about 0.6°C for forecasts one hour ahead and around 1°C for forecasts six hours ahead during the available testing. These limited, historical figures were not independently validated and did not demonstrate flood-prediction accuracy. The machine-learning component was developed with substantial assistance from ChatGPT; my experience centered on understanding how it worked and integrating it into the larger system.
One of the hardest parts of R.I.V.E.R. was making technologies with very different responsibilities work together under a competition deadline. I had to troubleshoot SIM-module connectivity and coordinate data flow between hardware, databases, backend services, and interfaces. The project won District Champion and placed 3rd at the Congressional Science and Technology Fair. Some planned features were left unfinished, and the repository still contains experimental or unused code from that period.
R.I.V.E.R. is now archived and is not a production-ready flood-warning service. Looking back, I can identify serious shortcomings in how I handled account security, input validation, API protections, code organization, and testing. The experience taught me to consider security, maintainability, reliability, and realistic scope from the beginning, not after a prototype starts working. The repository remains public as a record of both the engineering work and the lessons that came from it.
Recognition
My Role
Primary programmer and system integrator. I developed and connected the backend APIs, PostgreSQL data storage, IoT device communication, and web/mobile system components, while working across Arduino hardware, hosted services, and the software interfaces. The machine-learning component was built with substantial assistance from ChatGPT; I focused on learning from it and integrating its predictions into the overall system. I also documented the project and later reviewed its architectural and security shortcomings.
Structure
- devices — Arduino-based upstream monitoring hardware collected water-level and environmental readings; a downstream device closer to residents included a relay-controlled siren for abnormal-condition warnings.
- communication — SIM modules provided the cellular connectivity used by the physical IoT devices, linking remote monitoring hardware with the wider system.
- back — Node.js and Express services handled monitoring data and application requests; Python components handled experimental weather prediction, while PostgreSQL stored collected observations.
- middle — A separate middleware layer mediated communication between the interfaces and the backend. Its existence did not make the original API security production-grade.
- front — The website presented monitoring data visually and could show weather predictions when enough historical observations had accumulated.
- android — An Android interface gave civilian users another way to access the system. The archive includes its source and an APK.
- schema.sql — The PostgreSQL schema documents the original database table structure supporting the project's stored monitoring data.
Technologies
Core features
- Upstream sensing of water level and other environmental conditions through physical IoT hardware.
- Downstream alarm hardware capable of triggering a siren through a relay when abnormal upstream conditions were detected.
- SIM-module communication connecting monitoring devices with the rest of the system.
- Backend services and PostgreSQL storage for receiving, processing, and retaining monitoring data.
- Website visualization and an Android application for accessing information.
- Experimental machine-learning weather prediction using previously recorded observations.
Weather prediction & historical testing
The original maintainer notes specify a minimum of 500 hourly observations (roughly 21 days) before the weather-prediction component could begin generating forecasts. The results below refer to temperature prediction during the project's available testing, not to flood prediction or operational warning performance.
- One-hour temperature forecasts were reported to differ from observations by no more than approximately 0.6°C in the documented tests.
- Six-hour temperature forecasts were reported to differ by around 1°C in the documented tests.
Historical project observations only. The underlying evaluation was limited, and the figures should not be presented as independently verified accuracy metrics or evidence of reliable flood forecasting.
Engineering challenges
This was my first project that required several unfamiliar technologies to operate together, rather than as separate demonstrations. Troubleshooting often meant tracing a problem across hardware, SIM connectivity, hosted services, the database, and the application interfaces.
- Diagnosing SIM-module communication, network registration, and device-to-server connectivity.
- Coordinating data flow between Arduino devices, backend processes, middleware, PostgreSQL, and user interfaces.
- Setting up and maintaining Linux-hosted backend services while learning API and database fundamentals.
- Working with a machine-learning subsystem that required a substantial history of collected data.
- Managing a competition deadline that left some features incomplete and experimental files in the repository.
Retrospective & lessons learned
R.I.V.E.R. showed me that a functioning prototype is not the same as a secure, maintainable, and reliable product. I have kept the original code and published a retrospective to document what I would change rather than presenting the archive as production-ready software.
- Use properly hashed passwords and database-backed account storage instead of JSON account files.
- Protect APIs with rate limiting, restricted CORS origins, input validation, and parameterized database queries.
- Separate backend responsibilities into maintainable modules and organize the frontend by feature.
- Introduce automated unit and integration tests, stronger error handling, logging, and security review.
- Remove or clearly isolate incomplete work, and choose a realistic project scope before development begins.
Project documentation
Results & limitations
- Archived educational/research prototype; not validated or suitable for deployment as a real-world flood-warning service.
- Historical temperature-forecast results were based on limited testing and should not be confused with demonstrated flood-prediction accuracy.
- The original backend lacked rate limiting, proper origin restrictions, and comprehensive input validation; account credentials were also inadequately protected.
- The original codebase had tightly coupled components, inconsistent file organization, no automated test suite, and leftover experimental code.
- Weather prediction depended on enough historical data, and the effectiveness of warnings under real flood conditions was not established.
- Some network, SIM, hosting, and hardware settings depended on the original development environment, and archived services may be unavailable.