#define NUM_LEDS1 6 //Enter number of LEDs #include "FastLED.h" //Include this Library CircuitSchools // ESP8266 Alexa Controlled RGB Smart Bulb Next copy the below code and paste it in IDE workspace change the WiFi credentials and press upload button. Choose the correct port and board as Node MCU V1 from Tools menu and install the required libraries from the Library manager of download from the below links and extract them in Arduino Libraries folder. For safely don’t connect the AC power supply while uploading the code. Program code:Ĭonnect the NodeMCU to the PC where Arduino IDE is installed through USB cable. A resistor of 330 ohms is connected between data pin to protect the LED strip first LED from voltage fluctuations which may cause damage to it. Din pin of LED strip is connected to digital pin D3 of Node MCU. +5v and GND pins of LED strip are connected to +ve and -ve pins of Converter supply respectively. VIN and GND pins of Node MCU are connected to +ve and -ve pins of Converter supply respectively. So choose a minimum of 5v 0.5A converter for better stability. If its not available you can also use any mobile charger circuit to power it.Īs we are using only 6 LEDs Strip, each LED consumes 50mA at maximum brightness so 6 consumes nearly 300mA you can choose the number of LEDs according to the requirement. To reduce the space and cost you can also use D1 mini microcontroller instead of Node MCU.Īs you can see from the above image we powered Node MCU and LED strip from the HiLink 100-240v AC supply to 5V DC converter. The data flows from the starting to the ending LEDs, make sure to connect the data pin from the microcontroller from the beginning arrow printed on the LED strip.įor more details about Neopixel LEDs refer : How NeoPixel LED works in detail Circuit Diagram:Ĭonnect all the required components according to the below circuit diagram. Every LED has a chip which stores the data of the color which it has to show and the data of the next LEDs. Product NameĪs you see from the above pinout diagram the WS2812b LED strip has 3 pins, 2 pins for power supply 5v and GND and the middle pin is for data. Required components: Here are the required components along with Amazon buying links at best prices. Fixing the LED strip and components into bulb:.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |