Circuit Documentation
Summary
This document provides a detailed overview of a circuit designed to interface an ESP32 microcontroller with various sensors and actuators. The circuit includes a DHT22 temperature and humidity sensor, a YL-69 soil moisture sensor, a 1-Channel Relay to control a Plastic Solenoid Valve, and a power supply module. The ESP32 serves as the central processing unit, reading sensor data and controlling the relay based on programmed logic.
Component List
DHT22 Temperature and Humidity Sensor
- Pins:
+,Out,- - Description: A sensor used to measure the ambient temperature and humidity.
Humidity YL-69 Soil Moisture Sensor
- Pins:
A0,D0,GND,VCC - Description: A sensor used to measure the moisture level in soil.
Terminal Block (4 Positions)
- Pins:
1,2,3,4,5,6,7,8 - Description: A connector used to organize and secure wiring.
1-Channel Relay (5V 10A)
- Pins:
NC,signal,C,power,NO,ground - Description: An electromechanical switch used to control high power devices.
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 for processing and controlling the circuit.
Plastic Solenoid Valve
- Pins:
pin1,pin2 - Description: An electrically-controlled valve used to control the flow of liquid.
Power Supply (220V)
- Pins:
hot wire,neutral wire - Description: A module that provides power to the circuit.
Wiring Details
DHT22 Temperature and Humidity Sensor
+connected to ESP323V3Outconnected to ESP32D2-connected to ESP32GND
Humidity YL-69 Soil Moisture Sensor
A0connected to ESP32D18D0connected to ESP32D19GNDconnected to Terminal Block7VCCconnected to Terminal Block3
Terminal Block (4 Positions)
1connected to Relaypower2,4connected to ESP32Vin5connected to Relayground6,8connected to ESP32GND3connected to YL-69VCC7connected to YL-69GND
1-Channel Relay (5V 10A)
NCnot connectedsignalconnected to ESP32D14Cconnected to Solenoid Valvepin1powerconnected to Terminal Block1NOconnected to Power Supplyneutral wiregroundconnected to Terminal Block5
Plastic Solenoid Valve
pin1connected to RelayCpin2connected to Power Supplyhot wire
Power Supply (220V)
hot wireconnected to Solenoid Valvepin2neutral wireconnected to RelayNO
Documented Code
ESP32 Microcontroller Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Note: The code provided is a template and does not contain any functional logic. It needs to be populated with the necessary instructions to read sensor data, process it, and control the relay accordingly.
