How to Program RGBWW LED Strips with ESP8266

ESP8266 is an LED strip dimming controller RGBWW controller. It is widely used. But how to program RGBWW LED strips with ESP8266?
In this article, you will learn how to properly connect and use an RGBWW led strip with an ESP8266. You’ll learn how to code an ESP8266. Let‘s ’keep reading!

1. Materials Required

Power Supply

Output

  • Voltage: DC5V
  • Current: Up to 40A
  • Power Rating: 200W

Input

  • Voltage Range: AC110V/220V (dual input supported, switch-selectable)
  • Low voltage safety:
    The risk of electric shock is extremely low, suitable for scenarios where the human body directly contacts USB devices, handheld electronic products, etc.
    No need for complex insulation design, reducing cost and volume.
Arduino 5V LED Power Supply
5V LED Power Supply

Used in this setup:

  • Powers the RGBWW LED strip and ESP8266 controller (via 5V/GND line)
  • Sufficient current for many LEDs
  • Industrial grade reliability and good heat dissipation and ventilation

ESP8266 Control Board

ESP8266
ESP8266 Control Board Area Pin Introduction

Model: ESP8266
Operating Voltage: 3.3V-5V
Input Voltage (recommended): ESP8266 has two voltages, one is the external power supply port is 5V, Type-C5V, output pin 3.3V
Digital I/O Pins: 5 (supports PWM)
Maximum operating pixels: 800-1000 pixels
Programming Interface: USB Type-C

Use in this setup:

  • The ESP8266 controller is used as a controller to send digital data signals to the RGBWW (RGB is Addressable) LED strip.
  • The RGBWWLED strip is powered by connecting an external power supply through the 5V and GND pins.
  • It should be noted that the GPIO of the ESP8266 is a 3.3V logic level, so the GPIO pins need to be level-converted before connecting to the LED strip signal pins. The Dat, CW, W solder joint interface of the RGBW W LED strip is connected to the 5V data output pins (HU1-HU3) in the level converter through three wires, and then connected to the digital I2-14 interface through the 3.3V (LU1-LU3) interface.

RGBWW Led Strip

D4 5V RGBWW 1
60LEDs/m RGBWW LED Strip

Type: RGBWW (Addressable RGB and regular monochrome CW+W), this is a combination of the two styles
Voltage: DC5V
Features: It is composed of three LED chips, forming 5 different color effects, showing more colorful colors than regular led strips
LED Density: 60 LEDs/m

Accessories & Tools

  • Connecting Wires: Use appropriate gauge, e.g., 18–22 AWG,18-22AWG wire diameter is the most standard wire used for light strips.For a specific comparison of wire diameters, you can check out our article: 18AWG VS 20AWG VS 22AWG VS 24AWG Cable for LED Strip
  • Logic-Level Shifter: Must use 4-way level converter

2. Wiring Schematic

The following is a schematic diagram of the RGBWW Led strip in ESP8266 from LEDSuntech.

esp8266 rgbww schematic
How to Control RGBWW LED Strip with ESP8266 Wiring Diagram

Note:
1. The control board current of ESP8266 is less than 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 interface is the voltage output port of the control board and cannot be connected to the power supply;
4. The light strip is powered by DC12V, and the power supply range of the control board is DC3.3-9V, so the control board is powered by DC5V alone;
5. The wiring of RGB is the same as that of RGBW, but the program cannot be shared,The two programming procedures are completely different;
6. The more points, the lower the refresh rate;
7. Note that the GPIO of ESP8266 is 3.3V logic level, so the GPIO pin needs to be converted and then connected to the signal pin of the led strip.

3. Connection Diagram

esp8266 rgbww
How to Control RGBWW LED Strip with ESP8266 LEDSuntech

Tips:

  • Short, direct data wire from ESP8266 to DIN
  • Safety terminal connection on power supply
  • Always disconnect power before rewiring

4. Code Upload

Software: Arduino IDE

Library Used: FastLED

