G2: Autonomous Greenhouse Environment Controller - shalan/CSCE4301-WiKi GitHub Wiki

Autonomous Greenhouse Environment Controller

Name GitHub
Arwa Abdelkarim arwaabdelkarim
Kareem Elnaghy kareemelnaghy
Rana Taher rana5679

Github Repo: https://github.com/KareemElnaghy/Autonomous-Greenhouse-Environment-Controller.git

1. The Proposal

Abstract / Elevator Pitch:

Growing plants in a greenhouse means constantly juggling temperature, humidity, light, and watering. And getting any one of them wrong can damage or kill your plants. Most small greenhouses are managed manually, which means someone has to physically check on conditions regularly and intervene when something is off. This is tedious, error-prone, and simply not possible around the clock, requiring continuous monitoring which is difficult.

Our project is an embedded system that automates this entire process. It monitors soil moisture, air temperature, humidity, and light levels in real time, and automatically triggers the right response whether that's turning on a water pump, spinning up a ventilation fan, or switching on a grow light whenever conditions drift outside the configured safe range for the plant being grown.

The system is also designed to be genuinely useful beyond a single plant type. By letting the user configure thresholds for any plant's specific needs. Our system effectively turns any greenhouse into a tailored growing environment, adapting to what that plant actually needs rather than applying a one-size-fits-all approach. Adjusting these settings is done wirelessly from a phone over Bluetooth, and day-to-day monitoring happens entirely through the OLED screen.

Project Objectives & Scope:

Objectives:

  • Sensors continuously monitor soil moisture, air temperature, humidity, and light levels, each triggering their corresponding actuator automatically when conditions fall outside the configured range
  • All sensor reads are interrupt-driven, running under RTOS on the MCU with separate prioritised tasks per subsystem
  • Safety interlock logic prevents conflicting actuator states and gates the water pump if the water level is low
  • Live sensor readings and active alerts are shown on an OLED display, warnings displayed via LEDs and Buzzers
  • Plant thresholds are configurable wirelessly from a phone over Bluetooth

Stretch Goals:

  • Accommodation for multiple named plant profiles stored on the device and switchable
  • Timestamped event logging to a form of memory for review to further develop and optimize configurations
  • CO2 levels monitoring

2. System Architecture

2.1 High-Level Block Diagram:

Subsystem Breakdown:

A brief text description of how the major modules (e.g., motor control, user interface, wireless communication) interact.

3. Hardware Design

Component Selection:

Schematics & Wiring:

Circuit diagrams, pinout tables, and breadboard layouts.

Bill of Materials (BOM):

A table listing component names, part numbers, quantities, costs, and links to datasheets.

Power Budget:

Calculations ensuring your power supply can handle the peak current draw of all components combined.

4. Software Implementation

4.1 Software Architecture:

Description of the firmware design (e.g., Bare-metal Superloop, Interrupt-driven, or RTOS).

4.2 Flowcharts & State Machines:

Visual diagrams mapping out the core logic, state transitions, and interrupt service routines (ISRs).

4.3 Key Algorithms:

Explanations of any complex logic used (e.g., PID control loops, digital filtering, sensor fusion).

4.4 Development Environment:

Compilers, IDEs, and toolchains used (e.g., Keil, PlatformIO, STM32CubeIDE).

5. Testing, Validation & Debugging

5.1 Unit Testing:

How individual hardware components and software functions were tested in isolation.

5.2 Integration Testing:

How the system was tested as a whole.

5.3 Challenges & Solutions:

A log of major bugs, hardware failures, or design flaws you encountered, and the engineering steps you took to solve them.

6. Results & Demonstration

6.1 Final Prototype:

High-quality photos of the completed build.

6.2 Video Demonstration:

A link to a short video showing the system working in real-time under various conditions.

6.3 Performance Metrics:

Data showing how well the project met its initial objectives (e.g., "Response time was measured at 12ms, well within our 50ms goal").

7. Project Management

7.1 Division of Labor:

7.2 Timeline:

Date Milestone Deliverable / Task Status
Mon, Mar 30, 2026 Project kick-off Project handout issued. Team brainstorming begins. Done
Tue, Apr 14, 2026 Milestone 1: Team formation Team formed, roles assigned across hardware, control logic, and UI/comms. Done
Wed, Apr 15, 2026 Milestone 2: Proposal presentation In-class presentation covering problem statement, block diagram, sensor/actuator choices, and FreeRTOS task structure. Done
Mon, Apr 20, 2026 Checkpoint A: Wiki/page setup Wiki page live with approved proposal, block diagram, component list, and functional requirements.
Tue, Apr 22, 2026 Hardware sourcing SHT31, BH1750, moisture sensor, float switch, SSD1306 OLED, ESP32, and Nucleo all in hand.
Thu, Apr 24, 2026 Dev environment setup STM32CubeIDE with RTOS configured on Nucleo. ESP32 Bluetooth serial confirmed working with phone.
Wed, Apr 29, 2026 Milestone 3: Progress presentation & demo Live demo of at least one complete interrupt-driven sensor loop i.e. sensor firing, RTOS task responding, actuator switching correctly.
Fri, May 2, 2026 All sensor interrupts working All sensors wired to Nucleo. ISRs confirmed firing and posting to RTOS queues correctly.
Mon, May 4, 2026 Actuator control + interlock Pump, fan, and grow light switching correctly per thresholds. Interlock FSM preventing conflicting states.
Wed, May 6, 2026 Checkpoint B: Integration update Wiki updated showing which subsystem loops are integrated, any wiring or timing issues found, and plan for final week.
Fri, May 8, 2026 OLED + Bluetooth config OLED displaying live readings and alerts. Thresholds adjustable from phone over Bluetooth.
Mon, May 11, 2026 Full system integration All three subsystem loops running together under RTOS. System stable over an extended run with no task starvation or interlock violations.
Wed, May 13, 2026 Milestone 4: Final demo & presentation Final in-class presentation and live demo of the complete system. Final code and completed wiki page submitted.

8. Appendices & References

8.1 Source Code Repository:

Github Repo: https://github.com/KareemElnaghy/Autonomous-Greenhouse-Environment-Controller.git

8.2 References:

Links to datasheets, tutorials, academic papers, and course materials used during development.