Build Your Own Automatic Irrigation System With Raspberry Pi Pico & Custom Capacitive Soil Moisture Sensor
by carlotts in Circuits > Microcontrollers
132 Views, 2 Favorites, 0 Comments
Build Your Own Automatic Irrigation System With Raspberry Pi Pico & Custom Capacitive Soil Moisture Sensor
In this project, I'll walk you through the complete build of an automatic irrigation system powered by a Raspberry Pi Pico DevKit (RP2040) — from the electronics to the firmware. But what makes this project stand out is that we won't stop at just the controller: we'll also design and build a custom capacitive soil moisture sensor from scratch, properly engineered for reliable and accurate readings.
Whether you're tired of over-watering your plants or just love a good electronics challenge, this build gives you full control over your garden's hydration — no cloud subscriptions, no proprietary hardware, just open, hands-on engineering.
Supplies
Electronics
- 1x Raspberry Pi Pico DevKit (RP2040)
- 1x 12V Peristaltic Pump
- 1x 12V Relay Module
- 1x TIP122TU NPN Darlington Transistor
- 1x LM2596 Step-Down Voltage Regulator Module
- 3x 1N4007 Rectifier Diodes (or equivalent conventional diodes)
- 1x 1KΩ Resistor
- 2x 10KΩ Resistors
- 1x 1MΩ Resistor
- 1x 10nF Ceramic Capacitor
- 1x 1µF Capacitor
Structure & Housing
- 6mm MDF sheet (laser cut using the provided file Apoio_Agua.DXF)
- 3D printed water reservoir (print using the provided file Reservatório.STL)
Tools & Equipment
- Laser cutting machine
- 3D printer
- Soldering iron and solder
- Multimeter (recommended for testing)
- Jumper wires and/or PCB for assembly
Build the Capacitive Soil Moisture Sensor
The first step is to build the capacitive soil moisture sensor. This sensor relies on wide, exposed copper traces on the PCB to generate capacitance relative to the surrounding soil. Combined with a PWM signal sent by the microcontroller, it can accurately detect moisture levels without the corrosion issues common in resistive sensors.
💡 If you prefer, you can replace this with a conventional off-the-shelf capacitive sensor — just update the corresponding values in the code.
Useful references:
- 📖 How capacitive soil moisture sensors work: Last Minute Engineers Guide
- 💻 Raspberry Pi Pico (RP2040) source code: GitHub — Pico Plant
Assemble the Irrigation Electronics
Once your sensor is ready (built or purchased), the next step is assembling the irrigation controller circuit. This can be done either on a custom PCB or through conventional point-to-point wiring, depending on your preference and available tools.
📁 If you'd like to manufacture PCBs for both the sensor and the controller, the Gerber fabrication files for both boards are available in the GitHub repository.
Fabricate the Structure & Water Reservoir
With the electronics complete, it's time to bring the physical structure together:
- 3D print the water reservoir using the provided Reservatório.STL file.
- Laser cut the 6mm MDF panels and assemble the automatic irrigation system structure using the provided Apoio_Agua.DXF file.