ESP32-Based Automated Environmental Monitoring and Control System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
The circuit in question appears to be a complex system designed to interface with various sensors and actuators through an ESP32 microcontroller. The system includes environmental sensing (light, temperature, humidity, soil moisture, and NPK levels), distance measurement, and control elements such as a stepper motor, water pump, solenoid valve, and a bulb. The ESP32 serves as the central processing unit, interfacing with sensors and controlling actuators based on sensor inputs. The circuit is powered by a 5V 5A power supply, and a 4-channel relay module is used to control high-power devices.
Component List
ESP32 (30 pin)
- A microcontroller with WiFi and Bluetooth capabilities, featuring a wide range of GPIO pins for interfacing with various sensors and actuators.
Module LDR (Light Dependent Resistor)
- A sensor module for detecting the intensity of light.
NPK Sensor
- A sensor used to measure the nitrogen, phosphorus, and potassium content in the soil.
SparkFun gator:soil
- A soil moisture sensor that measures the volumetric content of water in the soil.
Bulb
- An electric light source.
DHT22
- A sensor for measuring temperature and humidity.
HC-SR04 Ultrasonic Sensor
- A sensor for measuring distance via ultrasonic waves.
Stepper Motor One
- A type of electric motor that divides a full rotation into a number of equal steps, allowing for precise control of angular position.
Water Pump
- A device used to move water from one place to another.
Plastic Solenoid Valve
- An electrically-controlled valve used for controlling the flow of a liquid or gas.
Relay 4 Channel 5v
- A 4-channel relay module that allows for controlling high-power devices with low-power signals from the microcontroller.
POWER SUPPLY 5V 5AMP
- A power supply unit that provides 5V DC power with a current capacity of 5A.
Wiring Details
ESP32 (30 pin)
- VN connected to NPK Sensor VCC and Stepper Motor One +
- D33 connected to Stepper Motor One IN1
- D25 connected to SparkFun gator:soil SIG
- D26 connected to Stepper Motor One IN2
- D27 connected to Stepper Motor One IN3
- D14 connected to Stepper Motor One IN4
- D12 connected to HC-SR04 Ultrasonic Sensor TRIG
- D13 connected to HC-SR04 Ultrasonic Sensor ECHO
- GND connected to SparkFun gator:soil GND, Stepper Motor One -, Relay 4 Channel 5v GND, HC-SR04 Ultrasonic Sensor GND, NPK Sensor GND, Module LDR GND, DHT22 -
- Vin connected to SparkFun gator:soil VCC, DHT22 +, Relay 4 Channel 5v VCC, HC-SR04 Ultrasonic Sensor VCC
- D22 connected to NPK Sensor A
- TX0 connected to NPK Sensor B
- D21 connected to Relay 4 Channel 5v IN3
- D19 connected to Module LDR DO
- D5 connected to DHT22 Out
- D4 connected to Relay 4 Channel 5v IN2
- D2 connected to Relay 4 Channel 5v IN1
- 3V3 connected to Module LDR VCC
Module LDR
- DO connected to ESP32 D19
- GND connected to ESP32 GND
- VCC connected to ESP32 3V3
NPK Sensor
- VCC connected to ESP32 VN
- A connected to ESP32 D22
- B connected to ESP32 TX0
- GND connected to ESP32 GND
SparkFun gator:soil
- SIG connected to ESP32 D25
- GND connected to ESP32 GND
- VCC connected to ESP32 Vin
Bulb
- Power connected to Relay 4 Channel 5v NC3
- GND connected to POWER SUPPLY 5V 5AMP 220V Negative Pole (AC)
DHT22
-
- connected to ESP32 Vin
- Out connected to ESP32 D5
-
- connected to ESP32 GND
HC-SR04 Ultrasonic Sensor
- VCC connected to ESP32 Vin
- TRIG connected to ESP32 D12
- ECHO connected to ESP32 D13
- GND connected to ESP32 GND
Stepper Motor One
-
- connected to ESP32 VN
- IN1 connected to ESP32 D33
- IN2 connected to ESP32 D26
- IN3 connected to ESP32 D27
- IN4 connected to ESP32 D14
-
- connected to ESP32 GND
Water Pump
-
- connected to Relay 4 Channel 5v NC2
-
- connected to POWER SUPPLY 5V 5AMP GND (DC)
Plastic Solenoid Valve
- Pin1 connected to Relay 4 Channel 5v NC1
- Pin2 connected to POWER SUPPLY 5V 5AMP GND (DC)
Relay 4 Channel 5v
- GND connected to ESP32 GND
- IN1 connected to ESP32 D2
- IN2 connected to ESP32 D4
- IN3 connected to ESP32 D21
- VCC connected to ESP32 Vin
- COM1 and COM2 connected to POWER SUPPLY 5V 5AMP 12V-24V Output (DC)
- COM3 connected to POWER SUPPLY 5V 5AMP 220V Positive Pole (AC)
- NC1 connected to Plastic Solenoid Valve Pin1
- NC2 connected to Water Pump +
- NC3 connected to Bulb Power
POWER SUPPLY 5V 5AMP
- 220V Positive Pole (AC) connected to Relay 4 Channel 5v COM3
- 220V Negative Pole (AC) connected to Bulb GND
- GND (DC) connected to Water Pump - and Plastic Solenoid Valve Pin2
- 12V-24V Output (DC) connected to Relay 4 Channel 5v COM1 and COM2
Documented Code
No code was provided for the microcontroller(s) in the circuit. The documentation of the code would typically include descriptions of the functions, algorithms, and logic used to read sensor data, control actuators, and communicate with other devices or services. Since no code is available, this section cannot be completed. If code becomes available, it should be documented here with appropriate comments and explanations.