Skip to content
cropped-image.webp

cropped-banner-promo-full-yellow.jpg

Connect with Us

  • Facebook
  • Twitter
  • Linkedin
  • VK
  • Youtube
  • Instagram
Primary Menu
  • Home
  • Blog
Light/Dark Button
Watch Video
  • Home
  • The Lab
  • ESP32 WiFi LED Controller (RGB Strip)
  • The Lab

ESP32 WiFi LED Controller (RGB Strip)

Friday February 19, 2026 (Last updated: February 20, 2026) 2 minutes read

Difficulty: Beginner
Time Required: 1 hour
Cost: $10-15
ESP Board: ESP32

What You’ll Need

Component Cost Where to Buy
ESP32 Dev Board $5-8 Amazon
WS2812B LED Strip (1m) $4-6 Amazon
5V Power Supply (2A+) $3-5 Amazon
Jumper Wires $2 Amazon

Circuit Diagram

ESP32 Pin Component
5V LED Strip VCC
GND LED Strip GND
GPIO 4 LED Strip DIN

The Complete Code

/*********************************************************************
 * ESP32 WiFi LED Controller
 * 
 * Control RGB LED strip via WiFi and web browser
 * Hardware: ESP32, WS2812B LED Strip
 * 
 * Libraries Required:
 * - FastLED (install from Library Manager)
 *********************************************************************/

#include 
#include 
#include 

// ============== LED CONFIGURATION ==============
#define LED_PIN 4
#define NUM_LEDS 60

CRGB leds[NUM_LEDS];

// ============== WIFI ==============
const char* wifi_ssid = "YOUR_WIFI";
const char* wifi_password = "YOUR_PASSWORD";

WebServer server(80);

// ============== STATE ==============
int currentMode = 0;
int brightness = 100;
CRGB currentColor = CRGB::White;

void setup() {
  Serial.begin(115200);
  
  // Initialize LEDs
  FastLED.addLeds(leds, NUM_LEDS);
  FastLED.setBrightness(brightness);
  
  // Set all LEDs to current color
  fill_solid(leds, NUM_LEDS, currentColor);
  FastLED.show();
  
  connectToWiFi();
  setupWebServer();
  
  Serial.println(F("LED Controller Active!"));
}

void loop() {
  server.handleClient();
  
  // Update LEDs based on mode
  updateLEDs();
}

// ============== FUNCTIONS ==============

void updateLEDs() {
  switch (currentMode) {
    case 0:  // Static color
      fill_solid(leds, NUM_LEDS, currentColor);
      break;
    case 1:  // Rainbow
      for (int i = 0; i < NUM_LEDS; i++) {
        leds[i] = CHSV((i * 256 / NUM_LEDS + millis()/10) % 256, 255, 255);
      }
      break;
    case 2:  // Breathing
      float breath = (sin(millis() / 500.0) + 1) / 2;
      fill_solid(leds, NUM_LEDS, currentColor);
      FastLED.setBrightness(brightness * breath);
      break;
  }
  FastLED.show();
}

void setupWebServer() {
  server.on("/", []() {
    String html = ""
      "

ESP32 LED Controller

" "

Brightness: " + String(brightness) + "

" "" "

" "" "" "" "

" "" "" "" "" "" "" ""; server.send(200, "text/html", html); }); server.on("/mode", []() { currentMode = server.arg("m").toInt(); server.send(200, "text/plain", "OK"); }); server.on("/color", []() { currentColor = CRGB( server.arg("r").toInt(), server.arg("g").toInt(), server.arg("b").toInt() ); server.send(200, "text/plain", "OK"); }); server.on("/bright", []() { brightness = server.arg("b").toInt(); FastLED.setBrightness(brightness); FastLED.show(); server.send(200, "text/plain", "OK"); }); server.begin(); } void connectToWiFi() { WiFi.begin(wifi_ssid, wifi_password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print(F(".")); } Serial.println(F(" Connected!")); Serial.print(F("IP: ")); Serial.println(WiFi.localIP()); }

Official Documentation

  • FastLED Library – Official GitHub
  • ESP32 Arduino – Official docs

Safety Warning

⚠️ Use a separate 5V/2A+ power supply for LED strips longer than 1 meter. USB power is not sufficient.

About The Author

Friday

See author's posts

Post navigation

Previous: ESP32 Smart Garage Door Opener (IoT)
Next: ESP32 Energy Monitor with Power Meter

Related Stories

  • The Lab

Raspberry Pi Pico vs ESP32: Which Should You Choose? 2026

Friday March 4, 2026
  • The Lab

ESP32-C3 vs ESP32-S3: Detailed Comparison 2026

Friday March 4, 2026
  • The Lab

STM32 vs ESP32: Battle of the Microcontrollers 2026

Friday March 3, 2026

Connect with Us

  • Facebook
  • Twitter
  • Linkedin
  • VK
  • Youtube
  • Instagram

Trending News

7 Best Shopify Alternatives for Dropshipping in 2026 1
  • Latest News

7 Best Shopify Alternatives for Dropshipping in 2026

Friday March 4, 2026
ESP32-C3 vs ESP32-S3: Detailed Comparison 2026 2
  • The Lab

ESP32-C3 vs ESP32-S3: Detailed Comparison 2026

Friday March 4, 2026
Raspberry Pi Pico vs ESP32: Which Should You Choose? 2026 3
  • The Lab

Raspberry Pi Pico vs ESP32: Which Should You Choose? 2026

Friday March 4, 2026
STM32 vs ESP32: Battle of the Microcontrollers 2026 4
  • The Lab

STM32 vs ESP32: Battle of the Microcontrollers 2026

Friday March 3, 2026
Arduino Mega vs ESP32: Processing Power Face-off 2026 5
  • The Lab

Arduino Mega vs ESP32: Processing Power Face-off 2026

Friday March 3, 2026

You May Have Missed

  • Latest News

7 Best Shopify Alternatives for Dropshipping in 2026

Friday March 4, 2026
  • The Lab

ESP32-C3 vs ESP32-S3: Detailed Comparison 2026

Friday March 4, 2026
  • The Lab

Raspberry Pi Pico vs ESP32: Which Should You Choose? 2026

Friday March 4, 2026
  • The Lab

STM32 vs ESP32: Battle of the Microcontrollers 2026

Friday March 3, 2026
CoreEcom provides honest, research-backed reviews and essential guides. We filter the noise to help global consumers find quality products that deliver real value, ensuring every purchase is a smart investment.

Categories

Buyer's Manuals Deep Reviews Editor's Choice Latest News Setup Guides The Lab

Quick Links

  • About
  • Editorial Standards
  • Privacy
  • Impressum
  • Contact
  • Facebook
  • Twitter
  • Linkedin
  • VK
  • Youtube
  • Instagram
Copyright © Growthscout 2026 All rights reserved. | ReviewNews by AF themes.