Flood Detection System (YR_2_GP)
Thursday, 27 February 2025
Flood Detection System: Real-Time Monitoring and Alerts
Flood Detection System Working Procedure
This flood detection system is designed to monitor and provide real-time alerts on rising water levels using three key sensors:
- Soil Moisture Sensor – Measures soil moisture levels.
- Ultrasonic Sensor – Detects the water level based on distance.
- Infrared Sensor – Acts as an additional distance sensor for precision.
The system provides visual (LED) and auditory (buzzer) alerts, alongside real-time data visualisation on the desktop interface.
System Functionality - Three Stages of Water Level Change
1. Safe Condition (Green LED) - No Flood Risk
- At the start of the video:
- Soil moisture is at a safe level, as detected by the soil moisture sensor.
- The ultrasonic and infrared sensors detect that the water level is at a safe distance.
- The LED remains green, indicating normal conditions.
- The desktop interface displays high-distance values, confirming that the water is far from dangerous levels.
2. Warning Condition (Yellow LED) - Rising Water Level
- At 2 seconds into the video, the hand moves closer to the sensors, simulating rising water.
- The distance measured by the sensors decreases, indicating an increase in water level.
- The system reacts by turning the LED yellow, signalling an early warning.
- The desktop interface updates to show a lower distance value, reflecting the rising water level.
3. Danger Condition (Red LED & Buzzer) - Critical Flood Level
- At 3 seconds into the video, the hand moves even closer, simulating a dangerously high water level.
- The ultrasonic and infrared sensors detect that the water level has reached a critical threshold.
- The LED turns red, and the buzzer activates, indicating imminent flood danger.
- The desktop interface shows the lowest distance value, confirming high flood risk.
The soil moisture sensor plays a critical role in flood detection by measuring the water content in the soil. To ensure its accuracy and responsiveness, we conducted a separate testing procedure by submerging the sensor in muddy water, simulating extreme soil moisture conditions.
Testing Procedure
Initial Condition - Safe Moisture Level (Green LED)
- Before submersion, the sensor detects normal or low soil moisture levels.
- The LED remains green, indicating a safe condition where the soil is not excessively wet.
- No buzzer sound is emitted, confirming the system is stable.
Submersion in Muddy Water - High Moisture Detected
- The sensor is dipped into muddy water, instantly exposing it to a high moisture level.
- Within 0.5 to 1 second, the sensor detects that the soil is saturated and reaches a danger level.
Immediate Response - Warning System Activated
- The LED changes from green to red, indicating that the moisture level is too high.
- The buzzer activates with a high-pitched noise, alerting the user of the dangerous moisture level.
- This reaction is programmed to trigger an immediate warning when excessive moisture is detected.
Thursday, 20 February 2025
Weekly Activity Update: Flood Detection System Development Week 4 (Settimana 4)
Summary of Week 4's Activities
Week 4 focused on completing all tasks, sensor testing, and preparing for the Week 5 presentation. The soil moisture, ultrasonic, and infrared ToF sensors were tested for accuracy and functionality, ensuring reliable data logging. LED indicators and the buzzer were validated, with final calibration and integration checks completed. Real-world testing confirmed ultrasonic and IR sensor performance in water clarity detection and soil moisture consistency. Data analysis, documentation, and report updates were finalised, incorporating graphs and observations. Poster preparation began, structuring methodology, results, and system functionality for an effective presentation. By the end of the week, the project was fully functional, the report near completion, and the team ready for Week 5.
Hardware Setup and Sensor Testing
The sensors were mounted and secured to ensure stable and accurate readings. The Arduino board and breadboard were properly wired, and sensors were positioned for optimal performance.
Figure 1: Full hardware setup mounted Figure 2: Close-up of the ultrasonic and IR sensor on the frame.
The ultrasonic sensor was tested for measuring water level, while the infrared ToF sensor measured water clarity and depth accuracy.
- Clear Water: The IR sensor passed through the water with minimal interference, while the ultrasonic sensor detected only the surface.
- Slightly Muddy Water: Some IR sensor deflections occurred due to floating particles, but bottom detection remained possible.
- Completely Muddy Water: The IR sensor struggled due to the solid sediment at the bottom, blocking readings.
.jpg)
Figure 4: Little muddy test setup with sensors. Figure 5: Completely muddy water test
Soil Moisture Sensor Testing
Data Logging, Graphing, and Interpretation
Data from all sensors was recorded and analysed to validate system performance.
- Water level was calculated by subtracting ultrasonic sensor readings from the ground distance.
- IR sensor readings provided insight into water clarity based on reflections and interference.
- Soil moisture readings were mapped to moisture levels, correlating sensor values with actual soil conditions.
Figure 6: Data logging interface and real-time sensor values
Figure 7: Data Interpretation for soil types
System Refinements and Debugging
Several challenges were addressed:
✔ Sensor positioning was adjusted for better stability.
✔ Software improvements were made to filter inconsistent readings.
✔ Hardware wiring and soldering were reinforced to prevent connection issues.
✔ Final calibration and integration checks were completed.
Report, Blog, and Poster Preparation
- Report updates included experimental results, final observations, and conclusions.
- Blog updates summarised key findings and visual data representations.
- The poster draft was created, outlining methodology, system overview, and key results.
Week 5 Tasks and Presentation Plan
Finalise and rehearse the poster presentation (Friday).
Complete and submit the report by the end of the week.
Perform final system checks to ensure full functionality.
Make final refinements to the blog and documentation.
Prepare answers for potential questions during the presentation.
Thursday, 13 February 2025
Weekly Activity Update: Flood Detection System Development Week 3 (Settimana 3)
Summary of Week 3's Activities
This week, we conducted real-life experiments to test the flood detection system. Our focus was on verifying sensor accuracy, ensuring proper integration with the microcontroller, evaluating system response under different conditions, and progressing with the poster design for the project. Additionally, we began developing the CAD design for the project and started conducting market research to assess the viability of the product.
Experiments Conducted:
Water Level Experiment
A container filled with water was used to simulate rising water levels.
The Ultrasonic Sensor (HC-SR04) was placed above the water to measure the distance to the water surface.
The Infrared Sensor (VL53L0) was also used for comparison.
As the water level rose, the system recorded data from both sensors to check for consistency.
Object Detection Experiment
A cylindrical container was used to simulate a confined water body.
An object was placed inside the container to test sensor response to obstacles.
The infrared sensor detected the object at close range, while the ultrasonic sensor monitored changes in water height.
Warning System Evaluation
The RGB LED was programmed to change colours based on water levels.
The buzzer was tested to ensure it activated at danger thresholds.
Wi-Fi connectivity was tested to confirm alerts were sent to a remote device.
Poster Design Work
Work began on the project poster summarising the system’s operation.
Key sections included: System Overview, Sensor Comparisons, Experimental Data, and Future Applications.
Initial sketches and layouts were prepared, and refinements will continue into next week.
Testing the Battery Before Soldering
Before permanently soldering the 800mAh LiPo battery, we conducted initial testing to ensure compatibility with the microcontroller. However, we ran into issues as the battery could not be connected or coded in Arduino due to missing university applications. This delayed our testing process.
To resolve this, Demonstrator Will assisted us in identifying and installing the correct application, allowing us to proceed with battery testing. Once connected, we verified its voltage stability and power delivery to the system. After confirming successful operation, we proceeded with soldering, ensuring a secure and stable connection.
Figure 2: Testing the 800mAh LiPo battery for voltage stability and compatibility before soldering. Initial connection issues were resolved with assistance from Demonstrator Will, ensuring the correct application was installed for successful Arduino coding and power delivery verification.Proposed Solution for Sensor Reliability
To ensure a robust flood detection system, we implemented the Rule of 2 in Robotics, where two different sensors are used for redundancy and accuracy verification. The Ultrasonic Sensor and Infrared Sensor serve different purposes but complement each other. By comparing data from both sensors, we can determine reliable water level measurements. If both sensors agree on a measurement, we have a reliable result. If one fails due to environmental factors, the other sensor ensures continuity in detection. This redundancy is vital for ensuring reliability and reducing false alerts in real-world scenarios.
Experimental Validation
For testing, we designed an experiment using a pod filled with water and a cylindrical object placed within. By varying the water levels and tracking sensor readings, we verified the sensors' accuracy. The LED changed colour based on threshold levels, and the buzzer activated when the danger level was exceeded. This experiment confirmed that both sensors effectively monitored the water level and provided timely alerts.
Summary Table of Sensor Data Interpretation
Key Observations:
- Clay Soil has the highest initial moisture readings because it retains water the longest.
- Loam Soil has moderate moisture retention, as expected.
- Sand Soil has the lowest moisture readings due to its fast drainage properties.
- Water absorption time is identical for all samples, but moisture retention varies.
Why Both Sensors Are Important
The Ultrasonic Sensor is effective for large-area water detection but is susceptible to temperature and humidity variations, which can slightly affect accuracy. Meanwhile, the Infrared Sensor is highly precise for short-range measurements, ensuring that small puddles or water accumulations are also detected. If only one sensor were used, limitations in specific conditions could lead to false or missing alerts. Using both ensures comprehensive monitoring, redundancy, and more accurate flood detection.
Poster Design Work
Work began on the project poster summarising the system’s operation.
Key sections included: System Overview, Sensor Comparisons, Experimental Data, and Future Applications.
Initial sketches and layouts were prepared, and refinements will continue into next week.
CAD Design & Market Research
The 3D CAD model of the flood detection system was started.
Research was conducted to explore potential market applications and consumer interest in flood detection solutions.

