GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - MoRe-O/Smart-Greenhouse: An automated greenhouse control system built on STM32 (BluePill) with LCD/Keypad UI, multi-sensor monitoring, and actuator automation.

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
FourthCube/FourthCube
FourthCube/FourthCube
 
 
Simu
Simu
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
فایل ارائه.docx
فایل ارائه.docx
 
 
فایل ارائه.pdf
فایل ارائه.pdf
 
 

Repository files navigation

Smart Greenhouse — STM32F103 (BluePill)

An automated greenhouse control system built on the STM32F103C8T6 (BluePill), monitoring environmental conditions and automatically controlling actuators (fan, water pump, servo-driven window, grow light) — with a keypad + LCD interface for manual control and live debugging.

This was a team project for our Embedded Systems course, developed and simulated in Proteus, programmed with STM32CubeMX + Keil (MDK-ARM).

Overview

The system continuously reads a set of analog sensors (temperature, gas/air quality, soil moisture, light, humidity, water level) plus a digital rain sensor, and automatically drives the greenhouse's actuators to keep conditions within target ranges. A 20×4 character LCD and 4×4 matrix keypad give the user a menu-driven interface to view live sensor readings, switch between automatic and manual control of the fan/pump, and access a dedicated debug page — all built without any RTOS, running on a single bare-metal control loop.

Features

  • Automatic climate control
    • Fan turns on based on temperature, gas level, or humidity thresholds
    • Water pump activates on low soil moisture, and skips watering if rain is detected or the water reservoir is low
    • Grow light toggles based on ambient light level
    • Buzzer + RGB-style status LEDs alert on high temperature
  • Motorized window (servo)
    • Smooth, non-blocking open/close motion (ramped pulse width, not an instant jump)
    • Physical lock button (interrupt-driven) that freezes the window at its current position
  • LCD + Keypad UI
    • Multi-page menu: help screen, main status, sensor detail, and a live debug page
    • Manual override for fan and pump directly from the keypad, with a one-key return to full-auto mode
  • Debounced keypad scanning tuned to avoid phantom key presses
  • Built with STM32 HAL (no RTOS) — a single non-blocking main loop drives sensing, control, UI, and I/O together

Tech Stack

  • MCU: STM32F103C8T6 ("BluePill")
  • Framework: STM32 HAL (via STM32CubeMX code generation)
  • IDE / Toolchain: Keil MDK-ARM
  • Simulation: Proteus (schematic + live simulation)
  • Language: C

Project Structure

Smart-Greenhouse/
├── FourthCube/FourthCube/
│   ├── Core/
│   │   ├── Inc/            # Header files (main.h, LCD1602.h, etc.)
│   │   └── Src/            # Application source (main.c, LCD1602.c, etc.)
│   ├── Drivers/            # STM32 HAL + CMSIS (generated by CubeMX)
│   ├── MDK-ARM/            # Keil project files
│   └── FourthCube.ioc      # CubeMX configuration file
└── Simu/                   # Proteus simulation project + backups

How to Build & Run

  1. Install STM32CubeMX and Keil MDK-ARM (or MDK-ARM Lite for smaller projects)
  2. Open FourthCube/FourthCube/FourthCube.ioc in CubeMX if you want to inspect/regenerate the peripheral configuration
  3. Open FourthCube/FourthCube/MDK-ARM/FourthCube.uvprojx in Keil
  4. Build the project (F7)
  5. Flash to an STM32F103C8T6 board via ST-Link (or your preferred programmer)

To simulate without hardware:

  1. Open the project in Proteus from the Simu/ folder
  2. Load the compiled .hex file (found in MDK-ARM/FourthCube/FourthCube.hex after building) onto the virtual MCU
  3. Run the simulation

Hardware / Pin Overview

  • Sensors (ADC): 3× temperature inputs, gas/air quality, soil moisture, light, humidity, water level
  • Digital input: Rain sensor
  • Actuators: Fan, water pump, grow light, buzzer, status LEDs (GPIO outputs)
  • Servo motor: Drives the window open/close mechanism via PWM (TIM3), with a physical lock button on an external interrupt line
  • User interface: 20×4 character LCD (custom driver) + 4×4 matrix keypad

Contributors

This was built as a team project:

  • Amirreza Farghani — hardware layout, servo/window control, actuator logic
  • Mohammadreza Osuli — air quality, water level & rain sensing, fan control
  • Mani Ebrahimi — keypad and LCD integration
  • Hosein Sabzforoush — light and water sensor logic

What I Learned

Working on the sensor and control logic taught me a lot about tuning threshold-based automatic control (avoiding oscillation between on/off states) and debugging real hardware issues like floating-pin spurious interrupts and keypad phantom key presses — problems that only show up once you move past pure simulation.

About

An automated greenhouse control system built on STM32 (BluePill) with LCD/Keypad UI, multi-sensor monitoring, and actuator automation.

Topics

bluepillccubemxembedded-systemshardware-automationkeil-mdkkeil-uvision5proteus-simulationsmart-greenhousestm32stm32f103

Resources

Readme
Activity

Stars

6 stars

Watchers

0 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.