Introduction: How to Controls WS2812B Using ESP-01 Arduino (ESP8266)
In this article I will show you how to create a Controller Module for the WS2812B LED. This LED is quite popular because it is easy to use and create. So I don't need to explain more about this LED.
To control the LED WS2812B only one PIN is required from the microcontroller module. so there is no need to use a microcontroller module that has many I/O PINs. For that I will use the ESP-01 as this LED controller.
The ESP-01 doesn't have many I/O PINs so it's perfect for use in this project. In addition, this module is also accompanied by Wi-Fi. So I can use it to control the LED via internet.
Step 1: Component Required
The components used are SMD and some are trough holes. The following are the components required:
Step 2: Schematics and Layouts
This is the basic schematic for using the ESP-01 module. The 10K resistor is used as a Pull UP in some of the PINs for the ESP-01 configuration. There are 2 buttons, namely the reset button and the Flash button which are connected to the GPIO0 PIN. With this button I can change the ESP-01 mode to Programing mode or boot mode.
The 5P Male header is used to program the ESP-01 by connecting it to USB to Serial. 3P Male Header is used for additional PIN if needed
2P T-Block for Power supply. 3P T-Block for WA2812 LED. IC 1117 is used to lower the voltage from 5V to 3V3 to supply the ESP-01
You can see the layout and schematic in the image above. And below you can download the original Schematic and Layout file. You are free to use or change the files that I provide
Step 3: Make PCB Fabrication
To make a nice and neat module. I decided to use PCBway's services to print the PCB. why did I choose PCBway, because By making PCB on PCBway you can get High Quality 10 PCs PCBs for only $ 5 & new member First order Free: www.pcbway.com .
You can see the PCB in the picture above.
to print PCB on PCBWay, all you need is a gerber file from Layout. Below you can download the Gerber file from the layout I made.
Step 4: Inserting Componnet
inserting all components according to the schematic diagram. I suggest inserting the SMD component first. After that, just insert the Troughole Component.
The module that has been inserted can be seen in the image above.
Step 5: Connecting to USB to Serial
Here is the connection between the ESP-01 module with USB to Serial to program it. you can see it in the picture above.
Next plug the USB to Serial into the PC to start the programming process.
Step 6: Programming
Applications used : Arduino IDE
Libraries used :
- Go to "File -> Example -> WS2812FX -> esp8266_webinterface"
- Customize SSID and Password of wifi
<div>#define WIFI_SSID "Yout SSID"</div><div><p>#define WIFI_PASSWORD "Password"</p></div>
custome pin and number of leds
<div><div>#define LED_PIN 2 </div><div>#define LED_COUNT 300 </div></div>
- Go to "tools -> Board -> ESP8266 Board -> Generic ESP8266 Module"
- Go to "tools -> Port -> COM3 (can appear with different numbers)"
- Click Upload and wait for the process to FInish
- After That, open "Serial Monitor" and press the reset button on the module
after that, the IP will appear on the serial monitor. IP values can change depending on the network used. IP usage will be explained in the next stage
Step 7: Demonstration Preparation
Here's how to use this module :
- Remove the Module from USP to Serial
- Connect T-block 2P to Power supply
- and connect T-Block 3P to LED WS2812
for an example of installation can be seen in the image above
Step 8: Demonstration
Here is the demonstration process of this WS2812 Module:
- Open the Browser application on the smartphone
- Write down the IP obtained from the serial monitor
- WEB to control the WS2812B LED will appear
Now the LED can be adjusted as desired. You can change the color, adjust the brightness, adjust the speed mode, and use the modes that have been provided.