0% found this document useful (0 votes)
23 views5 pages

Plan Updated

The document outlines the design and implementation of a PID-based smart greenhouse system aimed at automating optimal environmental conditions for plant growth. It details key components including sensors and actuators, the software and PID algorithm implementation, and testing and tuning procedures. The expected outcome is an energy-efficient, automated system capable of controlling temperature, humidity, and light with minimal manual intervention.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views5 pages

Plan Updated

The document outlines the design and implementation of a PID-based smart greenhouse system aimed at automating optimal environmental conditions for plant growth. It details key components including sensors and actuators, the software and PID algorithm implementation, and testing and tuning procedures. The expected outcome is an energy-efficient, automated system capable of controlling temperature, humidity, and light with minimal manual intervention.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Comprehensive Plan: PID-Based Smart Greenhouse System

1. Objective:

Design and implement a PID-based smart greenhouse system to automate and maintain optimal
environmental conditions for plant growth by regulating temperature, humidity, light intensity, and soil
moisture.

2. System Overview:

The system will monitor environmental conditions using sensors and adjust actuators accordingly. A PID
controller will optimize control accuracy by minimizing errors in environmental variables.

3. Key Components & Connections:

1. Sensors (For feedback monitoring)

Component Arduino Pin Notes

DHT22 (Temperature & Humidity) D2 Data pin to D2, with 10kΩ pull-up resistor

LDR (Light Sensor) A0 Uses a 10kΩ resistor for a voltage divider

BH1750 (Light Sensor - I2C) A4 (SDA), A5 (SCL) Uses I2C communication

Soil Moisture Sensor A1 Analog input to measure soil moisture

CO2 Sensor (Optional) A2 Measures CO2 concentration

2. Actuators (Controlled by PID system)

Actuator Arduino Pin Connection Type

Fan (Cooling System) D3 (PWM) Via relay or MOSFET

Heater D4 (PWM) Via relay or MOSFET

Humidifier D5 (PWM) Via relay or MOSFET

Grow Lights D6 (PWM) Via relay or MOSFET

Water Pump (Irrigation) D7 Relay-controlled

3. Display & User Interface

Component Arduino Pin Notes

16x2 LCD (I2C - with backpack) A4 (SDA), A5 (SCL) Uses I2C communication

Push Buttons (for Setpoint Adjustments) D8, D9 Use pull-down resistors

4. Power Supply
• Arduino Uno → Powered via USB (5V) or 9V adapter.

• Sensors → Powered by Arduino’s 5V/GND.

• Relays & Actuators → Powered by external 12V/5V supply (Avoid overloading Arduino).

• Common Grounding → Connect all GND pins together.

4. Software & PID Algorithm Implementation

Required Arduino Libraries

• DHT sensor library (DHT.h)

• Wire Library (Wire.h) for I2C communication

• BH1750 Light Sensor Library

• PID Library (PID_v1.h)

Arduino Code

#include <PID_v1.h>

#include <DHT.h>

#include <Wire.h>

#include <BH1750.h>

// Define sensor pins

#define DHTPIN 2

#define RELAY_FAN 3

#define RELAY_HEATER 4

#define RELAY_HUMIDIFIER 5

#define RELAY_LIGHT 6

#define RELAY_PUMP 7

// Define setpoints

double setTemp = 25.0; // Desired temperature (°C)

double setHumidity = 60.0; // Desired humidity (%)

// PID variables

double tempInput, tempOutput;


double humidityInput, humidityOutput;

double Kp = 2.0, Ki = 5.0, Kd = 1.0;

// PID instances

PID tempPID(&tempInput, &tempOutput, &setTemp, Kp, Ki, Kd, DIRECT);

PID humidityPID(&humidityInput, &humidityOutput, &setHumidity, Kp, Ki, Kd, DIRECT);

// Sensor instances

DHT dht(DHTPIN, DHT22);

BH1750 lightMeter;

void setup() {

[Link](9600);

pinMode(RELAY_FAN, OUTPUT);

pinMode(RELAY_HEATER, OUTPUT);

pinMode(RELAY_HUMIDIFIER, OUTPUT);

pinMode(RELAY_LIGHT, OUTPUT);

pinMode(RELAY_PUMP, OUTPUT);

[Link]();

[Link]();

[Link]();

[Link](AUTOMATIC);

[Link](AUTOMATIC);

void loop() {

// Read sensors

tempInput = [Link]();

humidityInput = [Link]();
float lightLevel = [Link]();

// Compute PID outputs

[Link]();

[Link]();

// Control actuators

analogWrite(RELAY_FAN, tempOutput);

analogWrite(RELAY_HEATER, humidityOutput);

if (lightLevel < 10000) digitalWrite(RELAY_LIGHT, HIGH); // Turn on light if low

else digitalWrite(RELAY_LIGHT, LOW);

if (humidityInput < setHumidity) digitalWrite(RELAY_HUMIDIFIER, HIGH);

else digitalWrite(RELAY_HUMIDIFIER, LOW);

[Link]("Temperature: "); [Link](tempInput);

[Link](" | Humidity: "); [Link](humidityInput);

delay(1000);

5. Testing & Tuning

1. Testing Sensors

• Check if DHT22, BH1750, and soil sensors give correct readings.

• Test actuators individually using simple HIGH/LOW commands.

2. PID Tuning

• Adjust Kp, Ki, and Kd values manually or use Ziegler-Nichols tuning.

3. Simulation Tools

• Proteus (Best for circuit simulation with Arduino).

• Tinkercad (For simple virtual circuit testing, but no PID support).


• SimulIDE (Lightweight Arduino simulation).

6. Real-World Problems & Solutions

Problem Solution

Sensor inaccuracies Regular calibration & high-quality sensors

Power issues Use a separate 12V power supply for actuators

Relay failure Use solid-state relays for reliability

WiFi interference (if using ESP32) Shielding & dedicated communication channels

Overheating components Proper ventilation & heat sinks for MOSFETs

7. Expected Outcome

• Automated temperature, humidity, and light control for plants.

• Energy-efficient system with minimal manual intervention.

• Scalable design for various greenhouse sizes and crops.

You might also like