Skip to Content

Plant Growth Monitor

The Plant Growth Monitor is an innovative automated system designed to measure and track the height of plants over time using an ultrasonic sensor. At the heart of this system is the Arduino Uno, which processes the sensor data and provides real-time updates via an LCD display or Bluetooth module, allowing users to monitor growth changes remotely. This project is perfect for gardening enthusiasts, farmers, or anyone interested in plant care, as it offers a simple yet effective way to track plant health and growth patterns. By combining basic electronics with practical applications, the Plant Growth Monitor not only simplifies plant care but also serves as an excellent introduction to sensor integration, data processing, and IoT (Internet of Things) concepts. Whether you're a beginner or an experienced maker, this project is a great way to explore the intersection of technology and nature.

Components Required

  • Arduino Uno
  • HC-SR04 Ultrasonic Sensor 
  • 16 * 2 LCD with I2C  
  • Buzzer
  • Jumper wires
  • Power Supply 
  • Bread Board 

Circuit Diagram

1. Connect the Ultrasonic Sensor to Arduino: 

  • VCC → 5V on Arduino 
  • GND → GND on Arduino 
  • Trig (Trigger Pin) → D9 on Arduino 
  • Echo (Echo Pin) → D10 on Arduino 

2. Connect the LCD Display : 

  • VCC → 5V on Arduino 
  • GND → GND on Arduino 
  • SDA → A4 on Arduino 
  • SCL → A5 on Arduino 

3. Power the System:  


CODE

#include <Wire.h> 

#include <LiquidCrystal_I2C.h> 

#define TRIG 9 

#define ECHO 10 

LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address 0x27

float previousHeight = 0; 

