Introduction: Automatic Watering System Using Pico:ed V2
This time I present you an useful and affordable project very easy to build by our kids.
It is an automatic watering system controlled by a Pico:ed V2 board.
How it works: when the soil moisture sensor detects the soil is not moist enough (sad image), send a signal to a water pump to begin to water the plant (cry image). It only will happen if the water level sensor installed detects there is enough water in the plastic bowl to prevent the water pump damage. If the soil is moist enough, the board shows a smile image. By the other hand, if we keep pushing the button A, we can set up the number of seconds the water pump is watering the plant, from 1 to 10 seconds, and if we push the button B, the water pump will begin to watering the plant the number of seconds configured without taking into account the soil moisture.
I have built an indoor solution connected to whatever 5V mobile charger and an outdoor solution with solar panels.
With the Pico:ed V2 board we can introduce our kids the Python programming and to teach them this programming language so used in our days.
I hope you like it.
- Pico:ed V2 board
- IOBit V2 expansion board
- Plastic Bowl
- Little funnel
- 5V Water pump
- 5V Relay
- Water level sensor
- Soil moisture sensor
- Plastic tube
- 18650 Battery
- 18650 Battery Shield
- Four 1.5 V 400 mA solar panel
- Electric Cables
- M4 nuts, screw (20 milimeters) and washers
- M3 nuts, screw (20 milimeters) and washers
Step 1: How It Works
This video shows how it works the indoor version.
Step 2: How to Begin to Program the Pico:ed V2 Board
After connecting the board to the computer, you have to see a CIRCUITPY disk as you can see in the image.
If you can´t, you have to do the following:
- Download the firmware of the Pico:ed V2.
- Long pressing the BOOTSEL button and connect with the USB cable, release the button until you see a disk named RPI-RP2 on the computer
- Send the downloaded firmware to that disk.
Pico:ed will reconnect automatically after getting the firmware downloaded, then you will see a CIRCUITPY disk.
It is recommended to use the integrated development environment Thonny, which you can install by choosing the appropriate version for your computer system from here.
Once you have installed Thonny, you have to choose “Tools/Options/Interpreter” and click “CircuitPython(generic)”.
Step 3: Code.py
The code for this project is very simple.
It has been codified in Python using the Thonny editor as you can see in the image. In the image you can see the file "code.py" that you can find in the disk "CIRCUITPY" when you plugged the board to the computer.
One of the advantage to codify in Pytthon is that it is a interpreted programming language, so whatever you change in your code, you will see the results immediately in the board without generating a file to download it.
You can download the whole "code.py" from here
Step 4: Setting Up the Water Level Sensor
Step 5: Setting Up the Soil Moisture Sensor
Step 6: Fix the Relay and the IOBit
Mark and open several holes in the plastic bowl to fix the devices using the nuts, the screws and the washers as you can see in the images.
Step 7: Fix the Water Level Sensor
Cut the plastic bowl to insert the the water level sensor as you can see in the image.
After that, you have to apply hot silicone to prevent the water from leaking out and connect the cables: the 5V cable (red one), the ground cable (black one) and the signal (orange one) to the #1 pin in the IOBit
Step 8: Fix the Funnel
Open a hole in the top of the plastic bowl to fix a little funnel to fill it with water.
Open a new hole near the previous one to pass through it the plastic tube and the cables for the soil moisture sensor
Step 9: Fix the Water Pump
Open a hole in the plastic bowl near the microcontroller, fix the water pump using hot silicone and pass through the hole the cables as you can see in the image: the 5V cable (red one) to the NO (Normally Open) pin of the rele and the ground cable (black one) to one ground pin in the IOBit
Step 10: Closing the Plastic Box
Before you close the plastic bowl, you have to do the following:
- Connect the plastic tube to the water pump
- Use hot silicone to close properly a hole opened to pass trough it the cables needed to connect the water pump and the soil moisture sensor
- Pass trough the top hole the plastic tube and the three cables needed by the soil moisture sensor to work
- Pass trough the hole near the microcontroller the cables above and connect it to the Pico:ed: the 5V cable (orange one in the image) to a 5v pin in the board, the ground (gray one) to a ground in the board and the signal one (yellow) to the #2 pin in the board
- Apply hot silicone to prevent the water from leaking out from the hole near the microcontroller
Step 11: Connecting the Relay
You have to connect in the the relay 5 pins:
- Upper side (red cable) from the 5V pin of the water pump
- Upper side (orange cable) from a 5V pin in the IOBit
- Lower side (gray cable) from a ground pin in the IOBit
- Lower side (red cable) from a 5V pin in the IOBit
- Lower side (white cable) from #3 pin in the IOBit
Step 12: Fritzing Circuit Diagram
Step 13: The Solar Version (Outdoor Solution)
The outdoor solution include a 18650 battery and 18650 battery shield to supply the project.
Moreover, the 18650 battery is charged by four 1.5 V 400 mA solar panels connected in serial way.