In this tutorial, we will use the IoT Android app called Blynk to control WS2812B Neopixel addressable LED Strip with NodeMCU ESP8266. We will use WIfi to control RGB LED Strip wirelessly from any part of the world.
Overview
The most popular decorative item used during Festivals like Eid, Christmas & Diwali are LEDs. The LED light during the night makes everything looks beautiful. But most of the LED available only produce a single colour. So to create a multicolour beautiful light pattern we can use RGB LED. But here we will create such pattern ourselves using multiple colours LED strips.
We will use WS2812B Neopixel RGB LED Strip and interface it with NodeMCU ESP8266 Board. With the help of wifi network, we will control RGB LED Strip wirelessly from anywhere. We will download the Blynk Android app from play store and configure it for controlling LED Pattern, colour & brightness. We will learn about the working principle of WS2812B RGB LED Strip.
You can go through one of our previous project: Interfacing NeoPixel LED Strip WS2812B with Arduino for Rainbow Color
Bill of Materials
| S.N. | Components | Quantity | Purchase Links |
|---|---|---|---|
| 1 | NodeMCU ESP8266 | 1 | Amazon | AliExpress |
| 2 | WS2812B Neopixel LED Strip | 1 Strip | Amazon | AliExpress |
| 3 | 5V, 2A Power Adapter | 1 | Amazon | AliExpress |
| 4 | Resistor 200-0hm | 1 | Amazon | AliExpress |
| 4 | Connecting Wires | 10 | Amazon | AliExpress |
| 5 | Breadboard | 1 | Amazon | AliExpress |
WS2812 NeoPixel LED Strip Construction & Working
WS2812 LED strips are addressable and programmable Flexible LED strips. These LED Strips are powered by a 5050 RGB LED with a WS2812 LED driver integrated within it.
Depending on the intensity of the three individual Red, Green, and Blue LEDs we can simulate any colour we want. What’s great about these LEDs is that we can control even the entire LED strip with just a single pin from our microcontroller board.
Each RGB LED consumes 60mA (20mA+20mA+20mA) current and can be powered from a 5V DC supply. Each LED has three connectors at each end, two for the powering and one for the data. The arrow indicates the data flow direction. The data output pad of the previous LED is connected to the Data Input pad of the next LED. We can cut the strip to any size we want, as well as the distance the LEDs using some wires.
Interfacing WS2812B Neopixel LED Strip with NodeMCU ESP8266
Now let us interface WS2812B Neopixel LED Strip with NodeMCU. The Circuit diagram & connection is given below.
Supply 5V to VCC Pin and connect the GND to GND. Connect the digital output pin to any of the digital pins of NodeMCU. In my case, I used D2 Pin.
Setting up the Blynk Android App
Blynk is an application that runs over Android and IOS devices to control any IoT based application using Smartphones. It allows you to create your Graphical user interface for IoT application. Here we will set up the Blynk application to control NeoPixel LED over Wi-Fi using NodeMCU ESP8266.
So download and install the Blynk Application from Google Play store. IOS users can download from the App Store. Once the installation is completed, open the app & sign-up using your Email id and Password.



After the successful creation of the Project, go back to setting and click on Send Email. You will get an Authenticate ID on registered mail. Save the Authenticate ID for future reference.
Source Code/Program
Once the hardware setup is done, now we need to upload the code to the NodeMCU ESP8266-12E Board. But before that you need to install 2 libraries.
1. FastLED.h Library: Download
2. BlynkSimpleEsp8266.h Library: Download
Also before uploading the code make sure to make the following changes in the code. Change the Authenticate ID, WiFi SSID & Password.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
#define BLYNK_PRINT Serial #include <BlynkSimpleEsp8266.h> #define FASTLED_ESP8266_RAW_PIN_ORDER #include "FastLED.h" #define NUM_LEDS1 60 #define LED_TYPE WS2812 #define COLOR_ORDER GRB CRGB leds1[NUM_LEDS1]; char auth[] = "8aZvLCBN36c90JivMOW2btEkBNjQvGOS"; char ssid[] = "Fimo"; char pass[] = "Fimo@!23"; #define PIN1 D1 int data=255; int r,g,b; void setup() { Serial.begin(9600); Blynk.begin(auth, ssid, pass); FastLED.addLeds<LED_TYPE, PIN1, COLOR_ORDER>(leds1, NUM_LEDS1).setCorrection( TypicalLEDStrip ); } BLYNK_WRITE(V3) { r = param[0].asInt(); g = param[1].asInt(); b = param[2].asInt(); static1(r, g, b,data); } void loop() { Blynk.run(); } BLYNK_WRITE(V2) { data = param.asInt(); static1(r, g, b,data); } void static1(int r, int g, int b,int brightness) { FastLED.setBrightness(brightness); for (int i = 0; i < NUM_LEDS1; i++ ) { leds1[i] = CRGB(r, g, b); } FastLED.show(); } |
Controlling Color & brightness of NeoPixels LED strips with Blynk
After uploading the code to the NodeMCU Board using Arduino IDE, you can control the colour and brightness of NeoPixels LED strips from the Blynk mobile app. Some samples images are shown below.
















4 Comments
what does it cost? not enough energy?
Hi Mr. Alam. Is it possible to control these RGBs individually with slider on blynk app. For example select the LED-23 with slider, set its color and hold it then select another LED and set. This might be interesting.
Or use wled .. which is free
Does not work with that specific library – some code has changed – #define PIN1 D1 does not work