I love plants so much but I’m also terrible at caring for them. I try really hard to figure out their needs but I just tend to mess up. There’s not a lot of natural light in my place so there’s only so many places I can put plants and even then I struggle. The main issue I seem to have is watering. I can’t tell if I’m doing too much or too little watering. So this is where the Raspberry Pi Pico comes in!
The Pico is a great board with a lot of excellent compact build options. For this project I’ll be making an automatic plant watering system with the help of the Pico to keep it running. For this project you will need: Raspberry Pi Pico, a water pump, a soil moisture sensor, an RBG LED, a breadboard, and a powerbank. I’m using Rahul Khanna’s project page as a guide.
To start we’ll need to set up the Raspberry Pi Pico by downloading the micropython firmware here. On the Pico press the BOOTSEL button and hold it while connecting to your computer via USB to put it into USB mass storage device mode. The drag and drop the downloaded .uf2 firmware. You can find more extensive details on setting up your Pico for programming in our Getting Started with Pico post.
The Pico is now ready for programming.
I suggest doing the build first just to make things a little easier, especially if you’re avoiding soldering your headers onto the Pico. If you do want to solder on the headers be sure to go slow and use a cone tip as the header holes are very small. Once you’ve made your header choice you can move on to the rest of the build.
As seen above, you’ll connect the 5V Water Pump to GPIO26, Soil Moisture Sensor to GPIO27 and the LED Pins to GPIO14, GPIO13 and GPIO12.
At this point you’re ready to upload the code on Thonny. Open up Thonny IDE and select the interpreter as MicroPython (Raspberry Pi Pico). I’m using Rahul Khanna’s code to start, however every plant is different and there’s a chance that during use it won't be the most ideal timing. You can edit the timing of waterings through Thonny to find what your plant needs most. Thonny will ask you to input the date and time down to the second in the Shell tab and once it is imputed it will begin automatically tracking the soil and update you frequently.
Now I’m going to set up this build by putting the soil sensor into the plant soil in the pot and I have the cup of water that the hose part of the water pump sits in so it has a steady supply. When the soil sensor notices that the plant's soil has gotten too dry it will automatically pump water from the water pump into the pot. Right now I’m getting power from my laptop but if you want your system to operate independently it would be ideal to get a power source for your pico.
Now you should have a lovely little plant watering system to be able to keep your strange leafy children alive even if you are bad at remembering that they need hydration! Hopefully this means that less of my plants will die and maybe it can do the same for you!