Skip to content

An automatic plant watering system based on an ESP32 with solar cell, soil moisture sensor and pump.

Notifications You must be signed in to change notification settings

Lumics/Plantwatery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plantwatery

A project of Anna Dai and Maurin Widmer.

Summary

Plantwatery is an automated watering system for your garden plants. It is based on an ESP32, a capacitive soil moisture sensor, solar cell & battery and a water pump. The system is autonomous and measures twice per day the soil moisture and operates the pump if needed. It's collected data and status is send via Wifi (MQTT protocol) to the cloud. All parts can easily be bought and the case is 3D printed (drawings are provided). The plastic housing is constructed to protect it's inner electronic parts from water and makes it easy to attach the solar panel, water pump and soil sensor.

The code is written with the Arduino framework and can easily be adapted to other platforms. It allows to change watering time & hours of the day, soil sensor offset and MQTT topics. Furthermore, the code automatically checks if a new version is online and updates itself if there is (for example because you want to change some parameters like soil sensor offset or watering time).

Changelog

Version 12

Updated Version June 2024

  • Adding a TPS61023 from Adafruit for a stable boost from 3.7V to 5V. This helps to make the usage of the ESP32 much more reliable if the voltage dropped
  • Bug fixes to improve deep sleep cycle
  • Improved battery monitor output
  • Improved Hum reading and new wiring to ESP32 directly for power to decrease power flowing through sensor over time

Version 9

Updated Version from 31.12.2022 includes:

  • a LDO and capacitors in the electronics. Furthermore the standard ESP32 is used to further save battery power (no LED). Sketch is updated accordingly.
  • Updated code with more reliable computing of how many seconds are needed until ESP32 needs to wake up to water the plants.

Version 8

Inital Version

Hardware

In the following you have a list of suggestions of parts you need to build this project.

Control unit:

Solar part:

  • Solar cell 5V, 200mA
  • 3D printed housing
  • Some hot glue to make it waterproof
  • Wooden stick to mount the housing

Soil measuring part:

Water part:

  • Water pump, around 5V but they also work with 3.7V: Mini Brushless Water Pump 5V, 2.4W
  • Tubes, I got the 6mm (outside) as they fit perfectly inside of the pump fixture: Tubes
  • Connectors for the tubes (6mm): Pipe connector
  • Stopper for the end of the tubes: Stopper connector
  • Large bucket
  • Maybe some wooden sticks and some wire to hold the tubes in place

(Picture above showing Plantwatery version 8)

(Picture above showing Plantwatery version 9, see changelog)

Electronics / Sketch

Here you can find a sketch of the wiring for the electronic components. It should be straight forward. I recommend to use some screw terminals to attach the longer wires of the external humidity sensor, pump and solar cell (compare image). Moreover, make sure to add the low voltage regulator as shown in the sketch. This makes sure that the esp32 works at 3.3V. Additionaly, the added capacitors help to smoothen out the supply voltage from potential voltage spikes.

The drawings for the casing for all parts can be found in the folder: housing.

Watering system

The tubes were connected to the pump and then placed between the plants. We used a Y connector to go to all plants and always have a small tube which has some self made small holes at the spots where it should water the plants. Therefore, we only have to change the tubes with the holes, if we rearrange the plants or want suddenly smaller holes.

Code

To code is written for the Arduino framework with the PlatformIo IDE. Please make sure to add a file called: "config.h" to the src folder (copy and rename the config_example.h and fill in the details). If you do not have a OTA server you can just leave the URL like it is or remove everything with OTA from the code.

Make sure to change the hum_threshold, hum_offset and the watering times according to your needs.

Have fun with the project and let us know if you have a question or if you build this.

ToDo

Further power improvement suggestion to investigate incase the kit uses too much power to recharge via solar cell

  • Either switch the ESP32 devkit board with a board without the CP2102, regulator and power LED
  • Scrap the power LED to get approx another 2mA power saving
  • Increase amount of solar cell and put them in series
  • Add an Resistor to the TP4056 as shown in the video of Andreas Spiess
  • Try to use a different board lige TTGO T18 with many components integrated

Releases

No releases published

Packages

No packages published