Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Automated Plant Watering System with Raspberry Pi & Web Dashboard

Create a self‑watering system that monitors soil moisture and waters your indoor plant automatically, all controlled from a web interface.

Overview

This guide walks you through every step—from selecting components to wiring, coding, and launching a Flask web dashboard. The result is a reliable, low‑maintenance watering solution that runs on a Raspberry Pi.

Materials

Power Setup

Use a USB cable as a 5 V source. Strip the cable, solder thicker gauge wires to the red (+) and black (–) conductors, and connect them to a 5 V wall charger. Verify the voltage with a multimeter before connecting to the Pi.

GPIO Wiring (Pi 3)

Attach the hose to the pump’s outlet and position the other end near the plant’s soil. Fill the hose reservoir with water.

Hardware Assembly

Secure the hose to the pump using electrical tape to prevent leaks. Ensure all connections are insulated and the Pi is powered separately from the pump’s power to avoid electrical noise.

Software Overview

The project comprises four Python scripts and a Flask web interface:

Installing Dependencies

On the Pi, run the following:

$ python3 -m pip install RPi.GPIO flask psutil

GPIO Control Script (water.py)

The script exposes two key functions: get_status() returns a wet/dry string, and pump_on() activates the pump for one second. Test it interactively:

$ python3
>>> import water
>>> water.get_status()
'Dry'
>>> water.pump_on()
Pump activated for 1 s.

If the sensor reports incorrectly, adjust the small potentiometer on the module until the second LED lights while the soil is moist.

Running the Flask Dashboard

Place web_plants.py in the same folder as water.py and create a subdirectory called templates containing main.html. Then start the server:

$ sudo python3 web_plants.py

Navigate to the Pi’s IP address in a browser; you’ll see a dashboard with real‑time moisture status and a manual “Water Now” button. This page is powered by Flask and communicates with the GPIO layer via the helper scripts.

Automate Startup with Cron

To ensure the web server starts automatically after reboot, edit the root crontab:

$ sudo crontab -e

Add the line below, replacing /home/pi/project with your actual path:

@reboot cd /home/pi/project && sudo python3 web_plants.py

Reboot the Pi and confirm the dashboard loads automatically.

Next Steps

With the system operational, you can enhance it by adding:

For deeper learning, consult Raspberry Pi GPIO tutorials and Flask‑GPIO integration guides.

Manufacturing process

  1. How to Read Temperature with a DS18B20 on Raspberry Pi 2
  2. Home Energy Centre: Monitoring Solar PV, Thermal Panels, and Room Temperatures with Raspberry Pi and Moteino
  3. Accurate Temperature Monitoring in a Server Closet with Raspberry Pi
  4. Build a Headless Raspberry Pi 2 Water Alarm with Adafruit T‑Cobbler Plus
  5. Master Raspberry Pi GPIO: Interfacing a PIR Motion Sensor on B+/Model 2
  6. Raspberry Pi Home Security System: PIR Motion Detection + Camera Email Alerts
  7. How to Connect, Calibrate, and Program the HC‑SR501 PIR Motion Sensor with a Raspberry Pi
  8. gatoBot: Raspberry Pi Zero W Web‑Controlled Robot with Live Video Streaming
  9. Arduino-Powered Automatic Plant Watering System
  10. Smart Automated Garden System with Arduino UNO and Raspberry Pi