Smart Flood Drain Monitoring System Using Arduino and Raspberry Pi
by armaan4806 in Circuits > Raspberry Pi
8 Views, 0 Favorites, 0 Comments
Smart Flood Drain Monitoring System Using Arduino and Raspberry Pi
The Smart Flood Drain Monitoring System is an embedded system developed to monitor and respond to flood-related conditions in a drainage system. The project uses a water level sensor, rain sensor and water flow sensor to collect environmental data and identify possible flooding conditions.
An Arduino Nano 33 IoT collects the readings from the sensors and communicates with a Raspberry Pi using Wi-Fi and MQTT. The Raspberry Pi processes the collected information and classifies the system condition as Normal, Warning, Critical or Sensor Fault.
Based on the detected condition, the system can control different output devices, including a servo motor, water pump, buzzer and status LEDs. A Node-RED dashboard is also used to display sensor readings, system status and alerts.
The main aim of this project is to demonstrate how embedded systems, sensors and wireless communication can be combined to provide continuous monitoring, decision-making and automatic responses to changing flood conditions.
Supplies
The following hardware components and materials are required to develop the Smart Flood Drain Monitoring System.
Main controllers
- Arduino Nano 33 IoT
- Raspberry Pi 4
- MicroSD Card
Sensors
- Water Level Sensor
- Rain Sensor
- Water Flow Sensor
Output components
- Servo Motor
- DC Water Pump
- Motor Driver / Relay Module
- Buzzer
- Green LED
- Yellow LED
- Red LED
Electronic components
- Resistors
- Breadboard
- Jumper Wires
- Power Supply
- OLED / LCD Display
Prototype materials
- Water Container / Tank
- Tubing / Pipes
- Model Drainage Channel
- Movable Drainage Gate
Understanding the System Architecture
Before assembling the hardware, it is important to understand how the different components work together.
The water level sensor, rain sensor and water flow sensor collect environmental information from the model drainage system. These sensors are connected to the Arduino Nano 33 IoT, which collects the readings and sends the information to the Raspberry Pi through Wi-Fi and MQTT.
The Raspberry Pi processes the incoming information and determines the current flood condition. The system identifies four possible conditions: Normal, Warning, Critical and Sensor Fault.
Depending on the detected condition, the system can activate the connected output devices, including the servo motor, water pump, buzzer and status LEDs. The Node-RED dashboard provides a visual interface for monitoring the readings and system alerts.
Preparing the Hardware
Start by preparing all the required electronic components and prototype materials. Place the Arduino Nano 33 IoT and Raspberry Pi in a suitable position where the wiring and connections can be organised safely.
Prepare the model drainage channel using a water container, tubing or pipes. Position the water level sensor, rain sensor and water flow sensor according to their intended functions.
Place the servo motor near the movable drainage gate so that it can control the gate movement. Position the water pump and connect it to the drainage setup. The buzzer and LEDs are used to provide visual and audio indications of the system condition.
Before powering the circuit, check that the connections are secure and that the power requirements of each component are suitable.
Connecting the Sensors and Output Devices
Connect the water level sensor, rain sensor and water flow sensor to the Arduino Nano 33 IoT. These sensors provide the environmental readings required for flood monitoring.
The servo motor, water pump, buzzer and status LEDs are connected as output devices. They allow the system to respond to the flood condition identified during processing.
The OLED or LCD display can also be used to show information locally. A breadboard and jumper wires help organise the electronic connections.
After completing the wiring, inspect each connection and make sure that the components receive the correct power supply. Pay particular attention to the power requirements of the motors and other output devices.
Programming the Arduino Nano 33 IoT
The Arduino Nano 33 IoT is responsible for collecting information from the connected sensors.
The program reads the water level, rainfall and water flow information. These readings are then prepared for communication with the Raspberry Pi.
The Arduino program is developed and uploaded using the Arduino IDE. After uploading the code, the Serial Monitor can be used to check the sensor readings and confirm that the Arduino is collecting information correctly.
The Arduino also uses its Wi-Fi connectivity to communicate with the Raspberry Pi through MQTT.
Setting Up Communication Using MQTT
The project uses Wi-Fi and MQTT to establish communication between the Arduino Nano 33 IoT and Raspberry Pi.
Wi-Fi provides the wireless network connection between the two devices. MQTT is used to transfer sensor readings and system information through a lightweight messaging system.
The Raspberry Pi runs the MQTT broker using Mosquitto. The Arduino publishes sensor information, and the Raspberry Pi receives the information for further processing.
This communication method allows the system to transfer monitoring information without requiring a direct wired connection between the two controllers.
Setting Up Node-RED
Node-RED is used to create the monitoring interface for the Smart Flood Drain Monitoring System.
The Node-RED environment runs on the Raspberry Pi and receives information from the system through MQTT. The received information can be processed and displayed using dashboard widgets.
The dashboard is designed to display the current flood status, water level, rainfall information and water flow readings. It also provides alerts when abnormal conditions are detected.
This interface allows users to monitor the drainage system remotely and understand its current condition without needing to inspect the physical prototype directly.
Implementing Flood Detection and Automatic Responses
The Raspberry Pi processes the information received from the sensors and determines the current flood condition.
The system uses four main status classifications:
- Normal: The drainage system is operating under normal conditions.
- Warning: The system identifies a possible increase in flood risk.
- Critical: The system detects a critical condition and activates the appropriate automatic responses.
- Sensor Fault: The system identifies an abnormal or faulty sensor condition.
Depending on the detected condition, the system can control the servo motor, water pump, buzzer and status LEDs. These outputs provide automatic responses and help indicate the current system condition.
Testing the System
After completing the hardware connections and software configuration, the system needs to be tested to check that the different components work together correctly.
The water level sensor is tested by changing the water level in the container and observing the readings. The rain sensor is checked under dry and wet conditions, while the water flow sensor is tested by allowing water to move through the tubing.
The communication between the Arduino and Raspberry Pi is checked through MQTT messages. The Node-RED dashboard is also tested to confirm that sensor information and system status are displayed correctly.
Finally, the output devices are tested to check that the servo motor, water pump, buzzer and LEDs respond according to the programmed conditions.
Final Project Result
The Smart Flood Drain Monitoring System demonstrates how multiple sensors, embedded controllers and wireless communication can be combined to monitor drainage conditions.
The Arduino Nano 33 IoT collects environmental readings from the sensors and communicates with the Raspberry Pi using Wi-Fi and MQTT. The Raspberry Pi processes the information and determines the current flood condition. The system can then control output devices and display monitoring information through the Node-RED dashboard.
The project provides a practical demonstration of real-time environmental monitoring, embedded system communication and automatic responses to changing flood conditions.