Designing the water pump controller


#1

I’d like to share some information about the water pump controller.

The water pump itself is powered by 12V, so we need to route one of the cables via the relay and job is done.

The credit goes to to the guy who put a video how to connect the wires and shared some sample code:

The necessary code is straightforward:

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

GPIO.setup(2, GPIO.OUT)
GPIO.output(2, GPIO.HIGH)

GPIO.output(2, GPIO.LOW)
time.sleep(2)

GPIO.cleanup()

The Raspberry Pi Zero W costs £12.82 (+delivery, in my case £2.99). It’s from here:

The four channel relay module costs $1.93 (+delivery, in my case $0.21). It’s from here:

The code is available on Github: