Automatic Watering System Using Pico:ed V2

by TecnoProfesor in Teachers > 12

31628 Views, 418 Favorites, 0 Comments

Automatic Watering System Using Pico:ed V2

20221023_145324.jpg
20221022_163749.jpg

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.

Supplies

20221010_141917.jpg
  • 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

How It Works

Automatic Watering System

This video shows how it works the indoor version.

How to Begin to Program the Pico:ed V2 Board

Captura1.PNG
Captura1.PNG
Captura1.PNG

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:

  1. Download the firmware of the Pico:ed V2.
  2. 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
  3. 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)”.

Code.py

Captura de pantalla de 2022-10-16 13-02-04.png

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

Setting Up the Water Level Sensor

Automatic Watering System (setting up the water level sensor)

Setting Up the Soil Moisture Sensor

Automatic Watering System (setting up the soil moisture sensor)

Fix the Relay and the IOBit

20221012_153313.jpg
20221012_153754.jpg

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.

Fix the Water Level Sensor

20221012_204603.jpg
20221013_191230.jpg

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

Fix the Funnel

20221013_190204.jpg

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

Fix the Water Pump

20221013_171528.jpg
20221013_192540.jpg

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

Closing the Plastic Box

20221013_193416.jpg
20221015_223858.jpg
20221013_193706.jpg

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

Connecting the Relay

20221016_140648.jpg

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

Fritzing Circuit Diagram

Test_moisture_sensor_bb.jpg

The Solar Version (Outdoor Solution)

20221023_145316 (1).jpg
20221023_143552.jpg
20220926_161913.jpg
20221023_141916.jpg

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.