Thursday, 6 February 2025
Weekly Activity Update: Flood Detection System Development Week 2 (Settimana 2)
Overview of Week 2 Activities
This week, we focused on testing the components, troubleshooting code integration, and ensuring that all parts worked together effectively. After delays in delivery, we finally received most of the components from the lab technician. However, some components had not been ordered, which could have slowed down our progress. To overcome this, we reached out to one of our demonstrators, Will, who generously provided us with the missing components. This allowed us to proceed with testing without further delays.
Despite these setbacks, we remained committed to ensuring that we made the most of the week. We worked as a team to begin integrating the sensors with the ESP-32 microcontroller and debugging initial coding challenges. We also tried developing the code with a flowchart of its working procedure to make further progress.
Figure 1: Flood detection system components before testing, including the ESP-32 microcontroller, sensors, battery, and other essential hardwareComponent Collection and Setup
Once we collected the components, we started organising and setting up the hardware for testing. The key components included:
DFRobot Development Board (DFR0478)
HC-SR04 Ultrasonic Sensor
VL53L0 Infrared TOF Sensor
Soil Moisture Sensor
RGB LED
ABT-414-RC Buzzer
800mAh LiPo Battery
We systematically tested each component to confirm functionality before integrating them into the full system.
Figure 2: Close-up of the HC-SR04 ultrasonic sensor, VL53L0 infrared sensor, soil moisture sensor, and RGB LED, highlighting their integration in the system.
Team Responsibilities and Progress
|
|
Status |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This week, we focused on refining the microcontroller code to allow seamless sensor integration. Our coding efforts revolved around:
HC-SR04 Ultrasonic Sensor Integration: Sayem worked on writing and testing the ultrasonic sensor code, ensuring that it provided accurate distance measurements within the range of 20mm to 4500mm. The sensor successfully communicated with the microcontroller, outputting expected values.
VL53L0 TOF Sensor Integration: Cian took charge of writing the code for the VL53L0 infrared time-of-flight (TOF) sensor, which provides high accuracy distance measurements. We encountered compatibility issues with the libraries, as the Arduino IDE didn’t immediately support the correct drivers. After manually downloading and installing the required packages, we successfully got the sensor working.
RGB LED Troubleshooting: One of the biggest challenges was getting the RGB LED to function correctly. Initially, we struggled to program it to display multiple colours simultaneously. We called over Will, who guided us through different approaches to coding the LED. After troubleshooting, we successfully programmed it to cycle through different colours based on water level thresholds.
Component Testing
Once the coding was functional, we tested each sensor individually before integrating them together. The results:
HC-SR04 Sensor: Provided reliable distance measurements with a ±2mm accuracy.
VL53L0 TOF Sensor: High precision, with a range of 30mm to 2000mm.
Soil Moisture Sensor: Successfully detected different levels of moisture.
Buzzer & RGB LED: Functioned correctly to indicate warnings when flood conditions were simulated.
We were pleased with the accuracy of our sensors, though further real-world testing is needed to confirm performance under actual flood conditions.
Figure 5: Testing the HC-SR04 ultrasonic sensor by measuring distance to an obstacle and verifying the accuracy of readings.
Secondary Version of the Code
This version includes only the core functionalities without complete implementations. It serves as a starting point for the full version.
Key Features of Secondary Code Version
✅ Reads sensors (Soil Moisture, Ultrasonic, ToF)
✅ Initialises components
❌ Does not yet control LEDs or Buzzer
❌ Lacks advanced processing or decision-making
Library Compatibility Issues
We faced difficulties getting the correct software libraries for our sensors in Arduino IDE. Initially, the IDE did not support the required packages, which prevented the microcontroller from recognising the sensors. The solution was to manually search for the correct libraries, install them, and configure them to match our components.
RGB LED Coding Difficulties
We initially coded the RGB LED to output colours based on sensor readings, but we could not get it to show multiple colours simultaneously. Will assisted us in debugging the issue, and we managed to fix it by adjusting the code to manipulate individual LED pins correctly.
Simulation Limitations
Tinker CAD and Fritzing did not have exact equivalents for some of our components, making it challenging to simulate real-world behaviour accurately. We overcame this by testing directly with physical components as soon as we received them.
Next Steps & Action Plan

