This circuit is designed to control multiple AC and DC loads using an ESP32 microcontroller and a 5V 8-channel relay module. The ESP32 is responsible for triggering the relays, which in turn control the connected devices, including LED bulbs and fans. The circuit also includes multiple rocker switches (SPST) to manually control the state of the GPIO pins on the ESP32. A 5V adapter is used to power the relay module and the ESP32, while a 240V power source is used to supply power to the AC loads.
EN
: Not connected in this circuit.VP
: Not connected in this circuit.VN
: Connected to the VCC
pin of the 5V 8-Channel Relay and 5V
pin of the 5V Adapter.D34
- D27
, D14
, D12
, D13
, D23
, D22
, D21
, D19
, D18
, D5
, D4
, D15
: Connected to various rocker switches and relay inputs.GND
: Common ground with the 5V Adapter and all rocker switches.Vin
: Not connected in this circuit.TX0
, RX0
, TX2
, RX2
, D2
: Not connected in this circuit.3V3
: Not connected in this circuit.GND
: Connected to the common ground.IN1
- IN8
: Controlled by various GPIO pins on the ESP32.VCC
: Powered by the 5V Adapter.NC
, C
, NO
: Connected to the LED bulbs, fans, and 240V Power Source.1
: Connected to the common ground.2
: Connected to various GPIO pins on the ESP32.AC In 1
, AC In 2
: Connected to the 240V Power Source.5V
: Powers the 5V 8-Channel Relay and the ESP32.GND
: Common ground with the ESP32 and all rocker switches.+
: Connected to the NC
terminal of the relay module.-
: Connected to the Neutral
terminal of the 240V Power Source.Live
: Connected to the C
terminal of the relay module.Neutral
: Common neutral with the LED bulbs.GND
: Connected to the common ground.5V
: Connected to the NC
terminal of the relay module.No code has been provided for the microcontrollers in the circuit. The ESP32 would typically be programmed to control the state of the GPIO pins based on the input from the rocker switches or other sensors, which in turn would control the relay module to switch the connected loads. The code would include setup routines for configuring the GPIO pins as outputs, and loop routines for reading the switch states and setting the relay states accordingly.