Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Based Plant Health Monitoring System

View and Edit Project In Cirkit DesignerImage of Arduino UNO Based Plant Health Monitoring System

Circuit Documentation

Summary of the Circuit

This circuit is designed to monitor the health of a plant by measuring soil moisture, ambient light, and temperature. It uses an Arduino UNO as the central microcontroller to read data from a soil moisture sensor, a photocell (LDR), and a temperature sensor (LM35). The Arduino processes these readings and outputs the health status of the plant through the serial monitor. The circuit is powered by the Arduino's 5V output, and the sensors are connected to the analog input pins for data acquisition.

Component List

Temperature Sensor (LM35)

SparkFun Soil Moisture Sensor

Resistor

Arduino UNO

Photocell (LDR)

Wiring Details

Temperature Sensor (LM35)

SparkFun Soil Moisture Sensor

Resistor

Arduino UNO

Photocell (LDR)

Documented Code

// Plant Health Detection Code

int temp_pin = A0; // Temperature sensor pin
int light_pin = A1; // Light sensor pin
int soil_pin = A2; // Soil moisture sensor pin

void setup() {
  pinMode(temp_pin, INPUT);
  pinMode(light_pin, INPUT);
  pinMode(soil_pin, INPUT);
  Serial.begin(9600); // Start serial communication at 9600 baud rate
}

void loop() {
  float moisture_percentage;
  int soil_value;
  soil_value = analogRead(soil_pin); // Read soil moisture value
  moisture_percentage = (soil_value / 1023.00) * 100; // Convert to percentage

  int light_value = analogRead(light_pin); // Read light level
  int temp_value = analogRead(temp_pin); // Read temperature value
  temp_value = (temp_value / 1023.00) * 100; // Convert to percentage

  // Print temperature and moisture percentage to serial monitor
  Serial.print("Temperature = ");
  Serial.print(temp_value);
  Serial.print("\n");
  Serial.print("Moisture percent = ");
  Serial.print(moisture_percentage);
  Serial.print("\n");

  // Check if plant is healthy based on sensor values
  if (moisture_percentage < 70.00 || light_value < 512 || (temp_value < 23 || temp_value > 30)) {
    Serial.print("Plant not healthy\n");
  } else {
    Serial.print("Plant healthy\n");
  }

  delay(1000); // Wait for 1 second before next reading
}

This code continuously reads the values from the temperature, light, and soil moisture sensors. It then calculates the moisture percentage and checks if the plant is healthy based on predefined conditions. If the plant is not healthy, it prints "Plant not healthy" to the serial monitor; otherwise, it prints "Plant healthy". The readings and status are updated every second.