I2C-Controlled Relay Switching with ESP32 and MCP23017 for Home Automation
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
The circuit in question appears to be a control and monitoring system, possibly for a home automation or industrial application. It includes a variety of components such as microcontrollers, I/O expanders, analog-to-digital converters (ADCs), resistors, relay modules, and power supply lines (Live, Neutral, and Ground). The microcontrollers are likely used for controlling the logic of the system, while the I/O expanders increase the number of I/O pins available for use. The ADC is used for converting analog signals to digital values that the microcontroller can process. The resistors are likely used for pull-up configurations on I2C lines or other signal conditioning. The relay module is used to control high-power devices. The power supply lines provide the necessary power to the components.
Component List
Microcontrollers
- Olimex ESP32-EVB: A microcontroller board based on the ESP32 chip, featuring Wi-Fi and Bluetooth connectivity, multiple GPIOs, and various communication interfaces.
I/O Expanders
- MCP23017: A 16-bit I/O expander with an I2C interface, providing additional GPIOs.
ADC
- Adafruit ADS1115 16Bit I2C ADC: A high precision, 16-bit analog-to-digital converter with an I2C interface.
Resistors
- Resistor: A passive component used to limit current or divide voltages. In this circuit, multiple 4700 Ohm resistors are used.
Relay Modules
- 8-channel relay: A module with 8 relays that can be controlled to switch high-power devices on and off.
Power Supply Lines
- Live: The live wire provides the supply voltage.
- Neutral: The neutral wire completes the electrical circuit.
- Ground (GND): The ground wire is a safety line that is connected to the earth.
Actuators
- Heating Actuator: A device used to control the heating system.
Sensors
- Magnet Contact: A sensor that detects the presence of a magnetic field, typically used for security systems such as door or window sensors.
Miscellaneous
- Wago Terminal (3-way): A connector used for easily connecting wires together.
- Evosta 3: A specific component, possibly a pump or valve, used in conjunction with the heating system.
- Thermostat: A device that regulates the temperature by controlling the heating system based on the temperature setpoint.
Wiring Details
Olimex ESP32-EVB
- Connected to I2C bus (SCL, SDA) along with pull-up resistors.
- Ground (GND) and 5V connected to corresponding power lines.
- Various GPIOs connected to relay module and heating actuators.
MCP23017 (I/O Expander)
- VDD connected to the positive power supply (Vcc).
- VSS connected to Ground (GND).
- SCL, SDA connected to I2C bus with pull-up resistors.
- RESET connected to a pull-up resistor.
- GPB0-GPB7 connected to the inputs of the 8-channel relay module.
Adafruit ADS1115 16Bit I2C ADC
- VDD connected to the positive power supply (Vcc).
- GND connected to Ground (GND).
- SCL, SDA connected to I2C bus.
- AIN0-AIN3 connected to resistors.
8-channel relay
- IN1-IN8 connected to MCP23017 GPB0-GPB7 respectively.
- VCC connected to the positive power supply (Vcc).
- GND connected to Ground (GND).
- NO (Normally Open) and COM (Common) pins connected to various Live lines and heating actuators.
Resistors
- All resistors are 4700 Ohms and are used in various parts of the circuit, including pull-up configurations and connections to the ADC.
Heating Actuators
- L (Live) connected to relay module outputs and Live power supply.
- N (Neutral) connected to Neutral power supply.
Magnet Contact
- Connected to the Evosta 3 and Wago Terminal.
Evosta 3
- Live and Neutral connected to corresponding power lines.
- GND connected to Ground (GND).
Thermostat
- Live and Neutral connected to corresponding power lines.
- Output connected to Wago Terminal.
Documented Code
No code was provided for the microcontrollers in the circuit. Typically, the code would be responsible for initializing and configuring the I/O pins, setting up communication interfaces (such as I2C), reading sensor data, controlling the relay module, and implementing the control logic for the actuators based on sensor inputs and user commands.