Note
Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
Why Join?
Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
Learn & Share: Exchange tips and tutorials to enhance your skills.
Exclusive Previews: Get early access to new product announcements and sneak peeks.
Special Discounts: Enjoy exclusive discounts on our newest products.
Festive Promotions and Giveaways: Take part in giveaways and holiday promotions.
👉 Ready to explore and create with us? Click [here] and join today!
Plant Monitor
This project automatically waters plants by activating a water pump when the soil humidity falls below a specific threshold. Additionally, it displays temperature, humidity, and soil moisture on an LCD screen, providing users with insights into the plant’s growth environment.
Required Components
In this project, we need the following components.
It’s definitely convenient to buy a whole kit, here’s the link:
Name |
ITEMS IN THIS KIT |
LINK |
---|---|---|
Elite Explorer Kit |
300+ |
You can also buy them separately from the links below.
COMPONENT INTRODUCTION |
PURCHASE LINK |
---|---|
- |
|
- |
|
- |
|
- |
Wiring
Note
To protect the Power Supply Module’s battery, please fully charge it before using it for the first time.

Schematic

Code
Note
You can open the file
08_plant_monitor.ino
under the path ofelite-explorer-kit-main\fun_project\08_plant_monitor
directly.Or copy this code into Arduino IDE.
Note
To install the library, use the Arduino Library Manager and search for “DHT sensor library” and “LiquidCrystal I2C” and install them.
How it works?
Here is a detailed explanation of the code:
Library Inclusions and Constants/Variables:
Import
Wire.h
,LiquidCrystal_I2C.h
, andDHT.h
libraries. Define pin numbers and other parameters related to DHT11, soil moisture sensor, and the water pump.setup()
:Initialize the pin modes related to the soil moisture sensor and the water pump. Turn off the water pump initially. Initialize the LCD display and turn on the backlight. Start the DHT sensor.
loop()
:Read humidity and temperature from the DHT sensor. Read soil moisture from the soil moisture sensor. Display temperature and humidity values on the LCD screen, then clear the screen and display the soil moisture value. Determine whether to activate the water pump based on soil moisture. If the soil moisture is below 500 (a configurable threshold), activate the water pump for 1 second.