This document provides a detailed overview of a circuit that includes an ESP32 microcontroller, a 4-channel relay module, a 220V fan, and multiple 220V power sources. The ESP32 controls the relay module, which in turn controls the fan. The circuit is designed to activate the fan through the relay module when the ESP32 sets a specific pin high.
Power 220V
ESP32
4-Channel Relay Module
220V Fan
Instance 1:
Instance 2:
Instance 3:
/*
* This Arduino Sketch is for an ESP32 microcontroller in a circuit that includes
* a 4-channel relay module and a 220V fan. The ESP32 controls the relay module
* through its D23 pin. This code sets the D23 pin high to activate the relay.
*/
int relayPin = 23; // D23 pin connected to IN 1 of the relay module
void setup() {
pinMode(relayPin, OUTPUT); // Set D23 as an output pin
digitalWrite(relayPin, HIGH); // Set D23 pin high to activate the relay
}
void loop() {
// Main code loop, currently empty as no repeated actions are required
}
This code initializes the D23 pin of the ESP32 as an output and sets it high to activate the relay connected to IN 1 of the 4-channel relay module. The relay, in turn, controls the 220V fan.