You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
3-channel soil moisture sensing via analog conductivity probes
LED alert system — solid = sufficient moisture, blinking = water needed
Ultra low-power MCU (STM32F030, Cortex-M0) suitable for battery operation
USB battery powered — portable and field-deployable
ADC-based sensing with no external libraries
🧭 System Overview
Soil moisture is measured across 3 independent channels using analog conductivity sensors. Each channel drives a dedicated LED alert:
Solid LED → soil moisture is sufficient
Blinking LED → soil is dry, add water until the LED goes solid
🏗️ System Architecture
🎬 Live Demo
🧭 Board Information
Property
Value
Board
NUCLEO-F072RB
MCU
STM32F030F4Px, ARM Cortex-M0
Clock
48 MHz (internal PLL)
Flash / RAM
16 KB Flash / 4 KB RAM
Power Source
USB external battery → 3.3V reg
Logic Voltage
3.3V
🔌 Pin Mapping
Peripheral
MCU Pin
Function / Connection
Notes
LED alert_01
PA1
GPIO Output
Channel 1 alert
LED alert_02
PA2
GPIO Output
Channel 2 alert
LED alert_03
PA3
GPIO Output
Channel 3 alert
ADC_IN5
PA5
ADC Input
Sensor channel 1
ADC_IN6
PA6
ADC Input
Sensor channel 2
ADC_IN7
PA7
ADC Input
Sensor channel 3
💡 Alert Logic
LED State
Meaning
Action Required
🟢 Solid
Soil moisture is sufficient
None
🔴 Blinking
Soil is dry
Add water until LED goes solid
Each LED maps 1-to-1 with an ADC channel / probe, so you can monitor up to 3 separate plants or soil zones independently.
🚀 Getting Started
Prerequisites
STM32CubeIDE installed
arm-none-eabi-gcc v12.2.0
STM32F030F4Px board
ST-Link V2 programmer
Conductivity soil probes × 3
Build & Flash
# Clone the repo
git clone https://github.com/gitFrank77/Soil_monitor.git
# Open in STM32CubeIDE# File → Import → Existing Projects into Workspace# Build: Project → Build All (Ctrl+B)# Flash: Run → Debug (F11)
Usage
Insert the 3 soil probes into your plant pots
Power the board via USB battery
Observe the LEDs — blinking means your plant needs water!