Introduction
Let’s be real for a second—we’ve all killed a houseplant. You buy a beautiful fern, swear you’re going to take great care of it, and then you leave for a weekend trip. You come back, and it looks like crispy autumn leaves.
I got tired of the plant guilt, so I decided to over-engineer a solution. Meet The Thirsty Pi.
This isn't just a simple water pump on a timer. I built a fully autonomous, Wi-Fi-enabled smart garden hub powered by the Raspberry Pi Pico W. It actively monitors soil moisture, calculates the room's "Real Feel" temperature, and waters the plant exactly when it needs it. Oh, and it hosts its own web dashboard so you can manually trigger the pump from your couch.
I even designed a custom 3D-printed enclosure so it looks like a sleek, professional smart-home device rather than a messy science experiment. Let’s build it!
⚠️ Quick warning: Take it from me, never try to power a motor directly from your Pico’s pins. Motors are power-hungry and noisy, and they will absolutely fry your microcontroller. We are going to use the L293D Motor Driver as a heavy-duty bouncer to keep the power separate.
- The Brain (Logic): Connect the L293D's logic power (VCC1 or 5V) to the Pico's VBUS pin. Connect the control pins: ENA to Pico GP10, IN1 (or 1A) to GP8, and IN2 (or 1B) to GP9.
- The Muscle (Power): Connect the L293D's motor power (VCC2 or VMOTOR) directly to the positive wire of your 6V Battery Pack. Connect your water pump to the OUT1 and OUT2 (or 1Y and 2Y) pins.
- The Golden Rule: You must connect the Pico's GND, the Battery Pack's GND, and the L293D's GND all together. If they don't share a common ground, your signals won't make sense to the chip.
Next, we need to wire up the environmental sensors so the Pico actually knows what's going on in the dirt.
- DHT11 (Temp/Hum): Connect VCC to Pico 3V3, GND to GND, and the Data pin to Pico GP14.
- Soil Moisture Sensor: Connect VCC to Pico 3V3, GND to GND, and the Analog Output (A0) to Pico GP27 (ADC1).
- (Optional) System Voltage: If you want to track battery voltage, I set up a quick voltage sensor module into Pico GP28 (ADC2).
Electronics and wet dirt are natural enemies. I initially thought about throwing this all in a plastic food container, but I wanted something that looked genuinely good sitting on my shelf.
I jumped into CAD - Fusion 360 and designed a custom enclosure specifically for this project. It has proper standoffs for the boards, cable routing holes for the sensor wires, and a snug fit to keep accidental water splashes away from the brains of the operation.
- The Drip Loop: When you route your wires out of the 3D-printed case, make sure the wires dip down into a "U" shape before going up to the plant. Water loves to travel down wires. If it drips, it will fall off the bottom of the "U" loop instead of sliding straight into your beautiful new case!
(I have attached the.f3z fusion360,step and stl files below so you can print your own!)
https://github.com/jeevan8232/TheThirstyPi.git
I wrote the logic in MicroPython. The biggest challenge here was the web server. Usually, if you tell a Pico to "turn on a pump and sleep for 3 seconds, " it completely freezes. If you try to load the web dashboard during those 3 seconds, it crashes.
To fix this, I wrote a "non-blocking" state machine. The Pico acts like it's setting an alarm clock. It turns the pump on, sets a 3-second alarm, and immediately goes back to serving the website and logging data. When the alarm goes off, it stops the pump. The result? A lightning-fast, crash-proof dashboard.
- Open Thonny and create a new file on your Pico W called main.py.
- Copy and paste the code below.
- Change the <WIFI_SSID> and <WIFI_PASSWORD> at the top of the script to match your home Wi-Fi.
- Save it to the Pico and hit Run! The console will print out the IP address you need.
Source code: https://github.com/jeevan8232/TheThirstyPi.git
Open your phone's web browser and type in that IP address. Welcome to your new control center!
From the dashboard, you can:
- View real-time moisture, temperature, and humidity metrics.
- Manual Override: Use the big blue WATER button or the red STOP button like a TV remote.
- Download Logs: Click this to download a.csv file of your plant's environment history straight to your device.
- Timer Mode (Cactus Mode): In the settings box at the bottom, you can change how often it waters. More importantly, you can toggle between Smart Mode (checking the soil) and Timer Mode. Timer mode acts like a blind sprinkler and ignores the soil sensor—which is an absolute lifesaver for succulents and cacti that need to stay dry most of the week.
Mount your water tubes, fill up a reservoir (a large mason jar works great), and plug the Pico into a standard USB wall charger. The script will boot up automatically as soon as it gets power.
You just built a commercial-grade smart irrigation controller from scratch. Go ahead and book that weekend trip— your plants are officially in good hands.
Don't forget to like this project, share it with a fellow plant parent, and drop a comment below. Happy making!









_t9PF3orMPd.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)











_3u05Tpwasz.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)

Comments