Get to Know WS2812b
标签:DIY
LUCY 发布于 2018-01-20 12:17
WS2812b is a kind of LED bead that I like most. It does not like common LED that needs IO control to every LED bead, nor like RGB LED that needs three pins to realize colorful display. The biggest characteristic of WS2812b is that it can realize cascade connection. With an IO port only, you can control the color of all LED bead. Today, I am going to talk about the reason why WS2812b has this amazing function.
WS2812b is an intelligent external control LED source, which has integrated control circuit and light-emitting circuit. It has same appearance with 5050 bead and every component is a pixel. Picture below is for single LED bead. It has four pins.
Here is the pin definition:
The following diagram is for the typical circuit application of WS2812b cascade connection:
With this cascade connection, we can make light strips, light rings, or even matrix screens.
If you want to buy ws2812b light strip, just click here.
With a signal cable only, we can control LED light strip. On the cable, there are three signals: logic 0, logic 1 and RET code. And their corresponding temporal waveforms are showed in the following picture.
In a low voltage level of reset impulse(maintain at least 50us), all color data send out one by one from controller with 24-bit binary number. Among the 24-bit numbers, every color has 8-bit (i.e. 256 grade brightness). According to the sequence, it is green, red, and blue separately.
Every transmission of single bead data, WS2812b chip will transmit all data except its own color data to the next LED bead. Here's the schematic diagram:
Note: D1 stands for data come from MCU. D2, D3, D4 stand for cascade circuit auto-transformed forwarding data.
If you still feel very complicated, you can try to understand it in this way: Imagine the situation of a teacher dispatches books in class. The teacher is the source of signal (i.e. IO port of controller) and every student is a single bead. The teacher gives a stack of books to the first student. After the first student gets his book, he will hand over the rest books to the second student behind him. After the second student gets his book, he will pass on the rest books to the third student. Then the rest students repeat this movement until all student get their books.
Based on this principle, we can use an IO port to transmit the color data of all LED bead on the LED light strip.
These working principles are helpful for you to understand how WS2812b works. However, in practical usage, it is not that complex. Because Arduino and Micro:bit have 18.5mA, and the current of a single bead is about 55.5mA(18.5*3). If the quantity of LED bead in cascade connection, then we have to connect an outer power source, or it will lead to abnormal color display.
Elecfreaks' WS2812b product recommends:
Flexible Rainbow 64 RGB 8*8 LED Matrix
Relative Readings:
Light the First Bead on 8*8 Rainbow Matrix with Arduino
https://www.elecfreaks.com/10455.html
在淘宝中搜索“恩孚电子”,你可以以最优惠的价格购买到英国原装正版micro:bit哦!
如果想联系我们,请发邮件至:louise@elecfreaks.com 。
作者的最新作品
-
按钮
2018-05-31 17:05发布
-
用micro:bit让面包板上的两颗LED交替闪烁
2018-05-31 17:01发布
-
抛煎饼游戏
2018-05-18 18:33发布
-
micro:bit跑迷宫游戏
2018-05-18 18:29发布
-
速算游戏
2018-05-18 18:25发布
阅读数: 3981