Do you also want to make regular non-addressable RGB LED strips light up with dynamic lighting effects? The ESP32 controller can support high-resolution PWM, which can accurately control the brightness of red, green, and blue to achieve rich color mixing and gradient effects.
But how to control RGB LED strips with ESP32?
1.What materials are required
Power Supply DC5V
DC5V Output
- Voltage: DC 5V
- Current: 80A
- Power: 200W
DC5V Input
- Voltage R: AC 110V/220V (dual input supported, switch-selectable)
Application
- Powers both the non-addressable RGB LED strip and the ESP32 (via 5V/GND lines)
- Provide enough current to allow the LED strip to run farther
- Good and reliable ventilation and heat dissipation allow you to get twice the result with half the effort
ESP32 Board
Model: ESP32
Operating Voltage: 5V
Input Voltage (recommended): Connect the positive pole of the light strip to the positive pole of the DC5V power supply.
Digital I/O Pins:The negative poles R-/G-/B- of the light strip are connected to the digital I/O pins respectively (PWM pins are recommended)
Analog Input Pins: 9
Clock Speed: 30 MHz
Programming Interface: USB Type-C
ESP32 Setup:
- The Esp32 controller sends digital data signals to the non-addressable RGB led strips
- Connect the positive pole of the LED strip to the positive pole of the DC5V power supply,Control board current <500mA
- The GPIO of ESP32 is 3.3V logic level. It is recommended to add a 220 ohm – 1K ohm resistor between GPIO and the light strip (to prevent overcurrent from damaging ESP32)
Non-addressable RGB led strip
Type: Regular non-addressable RGB led strip
Input Voltage: 5V DC
Features:Through the intelligent control of the ESP32 controller, red, green and blue mixed colors can be achieved
LED Density: 60 LEDs /M
Unlike addresable LED strips, non-addressable RGB led strips and non-addressable RGBW LED strips have a core advantage of single-color stable light effects. It removes the complex streamer effect and meets the needs of professional scenes through precise pure color output.
It has its own advantages. Its fixed color mode can reduce visual interference and is particularly suitable for office environments that require concentration. In the industrial field, non-colorful RGB can also achieve dynamic lighting effects through coding.
2.RGB les strip and ESP32 Wiring Schematic
The wiring diagram of LEDSuntech is shown below:
Note:
1. Current of the ESP32 control board is <500mA;
2. The current of the light strip is too large, please use an external power supply to power the light strip;
3. The DC3.3/5V interface is the voltage output port of the ESP 32 control board. It cannot be connected to the power supply. Use the DC interface to connect the power supply;
4. This wiring diagram is a common anode, please note that the program is a common anode program;
5. Note that the GPIO of ESP32 is a 3.3V logic level. It is recommended to add a 220 ohm-1K ohm resistor between GPIO and the light strip (to prevent overcurrent from damaging ESP32)
3.RGB les strip and ESP32 Connection Diagram
Tips:
- Connect the data wire from Arduino to DIN
- The negative poles R-/G-/B- of the light strip are connected to the digital I/O pins respectively (PWM pins are recommended)
- Keeping the disconnect power before rewiring
4.ESP32 Code Upload
Programming software: Arduino IDE
Library Used: FastLED
LEDsuntech : We have a professional engineering team. If you have any difficulties in programming, please contact us.
// Define RGB pins
const int redPin = 9; // Red pin connects to PWM pin 9
const int greenPin = 10; // Green pin connects to PWM pin 10
const int bluePin = 11; //The blue pin is connected to PWM pin 11
// Fade speed control (milliseconds)
const int fadeSpeed = 20;
void setup() {
// Set the pin to output mode
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
// Initial state: all off (common anode)
analogWrite(redPin, 255);
analogWrite(greenPin, 255);
analogWrite(bluePin, 255);
}
void loop() {
// Red→Green Gradient
for (int i = 0; i <= 255; i++) {
analogWrite(redPin, i);
analogWrite(greenPin, 255 - i);
analogWrite(bluePin, 255);
delay(fadeSpeed);
}
//Green→Blue Gradient
for (int i = 0; i <= 255; i++) {
analogWrite(redPin, 255);
analogWrite(greenPin, i);
analogWrite(bluePin, 255 - i);
delay(fadeSpeed);
}
// Blue→Red Gradient
for (int i = 0; i <= 255; i++) {
analogWrite(redPin, 255 - i);
analogWrite(greenPin, 255);
analogWrite(bluePin, i);
delay(fadeSpeed);
}
}
5.RGB led strip demonstration Video
The following video shows you various lighting effects
From the above videos and articles, we can see that ESP32 has given traditional non-addressable RGB LED strips intelligence and higher flexibility. Whether it is home lighting, commercial decoration or artistic creation, ESP32 is the best choice.
In addition to ESP32, we also have many regular LED Controllers,if you have any questions or needs, please feel free to contact us.