ESP32-Based Smart Ethernet Weather Station with DHT22 Sensor and Relay Control
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates an ESP32 microcontroller with a W5500 Ethernet module and a DHT22 temperature and humidity sensor. Additionally, it controls a 5V 2-Relay module. The ESP32 serves as the central processing unit, interfacing with the Ethernet module for network connectivity and the DHT22 sensor for environmental data. The relays allow the ESP32 to control external devices, such as motors or lights, based on sensor readings or network commands.
Component List
ESP32 (30 pin)
- Description: A microcontroller with Wi-Fi and Bluetooth capabilities.
- 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
Module Ethernet W5500
- Description: An Ethernet module that provides network connectivity.
- Pins: NC, INT, RST, GND, 5V, SCK, SS, MOSI, MISO, 3.3V
DHT22
- Description: A sensor for measuring temperature and humidity.
- Pins: +, Out, -
5v 2-Relay JD-VCC
- Description: A relay module for controlling high power devices.
- Pins: JD-VCC, VCC, GND, IN1, IN2, NO, COM, NC
Wiring Details
ESP32 (30 pin)
- EN connected to Module Ethernet W5500 RST
- D32 connected to DHT22 Out (also connected to D33)
- D25 connected to Module Ethernet W5500 INT
- D26 connected to 5v 2-Relay JD-VCC IN2
- D27 connected to 5v 2-Relay JD-VCC IN1
- GND connected to 5v 2-Relay JD-VCC GND and Module Ethernet W5500 GND (also connected to DHT22 -)
- Vin connected to 5v 2-Relay JD-VCC VCC
- D23 connected to Module Ethernet W5500 MOSI
- D19 connected to Module Ethernet W5500 MISO
- D18 connected to Module Ethernet W5500 SCK
- D5 connected to Module Ethernet W5500 SS
- 3V3 connected to Module Ethernet W5500 3.3V and DHT22 +
Module Ethernet W5500
- RST connected to ESP32 EN
- INT connected to ESP32 D25
- GND connected to ESP32 GND and DHT22 -
- 5V not connected
- SCK connected to ESP32 D18
- SS connected to ESP32 D5
- MOSI connected to ESP32 D23
- MISO connected to ESP32 D19
- 3.3V connected to ESP32 3V3
DHT22
-
- connected to ESP32 3V3
- Out connected to ESP32 D32 (also connected to D33)
-
- connected to ESP32 GND
5v 2-Relay JD-VCC
- JD-VCC not connected
- VCC connected to ESP32 Vin
- GND connected to ESP32 GND
- IN1 connected to ESP32 D27
- IN2 connected to ESP32 D26
- NO, COM, NC not connected
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:
}
Module Ethernet W5500 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 actual functionality of the microcontrollers should be implemented in the setup and loop functions. The provided code is a template and needs to be completed with specific instructions for interfacing with the Ethernet module, reading sensor data from the DHT22, and controlling the relay module based on the application requirements.