ESP32-Based Multi-Sensor Monitoring System with I2C LCD Display
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
The circuit is designed around the ESP32 Expansion Board, which serves as the central microcontroller unit. It interfaces with various sensors and modules to perform a range of functions. The circuit includes a power source, an LCD display for output, environmental sensors (rain, soil moisture, temperature and humidity), an ultrasonic distance sensor, a passive buzzer for audio feedback, a key switch module for user input, and an LED for visual indication. The circuit is powered by a 5V battery and uses I2C communication for the LCD display.
Component List
ESP32 - Expansion Board
- Microcontroller board with WiFi and Bluetooth capabilities.
- Provides GPIO pins for interfacing with sensors and peripherals.
5V Battery
- Power source for the circuit.
- Provides a stable 5V supply to the components.
LCD Display 16x4 I2C
- Alphanumeric liquid crystal display with 16 characters per line and 4 lines.
- Uses I2C communication for displaying data.
SparkFun gator:soil
- Soil moisture sensor that provides an analog output signal indicating moisture levels.
HC-SR04 Ultrasonic Sensor
- Distance measuring sensor that uses ultrasonic waves.
- Consists of a transmitter (TRIG) and a receiver (ECHO).
LED: Two Pin (red)
- A simple red LED with an anode and cathode for visual indication.
KY-015 DHT11
- Temperature and humidity sensor module.
- Provides digital signal output.
Elegoo Passive Buzzer
- An electromechanical component that can be used to make a tone when an input signal is provided.
RAIN SENSOR
- Detects rain by measuring the resistance between two conductive tracks.
- Provides both analog (AO) and digital (DO) outputs.
KY-004 Key Switch Module
- A push-button switch that provides a digital signal when pressed.
Wiring Details
ESP32 - Expansion Board
D32connected to RAIN SENSOR (DO)D33connected to KY-004 Key Switch Module (S)D27connected to Elegoo Passive Buzzer (OUTPUT)D23connected to SparkFun gator:soil (SIG)D22connected to LCD Display 16x4 I2C (SCL)D21connected to LCD Display 16x4 I2C (SDA)D19connected to HC-SR04 Ultrasonic Sensor (TRIG)D18connected to HC-SR04 Ultrasonic Sensor (ECHO)D5connected to LED: Two Pin (red) (anode)D4connected to KY-015 DHT11 (5V)Gconnected to common ground netVCCconnected to common power net (5V)
5V Battery
+connected to common power net (5V)-connected to common ground net
LCD Display 16x4 I2C
SCLconnected to ESP32 (D22)SDAconnected to ESP32 (D21)VCCconnected to common power net (5V)GNDconnected to common ground net
SparkFun gator:soil
VCCconnected to common power net (5V)GNDconnected to common ground netSIGconnected to ESP32 (D23)
HC-SR04 Ultrasonic Sensor
VCCconnected to common power net (5V)TRIGconnected to ESP32 (D19)ECHOconnected to ESP32 (D18)GNDconnected to common ground net
LED: Two Pin (red)
anodeconnected to ESP32 (D5)cathodeconnected to common ground net
KY-015 DHT11
5Vconnected to ESP32 (D4)Sconnected to common power net (5V)GNDconnected to common ground net
Elegoo Passive Buzzer
VCCconnected to common power net (5V)GNDconnected to common ground netOUTPUTconnected to ESP32 (D27)
RAIN SENSOR
AOnot connected in this configurationDOconnected to ESP32 (D32)GRDconnected to common ground netVCCconnected to common power net (5V)
KY-004 Key Switch Module
Sconnected to ESP32 (D33)+connected to common power net (5V)-connected to common ground net
Documented Code
No code has been provided for the microcontroller. To fully utilize the circuit's capabilities, embedded code should be written to handle input from the sensors, control the output devices, and manage communication with the LCD display. The code should be structured to initialize the peripherals, read sensor data, process the inputs, and provide appropriate outputs to the LCD, LED, and buzzer based on the sensor readings and user input from the key switch module.