void setup() { 

 lcd.begin(16, 2); 

 lcd.backlight(); 

 lcd.setCursor(0, 0); 

 lcd.print("Plant Height: "); 

  

 pinMode(TRIG, OUTPUT); 

 pinMode(ECHO, INPUT); 

void loop() { 

 digitalWrite(TRIG, LOW); 

 delayMicroseconds(2); 

 digitalWrite(TRIG, HIGH);

 delayMicroseconds(10); 

 digitalWrite(TRIG, LOW); 

 

long duration = pulseIn(ECHO, HIGH); 

 float height = duration * 0.034 / 2; // Convert to cm 

 lcd.setCursor(0, 1); 

 lcd.print(height); 

 lcd.print(" cm "); // Clear extra digits 

 

// Detect significant growth 

 if (abs(height - previousHeight) > 1.0) { 

​ Serial.print("Plant Growth Updated: "); 

​ Serial.print(height); 

​ Serial.println(" cm"); 

​ previousHeight = height; 

 } 

 delay(5000); // Update every 5 seconds 

}

CODE EXPLANATION

1. Include Libraries and Define Pins

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

#define TRIG 9

#define ECHO 10

  • Wire.h: This library is used for I2C communication, which allows the Arduino to communicate with the LCD display.
  • LiquidCrystal_I2C.h: This library simplifies controlling the I2C LCD display.
  • TRIG 9 and ECHO 10: These define the pins connected to the ultrasonic sensor's trigger (TRIG) and echo (ECHO) pins.

2. Initialize the LCD Display

LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address 0x27
  • This line initializes the LCD display with the I2C address 0x27. The display has 16 columns and 2 rows.

3. Declare Variables

float previousHeight = 0;
  • previousHeight: This variable stores the last recorded height of the plant to detect significant growth changes.

4. Setup Function

void setup() { 
  lcd.begin(16, 2);
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Plant Height: ");
 
  pinMode(TRIG, OUTPUT);
  pinMode(ECHO, INPUT);
}  
  • lcd.begin(16, 2): Initializes the LCD display with 16 columns and 2 rows.
  • lcd.backlight(): Turns on the LCD backlight.
  • lcd.setCursor(0, 0): Positions the cursor at the start of the first row.
  • lcd.print("Plant Height: "): Displays the text "Plant Height: " on the LCD.
  • pinMode(TRIG, OUTPUT): Sets the TRIG pin as an output to send signals to the ultrasonic sensor.
  • pinMode(ECHO, INPUT): Sets the ECHO pin as an input to receive signals from the ultrasonic sensor.

5. Loop Function

void loop() { 
  digitalWrite(TRIG, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG, LOW);
 
  long duration = pulseIn(ECHO, HIGH);
  float height = duration * 0.034 / 2; // Convert to cm
 
  lcd.setCursor(0, 1);
  lcd.print(height);
  lcd.print(" cm "); // Clear extra digits
 
  // Detect significant growth
  if (abs(height - previousHeight) > 1.0) {
    Serial.print("Plant Growth Updated: ");
    Serial.print(height);
    Serial.println(" cm");
    previousHeight = height;
  }
 
  delay(5000); // Update every 5 seconds
}

The loop() function runs repeatedly, and here's what it does:

  • Trigger the Ultrasonic Sensor:
digitalWrite(TRIG, LOW); 
delayMicroseconds(2);
digitalWrite(TRIG, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG, LOW);
    • The TRIG pin sends a 10-microsecond pulse to the ultrasonic sensor to initiate a measurement.
  • Measure the Echo Duration:
long duration = pulseIn(ECHO, HIGH); 
    • The duration is converted to distance (in centimeters) using the formula:
      distance = (duration * speed of sound) / 2.
      The speed of sound is approximately 0.034 cm/µs.
  •  Display the Height on the LCD:
lcd.setCursor(0, 1); 
lcd.print(height);
lcd.print(" cm ");
    • The height is displayed on the second row of the LCD, followed by the unit "cm".

Detect Significant Growth:

if (abs(height - previousHeight) > 1.0) { 
    Serial.print("Plant Growth Updated: ");
    Serial.print(height);
    Serial.println(" cm");
    previousHeight = height;
}
  • If the height changes by more than 1 cm, the new height is printed to the Serial Monitor, and previousHeight is updated

6. Delay:

delay(5000); // Update every 5 seconds 
    • Waits 5 seconds before taking the next measurement.

How It All Works Together

  1. The ultrasonic sensor sends out a sound wave and measures the time it takes for the wave to bounce back after hitting an object (in this case, the plant).
  2. The distance (height) is calculated and displayed on the LCD.
  3. If the height changes by more than 1 cm, the new height is printed to the Serial Monitor.
  4. The process repeats every 5 seconds.

OBSERVING FUNCTIONALITY 

  • Place the ultrasonic sensor above the plant (pointing downward).
  • The sensor measures the distance to the plant’s top and calculates height. 
  • The Arduino updates the LCD or sends data via Bluetooth (if added).
  • Growth changes greater than 1 cm trigger an update.

COMMON PROBLEMS AND SOLUTIONS

1. Inaccurate Height Measurements 

  • Ensure the sensor is stable and aligned correctly above the plant. 
  • Reduce environmental interference from wind or obstacles. 

2. No Readings on LCD 

  • Check SDA (A4) and SCL (A5) connections if using I2C. 
  • Verify that the LCD address (0x27) is correct in the code. 

3. Growth Changes Not Updating 

  • Reduce the threshold value (currently 1 cm) in the code for more sensitivity. 
  • Ensure sensor readings are consistent before comparison.

Conclusion

This project not only simplifies plant care but also serves as an excellent introduction to key concepts in electronics, sensor integration, and IoT (Internet of Things). Whether you're a beginner exploring the basics of Arduino programming or an experienced maker looking to apply your skills to real-world applications, the Plant Growth Monitor is a rewarding and educational endeavor.

By combining affordable components with straightforward code, this system demonstrates how technology can enhance our understanding of natural processes. It encourages experimentation, problem-solving, and creativity, making it a perfect project for classrooms, hobbyists, or anyone passionate about plants and technology. With potential expansions like data logging, cloud integration, or automated alerts, the possibilities for this project are endless. Ultimately, the Plant Growth Monitor is a testament to how small, well-designed systems can have a meaningful impact on everyday life.Happy tinkering!


Comments

Gas Leakage Detection System