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 relay module. The circuit also includes NPN transistors to drive the RGB LED strip and resistors for current limiting and pull-down purposes. An AC source is connected to a power module (HLK-PM12) to provide a stable DC supply for the microcontroller and the relay module. Additionally, an LED bulb is controlled via the relay module, which is actuated by the ESP32C3 Supermini.
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 as a switch or amplifier.
- Pins: E (Emitter), C (Collector), B (Base).
Resistor
- A passive two-terminal electrical component that implements electrical resistance.
- Resistance values: 270 Ohms, 10,000 Ohms.
AC source
- An alternating current power source.
- Pins: -, +.
HLK-PM12
- A compact power supply module that converts AC to 12V DC.
- Pins: +V0, -V0, AC.
LED bulb AC / Bombillo AC
- An LED bulb designed for AC power.
- 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 connected to Two Channel Relay 5v IN2.
- GPIO10 connected to Resistor (270 Ohms).
- GPIO20 connected to Resistor (270 Ohms).
- GPIO21 connected to Resistor (270 Ohms).
- GPIO00 connected to DHT22 Out.
- GPIO01 connected to Pushbutton Pin 1 (in).
- GPIO03 connected to Rotary Encoder EncoderPinB (output pin B).
- GPIO04 connected to Rotary Encoder EncoderPinA (output pin A).
- 3.3V connected to Pushbutton Pin 4 (out), DHT22 +.
- GND connected to DHT22 -, Two Channel Relay 5v GND, HLK-PM12 -V0, NPN-Transistor Emitter (all three), Resistor (10,000 Ohms pin2), Rotary Encoder EncoderPinC (common).
- +5V connected to Two Channel Relay 5v VCC, HLK-PM12 +V0, LED RGB Strip Common Connect.
DHT22
- connected to ESP32C3 Supermini 3.3V.
- Out connected to ESP32C3 Supermini GPIO00.
- connected to ESP32C3 Supermini GND.
LED RGB Strip
- Common Connect connected to ESP32C3 Supermini +5V.
- Blue Connect connected to NPN-Transistor Base.
- Red Connect connected to NPN-Transistor Base.
- Green Connect connected to NPN-Transistor Base.
Pushbutton
- Pin 1 (in) connected to ESP32C3 Supermini GPIO01.
- Pin 2 (in) connected to Resistor (10,000 Ohms pin1).
- Pin 3 (out) not connected.
- Pin 4 (out) connected to ESP32C3 Supermini 3.3V.
Rotary Encoder
- EncoderPinA (output pin A) connected to ESP32C3 Supermini GPIO04.
- EncoderPinC (common) connected to ESP32C3 Supermini GND.
- EncoderPinB (output pin B) connected to ESP32C3 Supermini GPIO03.
NPN-Transistor (three instances)
- Emitter connected to ESP32C3 Supermini GND.
- Collector connected to respective Resistor (270 Ohms pin1).
- Base connected to respective LED RGB Strip Connect (Blue, Red, Green).
Resistor (three instances of 270 Ohms)
- Pin1 connected to respective NPN-Transistor Collector.
- Pin2 connected to respective ESP32C3 Supermini GPIO (GPIO10, GPIO20, GPIO21).
Resistor (one instance of 10,000 Ohms)
- Pin1 connected to Pushbutton Pin 2 (in).
- Pin2 connected to ESP32C3 Supermini GND.
AC source
- connected to LED bulb AC +, HLK-PM12 AC.
- connected to Two Channel Relay 5v C2, HLK-PM12 AC.
HLK-PM12
- +V0 connected to ESP32C3 Supermini +5V, Two Channel Relay 5v VCC.
- -V0 connected to ESP32C3 Supermini GND, Two Channel Relay 5v GND.
- AC connected to AC source -, AC source +.
LED bulb AC / Bombillo AC
- connected to AC source -.
- connected to Two Channel Relay 5v NC2.
Two Channel Relay 5v
- VCC connected to ESP32C3 Supermini +5V, HLK-PM12 +V0.
- IN2 connected to ESP32C3 Supermini GPIO05.
- IN1 not connected.
- GND connected to ESP32C3 Supermini GND, HLK-PM12 -V0.
- NC2 connected to LED bulb AC -.
- C2 connected to AC source +.
- NO2 not connected.
- NC1 not connected.
- C1 not connected.
- NO1 not connected.
Documented Code
No code has been provided for the microcontroller. The documentation of the code would typically include descriptions of the functions, the purpose of each code block, and how the code interacts with the hardware components. Since no code is available, this section cannot be completed. If code becomes available, it should be documented here following the same structure as the rest of the documentation.