Complete IoT system for plant environment control
The overall objective of this project is to develop a smart pot as a small-scale controlled environment system for a plant to detect various environmental factors and make decisions to achieve the desired environment for the plant to grow. The IoT system includes multiple sensors and actuators that will interact with the plant. The sensing part comprises temperature and relative humidity, PAR, and soil moisture sensors. The actuators are a servo motor, an irrigation pump, an LED, and a lamp.
The learning goal is to learn and practice:
This project provides the opportunity to integrate several assignments we have been working on during the quarter. To control and achieve the desired growth environment for plants, we need to develop a program that prompts users to enter the desired values (set points or thresholds) for each parameter we will control. Additionally, it should constantly read the sensor data. Then, it should activate the actuators based on the input data from the users and sensors.
Workflow: Measuring a physical quantity → Decision making → Acting based on the decision
The code includes a main block and eight function blocks as follows:
| Condition | Action |
|---|---|
| Temperature > threshold defined by users | Turn on the LED connected to pin 26, assuming we are turning a fan ON. Otherwise, turn off the LED light. |
| Relative humidity > threshold defined by users | Rotate the servo motor 90 degrees, assuming the motor is opening a window in a greenhouse. Otherwise, set the angle to 0 degrees (closing the gate). |
| Soil moisture < threshold defined by users | Turn on the pump until the soil moisture returns to the desired level. The pump is connected to "relay 1". Otherwise, turn off the pump. |
| PAR < threshold defined by users | Turn on the light source until the light intensity gets back to the desired level. The light source is connected to "relay 2". Otherwise, turn off the light source. |
| Sensor/Actuator | Pin |
|---|---|
| Temp/RH sensor | Pin 14 |
| Soil moisture sensor connected to the general socket | Pin AD2 (analog to digital 2) |
| PAR sensor | Pin AD3 (analog to digital 3) |
| The Servo motor is connected to one of the top servo's pins | Pin 16 and 17, as we did for lab 7 |
| The pump is plugged into the relay module that is connected to the "relay 1" socket | Pin 13 |
| The light source is plugged into the relay module that is connected to "relay 2" socket | Pin 12 |
Naming: project_firstName_lastName.svg (e.g., project_ali_moghimi.svg)