We plan to test the flood detection system under real conditions next week. This will involve simulating different water levels and verifying whether the sensors trigger alerts accurately. Additionally, we will start working on the project poster, which will summarise our work and findings.
Conclusion
Despite initial setbacks due to missing components, we made significant progress this week. Thanks to Will’s assistance, we were able to acquire missing parts and resolve technical difficulties with the RGB LED. Our sensors performed well in initial tests, and we are now focusing on fine-tuning integration and preparing for real-world testing.
With steady progress and strong teamwork, we are on track to complete the project successfully.
Thursday, 30 January 2025
Weekly Activity Update: Flood Detection System Development Week 1 (Settimana 1)
Week 1 Overview
For our project, we are designing a flood detection system, aimed at enhancing safety during extreme weather events. The system will utilize various sensors to detect water levels, soil moisture, and potential hazards, activating warning mechanisms such as LEDs and buzzers to alert users. Inspired by the increasing need for accessible flood detection solutions, we aim to develop a compact, efficient, and reliable prototype.
In the first week of the project, we focused on laying a solid foundation. Our activities revolved around coding for the microcontroller, planning the project objectives and timeline, preparing the components for assembly, and visualizing the prototype layout. We also encountered several challenges, including delays in component delivery and limitations in simulation tools. Despite this, our team worked collaboratively to maintain momentum and make progress.
We also faced limitations in our component availability, which slowed down testing. To address this, we sought help from one of the demonstrators, Will, who assisted us with a few missing components that had not been ordered by the lab technicians. This support allowed us to proceed with testing some aspects of the code, ensuring we stayed on track despite the delays.
1. Coding for Microcontroller
We started drafting the initial code structure to handle sensor inputs and trigger alerts such as the buzzer and LEDs. This foundational code will act as the backbone of the system, enabling real-time flood detection. We ensured modularity in the code to facilitate future integration of additional features, such as data logging and threshold adjustments.
The code has been designed in a modular format to allow for easy expansion and debugging. The key components include:
Sensor Data Acquisition Module
- Reads values from the soil moisture sensors (SEN0308, SEN0245) and ultrasonic sensor (HC-SR04).
- Processes real-time input and converts raw data into meaningful values (e.g., water level in cm, soil moisture percentage).
Threshold Detection & Alert System
- Compares sensor readings with predefined thresholds to determine if flood conditions exist.
- If conditions exceed safe limits, it activates the buzzer (ABT-414-RC) and LED (RS PRO RGB 5mm LED) to alert users.
Logging & Data Handling (Planned for Next Week)
- Future implementation includes logging sensor data for analysis.
- This will allow us to track trends over time and fine-tune our detection system.
Current Stage & Status
- Basic input-output functions (sensor reading & LED/buzzer triggering) have been implemented successfully.
- Initial calibration of threshold values is ongoing to ensure accurate flood detection.
- The logging module is yet to be developed, but the structure is in place for future integration.
Conclusion: The initial code draft is functional but requires further refinement. The group agreed to improve sensor calibration and optimise power consumption.
2. Project Planning & Component Selection
This week, we outlined the project’s objectives and created a detailed timeline to align tasks with deadlines. We also finalized the components necessary for the system:
DFRobot Development Board (DFR0478)
Soil Moisture Sensor (SEN0308)
SEN0245
Ultrasonic Sensor (HC-SR04)
800mAh LiPo Battery (3.7V) (BT06808)
ABT-414-RC Buzzer
RS PRO RGB LED 5 mm Through Hole
Oktapad Single Height 3U Extended Double-Sided Eurocard Prototyping Board
Conclusion: The group agreed that these components best fit our project needs. However, we need to evaluate battery efficiency once physical testing begins. The delayed components are a major concern.
3. Prototype Layout Discussion
To visualise the arrangement of the components, we used Tinker CAD and Fritzing for simulation. These tools helped us design a rough layout for the flood detection system, but certain limitations arose due to the unavailability of exact sensor models in the simulation tools. We explored alternatives to approximate real-world functionality and prepared for the integration of the actual components.
Additionally, we created a primary hand-drawn design of our product to assist in visualisation next week. We concluded that the current digital layout provides a solid starting point, but adjustments will be necessary once the real components are assembled.
Conclusion: The team concluded that the current layout is effective for initial planning. We need to review spacing and wiring constraints once physical integration begins.
4. Problems, Issues, and Concerns
- Delayed Components: The parts ordered on December 13, 2024, have not yet arrived, delaying real-world testing.
- Simulation Limitations: While useful, Tinker CAD and Fritzing lack accurate equivalents for some sensors, making real-world behaviour hard to simulate.
Despite these setbacks, we remain optimistic and continue working on areas within our control.
Conclusion: The team agreed to escalate the component delay issue by sending multiple emails to follow through with updates after every 2 days. Meanwhile, coding and simulation will continue using alternative tools.
Both ultrasonic and infrared sensors are used for distance measurement, but they operate on different principles and have distinct advantages:
Ultrasonic Sensor (HC-SR04): Utilises sound waves to measure distance by calculating the time taken for an echo to return. It is highly effective for detecting water levels as sound waves can reflect off liquid surfaces.
Infrared Sensor: Uses infrared light to detect obstacles and measure distances. While it can be useful in some applications, it is less effective in detecting water surfaces as infrared light can be absorbed or scattered by water.
Conclusion: The ultrasonic sensor was chosen for flood detection due to its reliability in measuring water levels. Infrared sensors may still be used for detecting solid obstacles in future iterations.
6. Responsibility Matrix
To ensure accountability and streamline workflow, we have updated the responsibility matrix with assigned tasks for each team member:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7. Tasks for Next Week
Follow-Up on Component Delivery: Sayed will contact the lab technician for updates on the delayed parts.
Refine Simulation Setup: Cian will identify and document substitutes in simulation tools to approximate sensor behaviour.
Outline Test Procedures: Sayem and Cian will create a checklist to verify each component's functionality upon arrival.
Continue Coding: Sayem will refine the threshold detection system, integrate a logging function, and optimise sensor calibration.
Update Blog Documentation: Sayed will summarise the progress made and include new findings in next week's update.
-
Week 1 Overview For our project, we are designing a flood detection system, aimed at enhancing safety during extreme weather events. The sys...
-
Summary of Week 3's Activities This week, we conducted real-life experiments to test the flood detection system. Our focus was on verify...
-
Overview of Week 2 Activities This week, we focused on testing the components, troubleshooting code integration, and ensuring that all par...