Saving Plants - DIY Plant Watering Device

by Jaychouu in Circuits > Sensors

28130 Views, 208 Favorites, 0 Comments

Saving Plants - DIY Plant Watering Device

How the Capacitive Liquid Level Sensor Works
QQ图片20221207101339.png
QQ图片20221207101517.png
QQ图片20221208100624.png

Story

Most of us like having green plants in our homes or offices because they can brighten up our living space, reduce fatigue and stress, improve our moods and productivity, and clean indoor air. However, taking care of them is no easy feat. I grew a potted plant but it ended up with yellow and dead leaves due to water shortage. To avoid following the same old disastrous road, I decided to make an auto plant watering device to save my new plants.


Thoughts

The device mainly includes a water storage container, an electric valve to control water flow, a soil humidity sensor to determine whether the valve will open to water plants, and a liquid level sensor installed outside the container to detect if the liquid level falls under the threshold, which means the container is nearly empty. And I only need to refill it when I receive the water shortage prompt.

Supplies

QQ图片20221207172058.jpg


1 × ESP32-E IoT Microcontroller

1 × Non-contact Capacitive Liquid Level Sensor

1 × Gravity: Analog Waterproof Soil Moisture Sensor

1 × Adjustable DC-DC Boost Converter

1 × Relay Module

1 × Solenoid Valve

1 × 3D Housing

1 × Acrylic Sheet

1 × Water Container

1 × Irrigation Nozzle

Nylon Cable Ties

Connection Diagram

电路图英svg.png

Connect the liquid level sensor to the main controller's D7/D9 with an adapter.

The soil moisture sensor goes to the controller's A0 and the relay module to the controller's D12.

Assembly

QQ图片20221207110333.png
QQ图片20221208092559.png
QQ图片20221207172321.jpg
QQ图片20221207172604.jpg
QQ图片20221207172102.jpg
bc361248-5356-4e6c-b0bf-22f9af2cfc8c.jpg
e83bd2c8-0210-4d8b-9580-e1b78789725e.jpg
QQ图片20221207110341.png
QQ图片20221207172234.jpg
QQ图片20221207172053.jpg
10b52067-68e1-49c7-ad81-14dfc34e792a.jpg
fd0ade76-471c-40e3-8fa4-59dcdcc00551.jpg
QQ图片20221207172030.jpg
QQ图片20221207172034.jpg
QQ图片20221208092208.png

1.Design the 3D model of the housing and container holder on SolidWorks, and print it out. 

2.Check if the ESP32 main controller, relay module, and DC-DC boost converter fit into the housing before installation.

3.Connect them together with cables according to the connection diagram.  

4.Then, connect the valve, liquid level sensor, and soil moisture sensor to ESP32 according to the diagram.

5.Install the transparent acrylic cover.

6.Design a 550mm×250mm background board with holes for fixing hardware on AutoCAD.

7.Laser cut the board with a black acrylic sheet of 8mm thickness according to the drawing. A wooden board of the same size is also suitable for the project.

8.Fix the prepared holder for the container on the black board with screws.

9.Fix the electric valve on the board with nylon cable ties.

10.Attach the maincontroller box to the board with hot glue.

11.Attach the water container to the holder and drill a hole in its bottom for adding water and equalizing air pressure. Then fix it on the board with nylon cable ties.

12.Install the liquid level sensor outside the container. Then the device is ready to use.

13.Fix the whole device on the wall, put the irrigation nozzles around plants evenly, and insert the soil moisture sensor into the soil. Then, all done with the hardware assembly. 

Connect the Device to Blynk

QQ图片20221205145909.png
QQ图片20221205145922.png
QQ图片20221205145926.png
QQ图片20221205145929.png
QQ图片20221205153725.png
QQ图片20221205153728.png
QQ图片20221205153731.png
QQ图片20221205153734.png
QQ图片20221205153737.png

1.Sign up Blynk account and log in, then create a new template (select ESP32 as hardware and WiFi as connection type).

2.Create a new device and choose "From template".

3.Select the template we just created.

4.Enter the device to see template ID, device name and AuthToken.

5.Edit the dashboard to configure the gauge of soil moisture.

6.Drag and drop Gauge to set up.

7.Create datastream and select virtual pin.

8.Set the Gauge TITLE, UNITS & MAX. For PIN, I select PIN V6 here (just keep it consistent with that in the program).

9.Now the setting of the gauge of soil moisture is done. Repeat the steps above to complete the settings of the other two.

Upload Codes

QQ图片20221208102225.png

Change the content in the box to yours.

Function Test

ywcgq3.gif
11b58ef8-16e5-4e35-9106-5bdf88a35a54.gif
a4fb78e8-5dcc-4ced-a961-d963aa3edd5c.gif

1.Add water to the container through the top hole.

2.When the soil humidity is lower than the threshold, the valve opens to water our plants through drip irrigation(Here for the convenience of demonstration, I switch on/off the gauge to open/close the valve).

3.When the liquid level falls under the sensing point, a water shortage prompt will appear on Blynk.

The plant-watering device has been used for some time and it really helps a lot. Now I can stop worrying that my plants will die from water shortage or drowning. 

Thanks for reading, feel free to leave your opinion about this project.

Codes: https://github.com/DFRobot/SmartWateringDevice