Skip to main content
Version: ACS CC

Automatic Irrigation System

The project consists of an intelligent irrigation system for plants that constantly monitors essential parameters for optimal irrigation.

info

Author: Murarescu Carmen-Maria
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-CarmenMaria17

Description

The project consists of an intelligent irrigation system for plants that constantly monitors three essential parameters for optimal irrigation:

Soil humidity - determines when plants need water
Reservoir level - checks water availability for irrigation
Light intensity - prevents irrigation during periods of strong light

When soil moisture drops below a preset threshold, the system checks if the reservoir contains enough water and if the light intensity is suitable. If all conditions are met, it automatically activates a mini-pump that irrigates the plants. The system includes a display to show levels (low, medium, high) for the 3 parameters.

Motivation

I chose to develop this automatic irrigation system because I wanted to solve a practical problem many plant owners face, that being the inconsistent watering due to busy schedules or forgetfulness. Second, this project allows me to apply embedded systems knowledge in a hands-on way, working with multiple sensors and including a display for easy reading of the parameters.

Architecture

The main architectural components are:

  • RTC Clock with Battery - a clock that keeps the microcontroller sleeping, it wakes it at intervals of 10 minutes and completes 20 measurements for accuracy and then puts it back to sleep

  • Humidity Sensor & Photoresistor & Float Sensor - measures the soil humidity and if it is too low, the light is not too strong and there is water in the reservoir then the realy module starts the water pump and it waters the plant

  • Display - shows all the parameters and messages for the start of the process etc.

  • Water Pump - used to water the plant when necessary

Architectural Diagram

alt text

Log

Week 5 - 11 May

  • Connected the Hardware
  • Tested the sensors

Week 12 - 18 May

  • Almost completed the final arangements (I decided I want to put it all in a bigger box, with the display on top of it)
  • Updated the Bill Of Materials
  • Did the Kicad schematic again with the now used pins of the MCU
  • Added photos here of the hardware, that I will probably update again before the fair if something changes

Week 19 - 25 May

  • Completed the software implementation
  • Completed the final design
  • Finalized the documentation

Hardware Design

Sensors

  • Soil Hygrometer Humidity: A precision resistive humidity sensor that measures soil moisture.

  • Photoresistor: A light-dependent resistor that exhibits variable resistance inversely proportional to light intensity, enabling the system to monitor ambient light conditions for optimal plant growth.

  • Float Sensor: A mechanical sensor triggers when water levels reach predefined thresholds, preventing both reservoir depletion and overflow conditions.

Control and Timing Components

  • RTC (Real-Time Clock) Module: Incorporates a DS3231 enabling programmed sleep cycles for the microcontrollers via interrupt-based wakeup, significantly reducing power consumption.

Actuation

  • NPN Transistor: A NPN Transistor that provides safe switching of the water pump circuit.

  • Water Pump: A submersible pump capable of delivering appropriate water volume for plant irrigation.

Display

  • ST7735 LCD Display: A 1.8" TFT color display with SPI interface and embedded controller, providing visual representation of system status, sensor readings, and operational modes.

Schematics

alt text

Project Photos

alt text

alt text

alt text

alt text

alt text

alt text

alt text

Software Design

Description

  1. Design Patterns:
  • Manager/Controller pattern (FloatSensorManager, RtcManager)
  • State machine with protective logic
  • Statistical sampling for accuracy
  1. Key Features:
  • Smart protection mechanisms with conditional blocking
  • Energy-efficient sleep/wake cycles
  • Real-time status monitoring with visual feedback
  • Robust sensor data processing with thresholds

Software Diagram

alt text

Bill of Materials

Hardware

DeviceUsagePrice
2x Raspberry Pi Pico WThe microcontroller35 RON
Humidity SensorSoil Humidity Measurement15 RON
PhotoresistorLight Measurement2 RON
Float SensorChecks Water Level20 RON
RTC Clock with BatterySleep Mode for MCU20 RON
NPN TransistorControls the Water Pump0.17 RON
Water PumpWaters the Plant24 RON
LCD Screen ST7735Displays the measurements28 RON
Power Source - 5VPoweres the circuit5 RON
[Others (wires, breadboards, pins etc)]Used for connections10 RON

Software

LibraryDescriptionUsage
embassy-executorAsync/await runtime for embedded systemsProvides the core async runtime for concurrent task execution
embassy-timeTime handling for embedded systemsManages delays in sensor sampling, sleep cycle timing, and display transitions
embassy-rpRaspberry Pi Pico for EmbassyHardware abstraction layer for GPIO (float sensor, pump control), I2C (RTC communication), and SPI (display interface)
embedded-halHardware abstraction layer traitsCore traits for peripheral access
embassy-rp::adcADC module for Embassy RPReads analog values from light sensor and soil moisture sensor
embassy-rp::gpioGPIO control for Embassy RPControls float sensor input, water pump output, display control pins, and RTC interrupt
embassy-rp::i2cI2C communication for Embassy RPCommunicates with DS3231 RTC module for wake timer functionality and alarm management
embassy-rp::spiSPI communication for Embassy RPInterfaces with ST7735s display at 32MHz for real-time status visualization
mipidsiDisplay driver for small TFT displaysDrives ST7735s display with custom orientation and color graphics rendering
embedded-graphics2D graphics library for embedded devicesRenders text with multiple font styles and color-coded status information on display
display-interface-spiSPI display interface abstractionProvides SPI interface abstraction for the display driver
embassy-syncSynchronization primitives for EmbassyProvides mutex for shared SPI bus access between display components
heaplessCollections without heap allocationCreates formatted strings for display output without dynamic allocation
defmtEfficient logging frameworkProvides structured logging for sensor readings, system status, and debugging information
  1. Documentatie MCU
  2. Embassy Documentation
  3. Embassy-RP Crate Docs
  4. Embassy GitHub Repository