Greenhouse Controller System

Introduction

In our embedded systems class, our goal was to build a real-time greenhouse controller system that consisted of the following:

  • Monitoring system: MicroChip’s PIC18F45K22 microcontroller

  • Controlling system: Mbed’s LPC1768

  • Humidity and temperature channels: potentiometers

  • Limit control: buttons for increasing and decreasing high and low limits, as well as toggling the selected channel and limit

Interactions

  • Our sensors are simulated by potentiometers that provide analog values to our monitoring system using the PIC18F45K22’s ADC module. These sensors are sampled every 0.5s using a prescaled timer.

  • The monitoring system also averages the sensor readings, compares them to the predefined high and low limits, and displays an alert if we get an out-of-range value.

  • The monitoring system controls the intake fan and exhaust opening motors, adjusting them based on the sensor reading averages. Several rules were pre-programmed to adjust the motors based on the readings.

  • The monitoring system sends the sensor and motor data over two serial connections every 1s to:

    • the terminal for display

    • the controlling system for updating its display. A custom protocol is used to communicate this information to the controlling system

  • The monitoring system receives new limits from the main controlling microcontroller, and adjusts all motors and alerts in real time.

  • The controlling system (Mbed module) receives the sensor and motor data, and displays them via another serial connection to the terminal.

  • The high and low limits of the sensor readings are adjustable by pressing the buttons attached to the controlling system. When a high or low limit for a channel is adjusted, the controlling system sends back the new limit to the monitoring system to adjust its readings and alerts.