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.
Connection Diagram
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
Design the 3D model of the housing and container holder on SolidWorks, and print it out.
Check if the ESP32 main controller, relay module, and DC-DC boost converter fit into the housing before installation.
Connect them together with cables according to the connection diagram.
Then, connect the valve, liquid level sensor, and soil moisture sensor to ESP32 according to the diagram.
Install the transparent acrylic cover.
Design a 550mm×250mm background board with holes for fixing hardware on AutoCAD.
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.
Fix the prepared holder for the container on the black board with screws.
Fix the electric valve on the board with nylon cable ties.
Attach the maincontroller box to the board with hot glue.
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.
Install the liquid level sensor outside the container. Then the device is ready to use.
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
Sign up Blynk account and log in, then create a new template (select ESP32 as hardware and WiFi as connection type).
Create a new device and choose "From template".
Select the template we just created.
Enter the device to see template ID, device name and AuthToken.
Edit the dashboard to configure the gauge of soil moisture.
Drag and drop Gauge to set up.
Create datastream and select virtual pin.
Set the Gauge TITLE, UNITS & MAX. For PIN, I select PIN V6 here (just keep it consistent with that in the program).
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
Change the content in the box to yours.
Function Test
Add water to the container through the top hole.
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)
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