Skip to main content
Version: FILS English

Smart Irrigation System

info

Author: Niculae Filip Ioan
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-NFI-279

Description

This project presents a small-scale smart irrigation system capable of automating or manually controlling water delivery to a cultivated area. Managed through a Windows desktop GUI developed using ImGui and DirectX 11, the system communicates via UART to display real-time environmental and system data.

Users can switch between AUTO mode, where irrigation is triggered automatically based on soil humidity, and MANUAL mode, which allows full control over the water pump and specific water quantities to be dispensed.

Additional features include the ability to monitor parameters such as external temperature, atmospheric pressure, water tank temperature, and current water volume. The system also supports tank configuration, enabling users to input its shape and dimensions so that accurate calculations can be made based on sensor readings. This project demonstrates how digital interfaces and real-time sensor integration can support precision irrigation, even at a reduced scale.

Motivation

I’ve always been fascinated by how technology can make life easier, and agriculture is a perfect area to apply that. This project allows me to combine my passion for tech with my interest in sustainable practices. I wanted to create a system that can help people automate the irrigation process and make it more efficient, especially for small-scale or hobbyist growers.

Architecture

The following diagram presents an overview of the physical interconnections in the system:

System schematic

NUCLEO-F411RE

  • Role: Central controller that reads sensor data, manages irrigation logic, triggers alerts, and communicates with the desktop app.
  • Interfaces Used:
    • I2C: BME280
    • ADC: Soil Moisture Sensor, NTC Thermistor
    • Digital GPIO: HC-SR04, Relay Module
    • PWM: Passive Buzzer
    • UART: Communication with ImGui App

BME280 Sensor

  • Interface: I2C
  • Role: Measures atmospheric temperature and pressure
  • Pins Used:
    • SCL: PB6
    • SDA: PB7
  • Connection: Connected directly to NUCLEO via I2C1

HC-SR04 Ultrasonic Sensor

  • Interface: Digital GPIO
  • Role: Measures distance to estimate water level in tank
  • Pins Used:
    • Trig: PA8 (Output)
    • Echo: PA9 (Input)
  • Connection: Trigger pin sends pulse, Echo pin receives return

Soil Moisture Sensor

  • Interface: ADC
  • Role: Detects soil humidity level
  • Pins Used:
    • Signal: PA0
  • Connection: Connected to ADC as voltage divider output

NTC Thermistor

  • Interface: ADC
  • Role: Measures temperature (soil or ambient)
  • Pins Used:
    • Signal: PA1
  • Connection: Voltage divider setup; analog output to ADC pin

4-Channel Relay Module

  • Interface: Digital Output
  • Role: Switches power to the Mini Submersible Water Pump
  • Connection:
    • Controlled by NUCLEO through level shifter
    • Relay IN pins connected to 5V level-shifted GPIO

Mini Submersible Water Pump

  • Interface: Relay-controlled
  • Role: Dispenses water to the plants
  • Power: Controlled via relay module from a 5V power source

Passive Buzzer

  • Interface: PWM / GPIO
  • Role: Beeps for alerts (dry soil, low water, etc.)

UART Communication

  • Interface: UART over USB
  • Role: Sends data to and receives commands from ImGui desktop app

Level Translator

  • Role: Converts 3.3V GPIO signals from NUCLEO to 5V for relay module compatibility
  • Connection: Between NUCLEO GPIO pins and Relay IN pins
  • Power Source: 5V external power

5V Power Source

  • Role: Powers the following modules:
    • Relay module
    • Mini Submersible Water Pump
  • Important: This power source is separate from the USB powering the NUCLEO board

Log

Week 6 - 12 May

Week 7 - 19 May

Week 8 - 26 May


Hardware

Schematics

Place your KiCAD schematics here.

Bill of Materials

DeviceUsagePrice
NUCLEO F411REThe microcontroller65 RON
HC-SR04 Ultrasonic SensorDistance Measurement15 RON
BME280 ModuleBarometric Pressure & Temperature20 RON
4 Channel Level TranslatorVoltage Level Translator5 RON
4 Relay ModuleControls devices14 RON
Mini Submersible Water PumpWater Pump10 RON
Ground Humidity Sensor ModuleDetects soil humidity10 RON

Software

LibraryDescriptionUsage
embedded-halHardware abstraction traits for embedded systemsUsed for ADC, GPIO, and I2C traits
embassyAsync framework for embedded systemsUsed for async execution and peripheral control
embassy-stm32STM32 HAL for EmbassyUsed to control STM32F411RE peripherals
embassy-timeAsync timing utilitiesUsed for delays and timers
embassy-syncSync primitives for async tasksUsed for potential task synchronization
bme280Driver for BME280 sensorUsed for reading temperature and pressure
hcsr04_asyncHC-SR04 ultrasonic sensor driverUsed for measuring distance
panic-probePanic handler for embedded systemsUsed for debugging panic messages
defmtLogging framework for embedded developmentUsed for efficient logging over RTT
libmMath functions for no-std environmentsUsed for thermistor temperature calculation

  1. Previous Implementation of My Project For InfoEducatie
  2. UART Communication with STM32
  3. Automatic Plant Watering
  4. Nerdcave