PyCon UK 2022

Build an automated watering system
09-17, 11:00–12:30 (Europe/London), Room B

In this workshop we will use a Raspberry Pi, a relay, a pump and a battery to build a watering system from scratch. I built this system during the pandemic, in the hope my plants would survive after being allowed to travel again.


This workshop meant for max 30 people which will work in teams of 3, the workshop is suitable for beginners.

Prerequisite:
Before the workshop, I would setup ssh on the Raspberry Pis and connect them to the wifi, additionally I would install pip3 on all Pis. I would also make sure every team has a pump, jumper cables, a battery and a relay.

Step 1 (approximately 15 min):
I would ask the participants to form teams of three, ideally with mixed experience (e.g. 2 beginners and one advanced)
Then I would briefly explain what ssh is and show them how to remote connect to their assigned Raspberry Pi by sharing my terminal.

Step 2 (20 - 25 min):
I would ask each team to install gpiozero using pip3 (showing on my terminal how it is done) and then encourage them to have a look at the gpiozero documentation and think how we could increase the voltage output for a certain amount of time on specific pins. After about 5 -10 min I would share a working script.

Step 3 (20 min):
In this step I will ask the teams to connect the relay to the Raspberry Pi, I will show a Powerpoint slide, showing the circuit, I will also briefly explain what a relay is, how it works and why we need it.
After the teams have their relays connected they will be able to test their script by running it and seeing the control led on the relay flash for a moment.

Step 4 (20 min):
In this step the teams will connect the 5V battery and the pump to the relay and test whether the pump is working.

Step 5 (10 min):
Wrap up and feedback
We can discuss possible extensions (e.g. using a solar panel instead of a battery)
Get a feel for if people enjoyed the workshop/learned something


Is your proposal suitable for beginners? – yes

Hi, I'm Astrid, a self taught software developer working for Current Health.
I started my programming journey about 6 years, teaching myself Python. Nowadays, I'm mainly fighting with Java and JavaScript, but I do still like to build Python projects in my free time.