Circuit Documentation
Summary
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.
Component List
ESP32 (30 pin)
- Microcontroller with WiFi and Bluetooth capabilities.
- It has a variety of digital I/O pins for interfacing with various components.
5V 8-Channel Relay
- An 8-channel relay module that can control up to 8 different AC/DC loads.
- Each relay has a Normally Open (NO), Normally Closed (NC), and Common (C) terminal.
Rocker Switch (SPST)
- A single-pole single-throw (SPST) rocker switch used for toggling the state of a circuit.
5V Adapter
- Provides a regulated 5V DC output from an AC input.
- Used to power the relay module and the ESP32.
LED bulb AC / Bombillo AC
- An AC-powered LED bulb.
- Controlled by the relay module.
240V Power Source
- Supplies 240V AC power to the circuit.
- Powers the AC loads through the relay module.
Fan
- A DC fan that operates at 5V.
- Controlled by the relay module.
Wiring Details
ESP32 (30 pin)
EN: Not connected in this circuit.VP: Not connected in this circuit.VN: Connected to theVCCpin of the 5V 8-Channel Relay and5Vpin 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.
5V 8-Channel Relay
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.
Rocker Switch (SPST)
1: Connected to the common ground.2: Connected to various GPIO pins on the ESP32.
5V Adapter
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.
LED bulb AC / Bombillo AC
+: Connected to theNCterminal of the relay module.-: Connected to theNeutralterminal of the 240V Power Source.
240V Power Source
Live: Connected to theCterminal of the relay module.Neutral: Common neutral with the LED bulbs.
Fan
GND: Connected to the common ground.5V: Connected to theNCterminal of the relay module.
Documented Code
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.