LEDSuntech provides professional and meticulous programming with rich effects. If you have any questions, please contact our professional engineers.

				
					#include  // Used to control the colorful RGB strip

// Colorful RGB settings
#define RGB_PIN 4 // D2
#define RGB_LEDS 80 // Number of colorful LEDs
Adafruit_NeoPixel rgbStrip = Adafruit_NeoPixel(RGB_LEDS, RGB_PIN, NEO_GRB + NEO_KHZ800);

// Non-colorful WW+CW settings
#define WW_PIN 12 // D6 - warm white
#define CW_PIN 13 // D7 - cool white

// PWM range settings (0-1023 for ESP8266)
const int pwmRange = 1023;

void setup() {
Serial.begin(115200);

// Initialize the colorful RGB strip
rgbStrip.begin();
rgbStrip.show(); // Initially all off

// Set WW/CW pins to output mode
pinMode(WW_PIN, OUTPUT);
pinMode(CW_PIN, OUTPUT);
analogWrite(WW_PIN, 0);
analogWrite(CW_PIN, 0);

Serial.println("RGBWW LED Controller Ready");
}

void loop() {
// Example 1: RGB rainbow effect + warm white light
rainbowCycle(10);
setWhite(255, 50); // Warm white strong, cold white weak

// Example 2: RGB static blue + cold white light
setRGBColor(0, 0, 255);
setWhite(50, 255);
delay(2000);

// Example 3: RGB marquee + white light gradient
theaterChase(0, 255, 0, 50); // Green marquee
for(int i = 0; i <= 255; i++) {
setWhite(i, 255-i);
delay(20);
}
}

// Set RGB color (0-255)
void setRGBColor(uint8_t r, uint8_t g, uint8_t b) {
for(int i=0; i<rgbStrip.numPixels(); i++) {
rgbStrip.setPixelColor(i, rgbStrip.Color(r, g, b));
}
rgbStrip.show();
}

// Set white light ratio (0-255)
void setWhite(uint8_t ww, uint8_t cw) {
analogWrite(WW_PIN, map(ww, 0, 255, 0, pwmRange));
analogWrite(CW_PIN, map(cw, 0, 255, 0, pwmRange));

Serial.print("Set White - WW:");
Serial.print(ww);
Serial.print(" CW:");
Serial.println(cw);
}

// Rainbow effect function
void rainbowCycle(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
for(i=0; i< rgbStrip.numPixels(); i++) {
rgbStrip.setPixelColor(i, Wheel(((i * 256 / rgbStrip.numPixels()) + j) & 255));
}
rgbStrip.show();
delay(wait);
}
}

// Marquee effect
void theaterChase(uint8_t r, uint8_t g, uint8_t b, uint8_t wait) {
for (int q=0; q < 3; q++) {
for (int i=0; i < rgbStrip.numPixels(); i=i+3) {
rgbStrip.setPixelColor(i+q, rgbStrip.Color(r, g, b)); // Light up every 3 lamp beads
}
rgbStrip.show();
delay(wait);
for (int i=0; i < rgbStrip.numPixels(); i=i+3) {
rgbStrip.setPixelColor(i+q, 0); // Close
}
}
}

// Auxiliary function for rainbow effect
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return rgbStrip.Color(255 - WheelPos * 3, 0, WheelPos * 3); 
} 
if(WheelPos < 170) { 
WheelPos -= 85; 
return rgbStrip.Color(0, WheelPos * 3, 255 - WheelPos * 3); 
} 
WheelPos -= 170; 
return rgbStrip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
				
			

5. Demonstration Video

Please check out the video below for more details on how to use the ESP8266 controller to control the light changing effects of the RGBWW LED strip.

The ESP8266 microcontroller can customize multifunctional lighting effects to meet your many imaginations. With the right wiring diagram and programming code, you can easily create smooth and colorful effects.
If you want or wish to use the ESP8266 programmable LED strip, feel free to contact LedSuntech.

Feel Free To Contact Us

We will reply your email within 12 hours.

Ask For A Quote