← Back to Projects

IoT Rainwater Management System

Engineered a full-stack IoT solution to remotely control and monitor a physical rainwater scale model. The system features an embedded device in C/C++, a cloud backend, and a cross-platform mobile app.

IoT Rainwater Management System

Technologies Used

C/C++
ESP32
Cloudflare
TypeScript
JavaScript
React Native

This project demonstrates a complete end-to-end IoT system, from low-level hardware programming to a cloud-based data pipeline and a user-facing mobile application. The core objective was to create a smart, connected scale model of a rainwater collection system that could be monitored and controlled from anywhere.

The physical model, built with electronic devices, is managed by a microcontroller running C/C++ code. It leverages GPS and mobile internet for connectivity, allowing it to transmit real-time data and receive commands remotely.

System Architecture & Data Flow

The device sends telemetry data, including its location and operational status, over the mobile network. A Cloudflare proxy acts as a secure and scalable gateway, receiving this data and packaging it for storage in a MongoDB database. The mobile app then queries the database to display real-time information to the user.

Software Arquitecture diagram
Diagram illustrating the arquitecture used to communicate the hardware to the software on long distances.
Hardware connection diagram
Diagram illustrating the connections between the microcontroller and various electronic components of the scale model.

Remote Monitoring & Control App

A mobile application, built with React Native, serves as the central command interface. Users can remotely monitor the system's GPS location, track public interaction metrics, and control the state of the water valves, toggling the flow on or off.

Mobile app displaying GPS and usage
The app's main dashboard showing the device's live GPS location and usage statistics.
Mobile app showing status control
Control panel within the app for managing the operational status and water flow of the valves.

Embedded C/C++ Connectivity Code

The device's firmware, written in C/C++, handles all hardware interactions and network communications. This includes initializing the mobile internet module, acquiring GPS coordinates, and formatting and sending data via HTTP requests to the cloud endpoint.

Code for establishing internet connection
C/C++ snippet for initializing the wifi internet connection on the device.
Code for establishing Mobile internet connection
C/C++ snippet for initializing the mobile internet connection on the device.
Code for acquiring GPS data
Firmware code responsible for connecting to the GPS module and retrieving location data.
Code for sending data via HTTP
Code segment showing how sensor data is packaged into a JSON payload and sent via an HTTP POST request.

Key Features:

  • Full-Stack IoT Solution: Manages everything from hardware to the mobile UI.
  • Embedded C/C++ Programming: Direct control over device hardware, sensors, and actuators.
  • Cloud-Native Backend: Utilizes a Cloudflare proxy and MongoDB for a scalable, serverless data pipeline.
  • Real-Time Connectivity: Employs GPS for location tracking and mobile internet for data transmission.
  • Cross-Platform Mobile App: Built with React Native for remote control and monitoring on any device.

Gallery

IoT Rainwater Management System image 1
IoT Rainwater Management System image 2
IoT Rainwater Management System image 3
IoT Rainwater Management System image 4
IoT Rainwater Management System image 5
IoT Rainwater Management System image 6
IoT Rainwater Management System image 7
IoT Rainwater Management System image 8
IoT Rainwater Management System image 9