How to make LED Wheel using Nodemcu +Pixel LED WS2812

How to make LED Wheel using Nodemcu +Pixel LED WS2812





Items Needed
1) Node MCU ESp8266
2) Pixel LED strip ws2812
3) Li ion Battery
4) switch
5) Circular Box


Library download



Circuit Diagram




Code Download

=======================================================
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif

#define LED_PIN    D4

// How many NeoPixels are attached to the Arduino?
#define LED_COUNT 18

// Declare our NeoPixel strip object:
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);


void setup() {

#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
  clock_prescale_set(clock_div_1);
#endif
  // END of Trinket-specific code.

  strip.begin();           // INITIALIZE NeoPixel strip object (REQUIRED)
  strip.show();            // Turn OFF all pixels ASAP
  strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255)
}


// loop() function -- runs repeatedly as long as board is on ---------------

void loop() {
  // Fill along the length of the strip in various colors...
  colorWipe(strip.Color(255,   0,   0), 50); // Red
  colorWipe(strip.Color(  0, 255,   0), 50); // Green
  colorWipe(strip.Color(  0,   0, 255), 50); // Blue

  // Do a theater marquee effect in various colors...
  theaterChase(strip.Color(127, 127, 127), 50); // White, half brightness
  theaterChase(strip.Color(127,   0,   0), 50); // Red, half brightness
  theaterChase(strip.Color(  0,   0, 127), 50); // Blue, half brightness

  rainbow(10);             // Flowing rainbow cycle along the whole strip
  theaterChaseRainbow(50); // Rainbow-enhanced theaterChase variant
}


void colorWipe(uint32_t color, int wait) {
  for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...
    strip.setPixelColor(i, color);         //  Set pixel's color (in RAM)
    strip.show();                          //  Update strip to match
    delay(wait);                           //  Pause for a moment
  }
}

void theaterChase(uint32_t color, int wait) {
  for(int a=0; a<10; a++) {  // Repeat 10 times...
    for(int b=0; b<3; b++) { //  'b' counts from 0 to 2...
      strip.clear();         //   Set all pixels in RAM to 0 (off)
      // 'c' counts up from 'b' to end of strip in steps of 3...
      for(int c=b; c<strip.numPixels(); c += 3) {
        strip.setPixelColor(c, color); // Set pixel 'c' to value 'color'
      }
      strip.show(); // Update strip with new contents
      delay(wait);  // Pause for a moment
    }
  }
}

// Rainbow cycle along whole strip. Pass delay time (in ms) between frames.
void rainbow(int wait) 
  for(long firstPixelHue = 0; firstPixelHue < 5*65536; firstPixelHue += 256) {
    for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...

      int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());

      strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
    }
    strip.show(); // Update strip with new contents
    delay(wait);  // Pause for a moment
  }
}

// Rainbow-enhanced theater marquee. Pass delay time (in ms) between frames.
void theaterChaseRainbow(int wait) {
  int firstPixelHue = 0;     // First pixel starts at red (hue 0)
  for(int a=0; a<30; a++) {  // Repeat 30 times...
    for(int b=0; b<3; b++) { //  'b' counts from 0 to 2...
      strip.clear();         //   Set all pixels in RAM to 0 (off)
      // 'c' counts up from 'b' to end of strip in increments of 3...
      for(int c=b; c<strip.numPixels(); c += 3) {
 
        int      hue   = firstPixelHue + c * 65536L / strip.numPixels();
        uint32_t color = strip.gamma32(strip.ColorHSV(hue)); // hue -> RGB
        strip.setPixelColor(c, color); // Set pixel 'c' to value 'color'
      }
      strip.show();                // Update strip with new contents
      delay(wait);                 // Pause for a moment
      firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames
    }
  }
}
=======================================================

How to Make a Pixel LED Wheel Using NodeMCU | WS2812B LED Wheel Project | DIY RGB Wheel Lights


🎬 Video Sections & Script

