ESP32 and MCP23017-Based Smart Relay Control System with DHT22 Sensors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes various components such as a DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module, multiple relay modules, DHT22 sensors, an ESP32-POE-ISO microcontroller, and a power supply. The circuit is designed to interface with multiple relays and sensors, controlled via I2C and GPIO connections.
Component List
DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module
- Description: I2C-based 16-channel digital I/O expander.
- Pins: SDA, SCL, GND, 5V/VCC, RST, IA (Interrupt Detection Pin) A, IB (Interrupt Detection Pin) B, 0 (PA0), 1 (PA1), 2 (PA2), 3 (PA3), 4 (PA4), 5 (PA5), 6 (PA6), 7 (PA7), 8 (PB0), 9 (PB1), 10 (PB2), 11 (PB3), 12 (PB4), 13 (PB5), 14 (PB6), 15 (PB7)
Relay 4 Channel 5v
- Description: 4-channel relay module for switching high-power devices.
- Pins: GND, IN1, IN2, IN3, IN4, VCC, COM1, COM2, COM3, COM4, NO1, NO2, NO3, NO4, NC1, NC2, NC3, NC4
DHT22
- Description: Digital temperature and humidity sensor.
- Pins: +, Out, -
4 Channel 30a 5V Relay
- Description: High-power 4-channel relay module.
- Pins: 5V, GND, IN1+, IN1-, IN2+, IN2-, IN3+, IN3-, IN4+, IN4-
ESP32-POE-ISO
- Description: ESP32 microcontroller with Power over Ethernet (PoE) and isolation.
- Pins: GPI39 (VN), GPI36 (VP), GPI35, GPI34, GPIO33, GPIO32, GPIO16, GPIO15, GPIO14, GPIO13, 5v, 3.3v, GND, EN, GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5
POWER SUPPLY 5V 5AMP
- Description: Power supply providing 5V at 5A.
- Pins: 220V Positive Pole (AC), 220V Negative Pole (AC), GND, GND (DC), 12V-24V Output (DC)
Wiring Details
DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module
- 0 (PA0) connected to 4 Channel 30a 5V Relay IN1+
- 1 (PA1) connected to 4 Channel 30a 5V Relay IN2+
- 2 (PA2) connected to 4 Channel 30a 5V Relay IN3+
- 3 (PA3) connected to 4 Channel 30a 5V Relay IN4+
- 4 (PA4) connected to 4 Channel 30a 5V Relay IN1+
- 5 (PA5) connected to 4 Channel 30a 5V Relay IN2+
- 6 (PA6) connected to 4 Channel 30a 5V Relay IN3+
- 7 (PA7) connected to 4 Channel 30a 5V Relay IN4+
- 8 (PB0) connected to Relay 4 Channel 5v IN1
- 9 (PB1) connected to Relay 4 Channel 5v IN2
- 10 (PB2) connected to Relay 4 Channel 5v IN3
- 11 (PB3) connected to Relay 4 Channel 5v IN4
- SCL connected to ESP32-POE-ISO GPIO5
- SDA connected to ESP32-POE-ISO GPIO14
- 5V/VCC connected to POWER SUPPLY 5V 5AMP 12V-24V Output (DC)
- GND connected to POWER SUPPLY 5V 5AMP GND (DC)
Relay 4 Channel 5v
- IN1 connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 8 (PB0)
- IN2 connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 9 (PB1)
- IN3 connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 10 (PB2)
- IN4 connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 11 (PB3)
- VCC connected to POWER SUPPLY 5V 5AMP 12V-24V Output (DC)
- GND connected to POWER SUPPLY 5V 5AMP GND (DC)
DHT22
- + connected to POWER SUPPLY 5V 5AMP 12V-24V Output (DC)
- - connected to POWER SUPPLY 5V 5AMP GND (DC)
- Out connected to ESP32-POE-ISO GPIO13
DHT22 (Second Instance)
- + connected to POWER SUPPLY 5V 5AMP 12V-24V Output (DC)
- - connected to POWER SUPPLY 5V 5AMP GND (DC)
- Out connected to ESP32-POE-ISO GPIO16
4 Channel 30a 5V Relay
- IN1+ connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 0 (PA0)
- IN2+ connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 1 (PA1)
- IN3+ connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 2 (PA2)
- IN4+ connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 3 (PA3)
- 5V connected to POWER SUPPLY 5V 5AMP 12V-24V Output (DC)
- GND connected to POWER SUPPLY 5V 5AMP GND (DC)
4 Channel 30a 5V Relay (Second Instance)
- IN1+ connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 4 (PA4)
- IN2+ connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 5 (PA5)
- IN3+ connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 6 (PA6)
- IN4+ connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 7 (PA7)
- 5V connected to POWER SUPPLY 5V 5AMP 12V-24V Output (DC)
- GND connected to POWER SUPPLY 5V 5AMP GND (DC)
ESP32-POE-ISO
- GPIO5 connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module SCL
- GPIO14 connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module SDA
- GPIO13 connected to DHT22 Out
- GPIO16 connected to DHT22 (Second Instance) Out
- GND connected to POWER SUPPLY 5V 5AMP GND (DC)
POWER SUPPLY 5V 5AMP
- 12V-24V Output (DC) connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module 5V/VCC, Relay 4 Channel 5v VCC, 4 Channel 30a 5V Relay 5V, 4 Channel 30a 5V Relay (Second Instance) 5V, DHT22 +, DHT22 (Second Instance) +
- GND (DC) connected to DFRobot Gravity MCP23017 I2C 16 Digital IO Expansion Module GND, Relay 4 Channel 5v GND, 4 Channel 30a 5V Relay GND, 4 Channel 30a 5V Relay (Second Instance) GND, DHT22 -, DHT22 (Second Instance) -, ESP32-POE-ISO GND
Code
No code is provided for