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.