How to Controls WS2812B Using ESP-01 Arduino (ESP8266)

by MrSottong in Circuits > Arduino

11682 Views, 16 Favorites, 0 Comments

How to Controls WS2812B Using ESP-01 Arduino (ESP8266)

photo_2021-06-29_06-49-59.jpg

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.

Component Required

Snapshot_51.png
Snapshot_52.png
Snapshot_53.png
Snapshot_54.png
Snapshot_55.png
Snapshot_56.png
Snapshot_57.png

The components used are SMD and some are trough holes. The following are the components required:

Schematics and Layouts

Skema.png
Layout.png

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

Make PCB Fabrication

Snapshot_30.png
Snapshot_58.png
Snapshot_59.png

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.

Downloads

Inserting Componnet

Snapshot_60.png
Snapshot_61.png
Snapshot_62.png
Snapshot_63.png
Snapshot_64.png

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.

Connecting to USB to Serial

Snapshot_65.png
Snapshot_66.png
Snapshot_48.png

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.

Programming

image_2021-06-29_064455.png

Applications used : Arduino IDE

Libraries used :

Steps :

  • 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

Demonstration Preparation

Snapshot_67.png

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

Demonstration

Snapshot_68.png
Snapshot_69.png
Snapshot_70.png

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.