Circuit Documentation
Summary
This circuit is designed to interface an ESP32C3 Supermini microcontroller with various peripherals including a DHT22 temperature and humidity sensor, an RGB LED strip, a pushbutton, a rotary encoder, and a two-channel 5V relay module. The circuit also includes NPN transistors to drive the RGB LED strip and resistors for current limiting and pull-up configurations. An AC source is connected to an HLK-PM12 module to convert AC to DC, which powers the ESP32C3 Supermini and the relay module. The relay module controls an AC LED bulb.
Component List
ESP32C3 Supermini
- Microcontroller with WiFi and Bluetooth capabilities.
- Pins: GPIO05, GPIO06, GPIO07, GPIO08, GPIO09, GPIO10, GPIO20, GPIO21, GPIO00, GPIO01, GPIO02, GPIO03, GPIO04, 3.3V, GND, +5V
DHT22
- Temperature and humidity sensor.
- Pins: +, Out, -
LED RGB Strip
- An RGB LED strip with common anode configuration.
- Pins: Common Connect, Blue Connect, Red Connect, Green Connect
Pushbutton
- A simple pushbutton switch.
- Pins: Pin 3 (out), Pin 4 (out), Pin 1 (in), Pin 2 (in)
Rotary Encoder
- An input device that provides rotational position feedback.
- Pins: EncoderPinA (output pin A), EncoderPinC (common), EncoderPinB (output pin B)
NPN-Transistor
- A bipolar junction transistor used for switching and amplification.
- Pins: E (Emitter), C (Collector), B (Base)
Resistor
- A passive two-terminal electrical component that implements electrical resistance.
- Resistance: Various values (270 Ohms, 10k Ohms)
AC source
- An alternating current power source.
- Pins: -, +
HLK-PM12
- A compact power supply module that converts AC to 5V DC.
- Pins: +V0, -V0, AC
LED bulb AC / Bombillo AC
- An AC-powered LED bulb.
- Pins: +, -
Two Channel Relay 5v
- A relay module with two channels, capable of controlling high power devices.
- Pins: VCC, IN2, IN1, GND, NC2, C2, NO2, NC1, C1, NO1
Wiring Details
ESP32C3 Supermini
- GPIO05 -> Two Channel Relay 5v (IN2)
- GPIO10 -> Resistor (270 Ohms)
- GPIO20 -> Resistor (270 Ohms)
- GPIO21 -> Resistor (270 Ohms)
- GPIO00 -> DHT22 (Out)
- GPIO01 -> Pushbutton (Pin 1 (in))
- GPIO03 -> Rotary Encoder (EncoderPinB (output pin B))
- GPIO04 -> Rotary Encoder (EncoderPinA (output pin A))
- 3.3V -> DHT22 (+), Pushbutton (Pin 4 (out))
- GND -> DHT22 (-), Resistor (10k Ohms), HLK-PM12 (-V0), NPN-Transistor (E), Rotary Encoder (EncoderPinC (common)), Two Channel Relay 5v (GND)
- +5V -> HLK-PM12 (+V0), LED RGB Strip (Common Connect), Two Channel Relay 5v (VCC)
DHT22
- -> ESP32C3 Supermini (3.3V)
- Out -> ESP32C3 Supermini (GPIO00)
- -> ESP32C3 Supermini (GND)
LED RGB Strip
- Common Connect -> ESP32C3 Supermini (+5V)
- Blue Connect -> NPN-Transistor (B)
- Red Connect -> NPN-Transistor (B)
- Green Connect -> NPN-Transistor (B)
Pushbutton
- Pin 3 (out) -> Not connected
- Pin 4 (out) -> ESP32C3 Supermini (3.3V)
- Pin 1 (in) -> ESP32C3 Supermini (GPIO01)
- Pin 2 (in) -> Resistor (10k Ohms)
Rotary Encoder
- EncoderPinA (output pin A) -> ESP32C3 Supermini (GPIO04)
- EncoderPinC (common) -> ESP32C3 Supermini (GND)
- EncoderPinB (output pin B) -> ESP32C3 Supermini (GPIO03)
NPN-Transistor
- E -> ESP32C3 Supermini (GND)
- C -> Resistor (270 Ohms)
- B -> LED RGB Strip (Blue Connect, Red Connect, Green Connect)
Resistor
- 270 Ohms -> Connected between ESP32C3 Supermini (GPIO10, GPIO20, GPIO21) and NPN-Transistor (C)
- 10k Ohms -> Connected between ESP32C3 Supermini (GND) and Pushbutton (Pin 2 (in))
AC source
- -> HLK-PM12 (AC), LED bulb AC / Bombillo AC (+)
- -> HLK-PM12 (AC), Two Channel Relay 5v (C2)
HLK-PM12
- +V0 -> ESP32C3 Supermini (+5V)
- -V0 -> ESP32C3 Supermini (GND)
- AC -> AC source (-, +)
LED bulb AC / Bombillo AC
-
- -> Two Channel Relay 5v (NC2)
Two Channel Relay 5v
- VCC -> ESP32C3 Supermini (+5V)
- IN2 -> ESP32C3 Supermini (GPIO05)
- GND -> ESP32C3 Supermini (GND)
- NC2 -> LED bulb AC / Bombillo AC (-)
- C2 -> AC source (+)
Documented Code
No code was provided for the microcontroller. The documentation of the code would typically include descriptions of the functions, initialization routines, and the main loop, along with any interrupt service routines or additional modules used. Since no code is available, this section remains empty.