“Hello everyone! Welcome back to my channel. In today’s video, we’re going to build a Pixel LED Wheel using a NodeMCU ESP8266 board and WS2812B addressable LEDs. This wheel can display amazing light effects and patterns, all programmable through Arduino IDE.”

Show a short preview of the final glowing wheel.


🔹 Components Required (0:30 - 1:30)

“Let’s start with the components you’ll need for this project.”

📦 Components List:

  • NodeMCU ESP8266 board

  • WS2812B or NeoPixel LED strip (60 LEDs/meter recommended)

  • 5V 2A Power supply

  • 470Ω resistor

  • 1000µF capacitor (optional for LED protection)

  • Jumper wires

  • Wheel base or circular frame (you can use an old cycle wheel)

  • Soldering tools and hot glue

Show all parts on screen with labels.


🔹 Circuit Connection (1:30 - 3:00)

“Now let’s connect the components.”

Connections:

  • WS2812B DIN → NodeMCU D4 (GPIO2)

  • WS2812B 5V5V Power Supply +

  • WS2812B GNDPower Supply - and NodeMCU GND

  • Add 470Ω resistor between D4 and DIN

  • Add 1000µF capacitor across +5V and GND at the LED input

Show circuit diagram animation (you can draw it in Fritzing or online circuit simulator).


🔹 Programming

“Next, we’ll upload the Arduino code to control the Pixel LEDs.”

  1. Open Arduino IDE

  2. Go to File → Preferences → Additional Boards Manager URLs, and add:

http://arduino.esp8266.com/stable/package_esp8266com_index.json

  1. Install ESP8266 board via Board Manager

  2. Install Adafruit NeoPixel library

Then use this example code 👇

///////////////////////////////////////////////////////////////////////////////////////

#include <Adafruit_NeoPixel.h>


#define LED_PIN D4

#define LED_COUNT 60   // change as per your wheel LED count


Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);


void setup() {

  strip.begin();

  strip.show();

}


void loop() {

  rainbowCycle(5);  // smooth rainbow effect

}


void rainbowCycle(uint8_t wait) {

  uint16_t i, j;

  for(j=0; j<256*5; j++) {

    for(i=0; i<strip.numPixels(); i++) {

      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));

    }

    strip.show();

    delay(wait);

  }

}


uint32_t Wheel(byte WheelPos) {

  WheelPos = 255 - WheelPos;

  if(WheelPos < 85) return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);

  if(WheelPos < 170) {

    WheelPos -= 85;

    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);

  }

  WheelPos -= 170;

  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);

}


//////////////////////////////////////////////////////////////////////////////////////

Mounting the LEDs

“Now let’s fix the LEDs on the wheel.”

  • Stick or solder the WS2812B strip around the rim or spokes

  • Secure with zip ties or glue

  • Connect the NodeMCU at the center hub

  • Connect the power supply carefully


Power ON & Demo

“Now let’s power it up and see the results!”

Show multiple color effects, slow-mo shots, and explain what’s happening.

“As you can see, the LEDs create a beautiful rotating RGB pattern on the wheel!”


 “So that’s how you can make your own Pixel LED Wheel using NodeMCU. You can add Wi-Fi control or music sync later — I’ll make a part 2 on that soon!”

“If you liked this project, don’t forget to Like, Share, and Subscribe for more electronics tutorials.”

pixel led wheel, pixel led project, nodemcu project, ws2812b wheel, neopixel wheel, rgb wheel lights, diy led wheel, nodemcu ws2812b project, addressable led project, arduino led project, led wheel animation, esp8266 led, pixel led effects, smart led wheel, nodemcu pixel led, diy electronics project, rgb effects, ws2812b nodemcu, arduino pixel led, esp8266 led effects,

 


No comments:

Post a Comment

Wifi Home automation Diy kit

 Wifi Home automation Diy kit By Manmohan Pal Wifi Home Automation Kit Hi, This is Manmohan Pal, I am glad to present a DIY kit for Home Aut...