Plant Care Assistant




This DIY guide walks you through building a plant health monitoring system using a Raspberry Pi, a camera, and a custom-trained YOLOv8 model. The system detects if a Snake Plant (Dracaena trifasciata) or Peace Lily (Spathiphyllum wallisii) is healthy or unhealthy based on its leaf condition.
The project is aimed at:
- Urban dwellers with limited plant care knowledge
- Home gardeners
- Horticulture students
Supplies





Hardware
- Raspberry Pi 5
- MicroSD card (16 GB+)
- Raspberry Pi power supply
- USB Camera
- Raspberry Pi-compatible LCD display (e.g., 3.5" GPIO touch screen)
- RGB LED
- Jumper wires and breadboard
- Wooden/plastic enclosure with slots (laser-cut or handmade)
Software
- Raspberry Pi OS (64-bit)
- Python 3.10+
- OpenCV
- Ultralytics (for YOLOv8)
- Numpy
- gpiozero
- Your YOLO model (best.pt)
- Python script
- Optional HTML dashboard files
Software Setup
🔹 1.1 Install Raspberry Pi OS
- Flash Raspberry Pi OS (64-bit) using Raspberry Pi Imager.
- Boot and complete first-time setup (Wi-Fi, password, etc.).
🔹 1.2 Install Python Dependencies
- sudo apt update
- sudo apt install python3-pip python3-venv
- python3 -m venv plantenv
- source plantenv/bin/activate
- pip install opencv-python ultralytics gpiozero numpy
🔹 1.3 Prepare Project Directory
- mkdir ~/plant_monitor
- cd ~/plant_monitor
- # Transfer: main.py, best.pt, and any dashboard HTML files
AI Model
🔹 2.1 Classes Detected
- Healthy Snake Plant
- Unhealthy Snake Plant
- Healthy Peace Lily
- Unhealthy Peace Lily
🔹 2.2 Data Sources
Used public datasets and self-collected images:
- Roboflow: snake plant datasets
- Pinterest plant leaf images
Hardware Assembly
🔹 3.1 Camera
- Connect your USB camera to Raspberry Pi USB port.
🔹 3.2 LED Wiring
- Green LED
- Red LED
🔹 3.3 Display
- Mount your LCD display to GPIO headers.
- Follow display documentation to enable touchscreen.
🔹 3.4 Enclosure
- Mount components in a wooden or plastic box.
- Ensure openings for LCD, camera, and airflow.
Running the Detection Script


🔹 4.1 Start the Python Script
bash
cd ~/plant_monitor
source plantenv/bin/activate
python main.py
🔹 4.2 What Happens
- The camera captures the plant.
- The YOLOv8 model detects class.
- A bounding box (red or green) is displayed.
- The corresponding LED lights up.
- Results optionally shown on HTML dashboard.
Troubleshooting
Camera not detected
Check with lsusb, reboot Pi
LEDs not lighting
Check GPIO pin numbers and wiring
Bounding box not showing
Check if YOLO model loads correctly
No display on LCD
Ensure drivers are installed and display is connected properly