How to Use ESP32 Drive RGBW LED Strips

SuntechLite is a top manufacturer and supplier that focuses on pixel LED strips and LED neon lights.

Do you have trouble controlling the ESP32? How to use ESP32 drive RGBW LED strips?

This article will guide you on how to control the RGBWW LED strip with the ESP32. It will show you in detail how to properly power and wire the controller and LED strip, and show you that the LED strip has customizable effects.

1. What materials is Required

DC5V Power Supply

DC5V Output

  • Voltage: DC 5V
  • Current: Up to 40A
  • Power Rating: 200W

DC5V Input

  • Voltage Range: AC 110V/220V 
power supply 5V
DC5V LED Power Supply

The role of DC5V power supply:

  • Powers both the RGBW 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

As the most common low-voltage DC power supply solution, DC5V power supply has been used in all aspects of daily life. In the field of mobile devices, electronic products such as smart phones, Bluetooth headsets, and tablets all rely on 5V voltage for charging. LED strips can also be powered by a DC5V power supply to achieve flexible installation.

Whether the power supply output parameters match, interface compatibility and safety certification are requirements that must be considered when purchasing. Generally, the conversion efficiency of this type of power supply is generally more than 80%, and the operating temperature is controlled within 45°C, which reduces energy loss while ensuring safety. If you have difficulties in choosing a power supply, you can also contact us. We have a professional technical team to recommend a suitable power supply for you.

ESP32 Board

ESP32
ESP32 control board Area pin introduction

Model: ESP32
Voltage: DC5V
Input Voltage (recommended): DC5V,
(If you choose to use a DC adapter for power supply, it can be DC6.5V~DC9V)
Digital I/O Pins: GPIO0~33 can be used for PWM output, GPIO34~39 can only be used for input, not output.GPIO2, 12, 15: Keep high level when starting, otherwise it may fail to start. GPIO0: Pull low in download mode and pull high in normal operation.
Analog Input Pins: 9
Clock Speed: 30 MHz
Programming Interface: USB Type-C

Setting tips

  • The Esp32 controller sends digital data signals to the RGBW strip
  • Connect the positive pole of the LED strip to the positive pole of the DC5V power supply, Control board current <500mA.RGBW LED strips have high power consumption (especially long ones), and the 5V pin of ESP32 has limited output current (usually <500mA). You need to connect an external 5V power supply and ground the negative pole of the light strip with the ESP32 to avoid voltage shortage that may cause brightness reduction or chip overload.
  • The negative poles R-/G-/B- of the LED strip are connected to the digital I/O pins respectively (PWM pins are recommended)

Regular RGBW LED strip

Type: Regular non-addressable RGBW led strip
Input Voltage: 5V DC
Features: No complicated IC chips, rich images can be displayed through the built-in program of the controller
LED quantity: 60 LEDs/m

5v led strip light

Regular non-addressable RGBW LED strip (red, green, blue and white mixed) lamps are widely used in the field of interior decoration. Their lighting effects and practicality make them the first choice for interior decoration.Compared with traditional RGB LED strips, RGBW reduces the energy consumption of three-color mixing through independent white light, and LED technology is more advanced, with long life and low power consumption, which is very in line with the family’s demand for energy saving and environmental protection.
From the functional point of view, RGBW LED strips can not only provide basic lighting, but also switch color modes through APP or remote control, adapting to various scenes such as parties, watching movies, reading, etc., to meet the pursuit of smart homes by young users

Our RGBW LED strips are also divided into constant current light strips and constant voltage light strips. If you need to know more, Constant Current RGBW LED Strip VS Constant Voltage RGBW LED Strip can provide you with more information.

Accessories and Tools

  • external power supply:It is recommended to use when the load current is too large.
  • 220 ohm – 1K ohm resistor: The GPIO of ESP32 is 3.3V logic level. It is recommended to add a resistor between GPIO and the light strip.

2. Wiring Schematic details

The wiring diagram of SunTechLite is shown below:

