ESP32-Based Smart Irrigation and Environmental Monitoring System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
The circuit in question appears to be a sensor-based system designed to monitor environmental conditions such as soil moisture, rain detection, light levels, and temperature/humidity. It also includes a relay-controlled water pump, which suggests that this system could be used for automated plant watering or environmental monitoring. The ESP32 microcontroller serves as the central processing unit, interfacing with various sensors and controlling the relay module to manage the water pump. Communication with an NPK soil sensor is facilitated through an RS485 transceiver, indicating that the system may be part of a larger network or require long-distance communication capabilities.
Component List
Soil Moisture Sensor
- Pins: VCC, GND, SIG
- Description: Measures the moisture level in the soil.
RAIN SENSOR
- Pins: AO, DO, GRD, VCC
- Description: Detects the presence of rainwater.
ESP32 (30 pin)
- Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3
- Description: A microcontroller with Wi-Fi and Bluetooth capabilities, used as the main controller.
DHT11
- Pins: DATA, GND, VCC
- Description: Measures ambient temperature and humidity.
16x2 I2C LCD
- Pins: GND, VCC, SDA, SCL
- Description: Displays information such as sensor readings and system status.
Relay module 5v-30v
- Pins: common contact, normally open, normally closed, trigger, V-, V+
- Description: Controls the power to the water pump.
Light Sensor
- Pins: GND, UCC, NC, SIG
- Description: Measures the intensity of ambient light.
Water Pump
- Pins: +, -
- Description: Pumps water when activated by the relay.
12v power supply
- Pins: +, -
- Description: Provides power to the water pump.
NPK Soil Sensor (mini)
- Pins: VCC, GND, A, B
- Description: Measures the levels of Nitrogen, Phosphorus, and Potassium in the soil.
RS485
- Pins: VCC, RO, RE, GND, B, A, DE, DI
- Description: A transceiver for RS485 communication, used to interface with the NPK soil sensor.
Wiring Details
Soil Moisture Sensor
- VCC: Connected to the power supply.
- GND: Connected to the ground.
- SIG: Connected to ESP32 pin D13.
RAIN SENSOR
- VCC: Connected to the power supply.
- GRD: Connected to the ground.
- AO: Connected to ESP32 pin D32.
ESP32 (30 pin)
- Vin: Connected to the power supply.
- GND: Connected to the ground.
- D13: Connected to Soil Moisture Sensor SIG.
- D32: Connected to RAIN SENSOR AO.
- D26: Connected to Light Sensor SIG.
- D27: Connected to RS485 RO.
- D14: Connected to RS485 DI.
- D22: Connected to 16x2 I2C LCD SCL.
- D21: Connected to 16x2 I2C LCD SDA.
- D4: Connected to DHT11 DATA.
- D2: Connected to Relay module trigger.
- 3V3: Connected to the power supply for 3.3V components.
DHT11
- DATA: Connected to ESP32 pin D4.
- GND: Connected to the ground.
- VCC: Connected to the power supply.
16x2 I2C LCD
- GND: Connected to the ground.
- VCC: Connected to the power supply.
- SDA: Connected to ESP32 pin D21.
- SCL: Connected to ESP32 pin D22.
Relay module 5v-30v
- trigger: Connected to ESP32 pin D2.
- V-: Connected to the ground.
- V+: Connected to the power supply.
- common contact: Connected to 12v power supply +.
- normally open: Connected to Water Pump +.
Light Sensor
- GND: Connected to the ground.
- UCC: Connected to the power supply.
- SIG: Connected to ESP32 pin D26.
Water Pump
- +: Connected to Relay module normally open.
- -: Connected to 12v power supply -.
12v power supply
- +: Connected to Relay module common contact.
- -: Connected to Water Pump -.
NPK Soil Sensor (mini)
- VCC: Connected to the power supply.
- GND: Connected to the ground.
- A: Connected to RS485 A.
- B: Connected to RS485 B.
RS485
- VCC: Connected to the power supply.
- GND: Connected to the ground.
- RO: Connected to ESP32 pin D27.
- DI: Connected to ESP32 pin D14.
- A: Connected to NPK Soil Sensor A.
- B: Connected to NPK Soil Sensor B.
Documented Code
No code was provided for the microcontroller(s) in the circuit. For a complete documentation, the embedded code that runs on the ESP32 microcontroller should be included. This code would typically initialize the sensors, read their values, control the relay module based on sensor inputs, and handle communication with the NPK soil sensor via the RS485 transceiver. It would also manage the display output on the 16x2 I2C LCD.