GSM Smart Irrigation & Automated Flood Control System
Friday, August 28, 2026
An automated agricultural irrigation and telemetry platform designed to optimize water usage and protect crops from inundation. Powered by an Arduino microcontroller and a SIM808 GSM/GPRS module, the system enables two-way remote SMS control, real-time ultrasonic water level profiling, automated pump cutoff, and instant flood mitigation with dedicated drainage actuation.
Key Technical Features
- Bidirectional Cellular Control: Operates over cellular networks using AT commands via the SIM808 module, enabling farmers to trigger irrigation, stop pumps, or fetch real-time telemetry from any standard mobile phone via SMS.
- Closed-Loop Ultrasonic Level Sensing: Uses an HC-SR04 ultrasonic transducer to continuously calculate water depth and volume percentages, automatically stopping the main pump when optimal saturation is reached to prevent water waste.
- Autonomous Flood Detection & Drainage: Integrates a ground moisture/flood sensor that immediately activates a high-flow secondary drainage pump upon detecting field inundation while dispatching urgent SMS alerts to the operator.
- Live Local Telemetry Display: A 16x2 liquid crystal display with an I2C backpack provides instant local feedback on pump operating state, active runtime, flood warnings, and reservoir capacity percentages.
- Isolated High-Current Actuation: Employs an optocoupled multi-channel relay module to switch high-draw 12V DC diaphragm pumps safely without introducing voltage sags or inductive flyback spikes to the MCU.
Hardware Architecture
Core Components
- Microcontroller: Arduino Uno (ATmega328P) running the master state and automation loop.
- Cellular Transceiver: DFRobot SIM808 GSM/GPRS/GPS module with dedicated SIM card integration.
- Level Sensor: HC-SR04 Ultrasonic Distance Sensor mounted over the water basin.
- Flood Sensor: Resistive soil moisture / immersion detection probe placed at critical field elevation.
- Actuation System: Dual 12V high-pressure DC diaphragm water pumps (Main Supply Pump & Emergency Drain Pump).
- Driver Interface: Optocoupled 5V relay module with active-low switching logic.
- Display Interface: 16x2 Character LCD with PCF8574 I2C expander (Address
0x27). - Power Supplies: Dual 12V DC power adapters with step-down regulation for logic and pump rails.
Pin Mapping
Digital Pin 10/Digital Pin 11: SIM808TX/RX(SoftwareSerial)Digital Pin 7: UltrasonicTRIGDigital Pin 8: UltrasonicECHODigital Pin 13: Main Irrigation Pump Relay (IN1)Digital Pin 12: Emergency Drainage Pump Relay (IN2)Analog Pin A0: Soil / Flood Sensor Digital InputAnalog Pin A4/Analog Pin A5: 16x2 LCDSDA/SCL(I2C Bus)
Control Logic & SMS Commands
Supported SMS Commands
pump on: Energizes the main irrigation pump, starts runtime tracking, and dispatches a confirmation SMS.pump off: De-energizes the main irrigation pump and returns a shutdown acknowledgement SMS.pump status: Reads current ultrasonic depth, evaluates active run duration (in minutes), and replies with a complete telemetry report.
Water Level Calculation
Distance measurements are mapped inversely to derive the container fill percentage:
$$\text{Level \%} = \left( \frac{\text{Max Level} - \text{Current Distance}}{\text{Max Level} - \text{Min Level}} \right) \times 100$$
Firmware Implementation
The firmware polls for incoming SMS messages via SoftwareSerial, handles non-blocking ping calculations for water levels, and executes immediate emergency overrides whenever flood conditions are sensed.