ESP32 RGBW Schematic diagram
How to Control RGBW LED Strip with ESP32 Wiring Diagram

Note:

1. The current of the control board is needed <500mA;

2. if the current of the LED strip is too large, please use an external power supply to power the LED strip such as DC5V power supply.

3. The DC3.3/5V interface is the voltage output port of the ESP32 control board, it cannot be connected to the power supply. Use the DC interface to connect the power supply.If you connect it to a power source, the control board will be damaged.

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. Connection Diagram shows

ESP32 RGBW connect picuture
 How to Control RGBW LED Strip with ESP32 Suntechlite

The ESP32 microcontroller also supports built-in Wi-Fi and Bluetooth dual-mode communication modules, and can simultaneously support protocols such as MQTT, HTTP, and BLE Mesh. Users can use the mobile phone APP to achieve remote dimming, which is convenient and fast. Compared with traditional large controllers, it is more intelligent and saves installation space.

4. How to write a program

Software: Arduino IDE is used

SunTechlite : We can provide you with codes for various light change effects. As shown below, for your reference

				
					// Define RGBW control pins
#define RED_PIN    12   // D6
#define GREEN_PIN  13   // D7
#define BLUE_PIN   14   // D5
#define WHITE_PIN   4   // D2

// PWM Scope setting (0-1023 for ESP8266)
const int pwmRange = 1023;

void setup() {
  // Initialize serial communication
  Serial.begin(115200);
  
  //Set the PWM pin to output mode
  pinMode(RED_PIN, OUTPUT);
  pinMode(GREEN_PIN, OUTPUT);
  pinMode(BLUE_PIN, OUTPUT);
  pinMode(WHITE_PIN, OUTPUT);
  
  // Initial state: all closed
  analogWrite(RED_PIN, 0);
  analogWrite(GREEN_PIN, 0);
  analogWrite(BLUE_PIN, 0);
  analogWrite(WHITE_PIN, 0);
  
  Serial.println("RGBW LED Controller Ready");
}

void loop() {
  // Example: Cycle through different colors
  setColor(255, 0, 0, 0);    // Red
  delay(1000);
  setColor(0, 255, 0, 0);    // Green
  delay(1000);
  setColor(0, 0, 255, 0);    // Blue
  delay(1000);
  setColor(0, 0, 0, 255);    // White
  delay(1000);
  setColor(255, 255, 255, 255); // fully bright
  delay(1000);
  setColor(0, 0, 0, 0);      // fully off
  delay(1000);
  
  //Example: Warm white gradient
  for(int i = 0; i = 0; i--) {
    setColor(i, i/3, 0, i/2);
    delay(20);
  }
}

// Set the RGBW color function (0-255)
void setColor(int red, int green, int blue, int white) {
  //Map 0-255 values ​​to 0-pwmRange
  analogWrite(RED_PIN, map(red, 0, 255, 0, pwmRange));
  analogWrite(GREEN_PIN, map(green, 0, 255, 0, pwmRange));
  analogWrite(BLUE_PIN, map(blue, 0, 255, 0, pwmRange));
  analogWrite(WHITE_PIN, map(white, 0, 255, 0, pwmRange));
  
  Serial.print("Set Color - R:");
  Serial.print(red);
  Serial.print(" G:");
  Serial.print(green);
  Serial.print(" B:");
  Serial.print(blue);
  Serial.print(" W:");
  Serial.println(white);
}
				
			

5. RGBW LED strip Demonstration Video

Below is a video that shows how to control the LED changing effect of the RGBW LED strip with ESP32.

Regular RGBW LED strips can only light up one color at a time, but you can customize the various lighting effects of RGBW LED strips by using the ESP32 controller. It takes too many complicated steps, just choose the right power supply, stable circuit and the right code library, and you can easily achieve smooth full-color animation.

SuntechLite is a top manufacturer and supplier that focuses on LED strips. We will also have a special article to guide you on how to check LED strip quality. We hope that our products can make your life more colorful.

Share To

Enquiry