Garden & FarmingEngineer

Hydroponics Controller: Pumps, Lights and Alerts

Schedule grow lights and nutrient pumps, monitor climate and get alerts when something drifts.

LevelEngineer
Time4 h
Est. cost~$113
Steps5

Indoor growing is all about consistency. A Pi can run light and pump schedules on low-voltage gear, log the environment and warn you before a problem kills a crop.

⚠ SAFETY
Water and electricity: keep all electronics above and away from reservoirs, use drip loops on cables and protect outlets with GFCI.

Video tutorial

▶ hydrosys4 raspberryWatch on YouTube ↗

Video by hydrosys4 raspberry, embedded from YouTube. The written steps below are our own and match the parts list.

Mission steps

  1. Choose low-voltage gear

    Use 12 V LED grow lights and 12 V pumps switched by the relay module. For mains-powered equipment, use certified smart plugs controlled by Home Assistant instead.

  2. Wire the relays

    Relay inputs to GPIO17 and GPIO27. Many relay boards are active-low — gpiozero's active_high=False handles that.

  3. Schedule with code

    Lights 16 hours on, pump 15 minutes every hour — the script below does it without cron.

  4. Monitor the climate

    Log temperature and humidity with the BME280; add analog pH or EC probes through the ADS1115 when you are ready.

  5. Alert

    Send a phone notification (ntfy) when humidity or temperature leaves your target range.

Code

from gpiozero import OutputDevice
import time, datetime

light = OutputDevice(17, active_high=False, initial_value=False)
pump  = OutputDevice(27, active_high=False, initial_value=False)

while True:
    now = datetime.datetime.now()
    light.value = 6 <= now.hour < 22          # 16 h photoperiod
    pump.value = now.minute < 15              # 15 min every hour
    time.sleep(20)

Tip: test every script on the bench before installing it in a moving machine.

Questions

Are pH sensors worth it?

Yes for serious growers, but cheap probes drift and need regular calibration with buffer solutions. Start with manual test strips.