SunFounder ESP32 Starter Kit
Code
Note:
• You can open the file 6.6_plant_monitor.ino under the path of esp32-starter-kit-main\c\codes\6.
6_plant_monitor.
• After selecting the board (ESP32 Dev Module) and the appropriate port, click the Upload button.
• Always displaying “Unknown COMxx”?
• The LiquidCrystal_I2C and DHT sensor library libraries are used here, you can install them from the
Library Manager.
• After uploading the code, the I2C LCD1602 alternately displays temperature and humidity, as well as soil mois-
ture and light intensity analog values, with a 2-second interval.
• The water pump is controlled using a button press. To water the plants, hold down the button, and release it to
stop watering.
Note: If the code and wiring are correct, but the LCD still fails to display any content, you can adjust the potentiometer
on the back to increase the contrast.
1.36. 6.6 Plant Monitor 127