100 Days of Learning: Day 33 – Pumping water with the Pimoroni Grow HAT Mini

Here is Week 5 of my log book.

I will be following the Pimoroni’s Auto-Watering with Grow guide.

TL;DR; Final test results

Here is a short video showing the system pumping water 😀

Initial setup

It would be best to do some initial software setup before I start hooking up water pumps and making a big ol mess of my house.

First I will make sure that the grow-python software is not running as a service and thus I can manually stop the program when things start going wrong.

$ ssh -p 8204 pi@growpi.local
pi@growpi:~ $ sudo systemctl stop grow-monitor.service
pi@growpi:~ $ sudo systemctl disable grow-monitor.service

Next I only want to attach 1x soil moisture sensor and 1x water pump to the system.

pi@growpi:~ $ cd ~/Pimoroni/growhat/examples
pi@growpi:...$ ls -la
total 64
drwxr-xr-x 5 root root  4096 Apr  9 20:10 .
drwxr-xr-x 3 root root  4096 Apr  4 20:26 ..
-rw-r--r-- 1 root root  2936 Apr  4 20:26 README.md
drwxr-xr-x 2 root root  4096 Apr  5 12:34 advanced
drwxr-xr-x 2 root root  4096 Apr  4 20:26 icons
-rw-r--r-- 1 root root 33473 Apr  4 20:26 monitor.py
-rw-r--r-- 1 root root   488 Apr  9 22:48 settings.yml
drwxr-xr-x 2 root root  4096 Apr  4 20:26 tools

pi@growpi:...$ sudo nano settings.yml

Disabled Channels 2 & 3 and saved the settings.yml file.

Note that I have left the auto_water setting to false. We can turn this on using the LCD menu.

channel1: {auto_water: false, dry_point: 27, enabled: true, pump_speed: 0.5, pump_time: 0.5,
  warn_level: 0.25, watering_delay: 60, wet_point: 3}
channel2: {auto_water: false, dry_point: 27, enabled: false, pump_speed: 0.5, pump_time: 0.5,
  warn_level: 0.5, watering_delay: 60, wet_point: 3}
channel3: {auto_water: false, dry_point: 27, enabled: false, pump_speed: 0.5, pump_time: 0.5,
  warn_level: 0.4, watering_delay: 60, wet_point: 3}
general: {alarm_enable: true, alarm_interval: 2}

Learned along the way: You can actually change all these settings using only the LCD and buttons. However I am not sure if this works when you are running the example software directly.

Update: When running the monitor.py example file it does indeed make changes to the ~/Pimoroni/growhat/examples/settings.yml file. If you run grow-python as a service then the settings are store at: /etc/default/grow

Water testing rig

In order to test the pumps I decided to use one of my 20 litre food safe buckets (for a future hydroponic project) and place the pump and tube inside while attaching the Raspberry Pi + Grow HAT on the outside of the bucket using a clothes peg.

Just like before I will simulate as if the soil moisture sensor is inside soil by just holding the sensor in my hand (like holding a fork between your thumb and index finger).

I did some initial config from the LCD menu and did manage to get the pump to push some water through the tube and back into the bucket. However I want to tweak the settings so that I can test the pump + Grow HAT combo and then test the other 2 pumps as well.

NOTE: Do not use these settings in your actual setup. I will be using settings for testing the pump + system in a controlled and monitored way.

pi@growpi:~ $ cd ~/Pimoroni/growhat/examples
pi@growpi:...$ sudo cp settings.yml settings.yml.bak
pi@growpi:...$ sudo nano settings.yml

channel1: {auto_water: true, dry_point: 27, enabled: true, pump_speed: 0.5, pump_time: 5.0,
  warn_level: 0.25, watering_delay: 7, wet_point: 3}

Water will be pumped for 5 seconds (pump_time) at half the power (pump_speed) whenever the soil moisture sensor indicates that it is to dry. After the 5 seconds the system will wait for about 2 seconds (watering_delay: 7 – pump_time: 5 = 2 seconds) and if the soil is still dry it will start pumping water again.

Brace for impact!

I am holding the moisture sensor in my one hand and the other one is typing on my laptop to start the Grow monitor.py program.

pi@growpi:...$ sudo python3 monitor.py

Channels:
Channel: 1
Enabled: True
Alarm level: 0.25
Auto water: True
Water level: 0.5
Pump speed: 0.5
Pump time: 5.0
Delay: 7
Wet point: 3
Dry point: 27
...

Ok it does pump water, but not very well. Time to bump up the power (pump_speed). I have set the speed to be the max = 1.0

Amazing it works!

Testing the remaining 2x pumps

Now that I have a working test rig I can move onto testing the other 2x pumps as well.

I am not going to test the system with all 3x pumps and sensors attached. For that I will wait until I have my pots and reservoir system setup and then take it in baby steps to dial in the required settings.

To be extra safe here, I powered down the Raspberry Pi and unplugged the power supply before removing the pump cable and pump from the system and the connect the pump under test to the system.

  • ✅ Pump 1 works
  • ✅ Pump 2 works
  • ✅ Pump 3 works

Notes for the future

Note to self: The settings used by the grow-python running as a service is located at /etc/default/grow


2 comments on “100 Days of Learning: Day 33 – Pumping water with the Pimoroni Grow HAT Mini

Comments are closed.