Whether you agree or not with the "RGB performance increased by 300%", it is undeniable that the bright colors are very cool. It has become a consensus among merchants on the market that products with "lights" are definitely more expensive than those without "lights".
On the market, there is a kind of RGB LED lamp bead. It is cheap, only a few cents each, and if you buy more, the price may be as low as 1 cent each. It does not require an additional "huge" control circuit to drive it. With various cheap microcontrollers and simple components, a single IO interface can be connected in series to allow hundreds or thousands of lamp beads to emit colors independently. It has low power consumption and a good refresh rate, which is highly recommended by DIY players.
This is the WS2812 series, which is an "intelligent externally controlled LED light source that integrates control circuit and light-emitting circuit."
So how is it implemented? There are many related documents and source codes, but the actual control method is still unclear. This article takes WS2812B-4 as an example. It is the mini version of WS2812. Its performance is not as fast as the standard 6-pin one, but it is small in size and has good performance, and can make the dot pitch smaller.
Let us understand it, and then we will know why we need to use the LOTO oscilloscope to clearly analyze how it is controlled by the microcontroller and emits brilliant colors.
Let's take a look at the official documentation first~
A brief introduction to time units will be provided to facilitate the explanation later.
ms is millisecond = 0.001 second us is microsecond = 0.000,001 second ns is nanosecond = 0.000,000,001 second
Now let's start the main text. To summarize, if you want to make a WS2812B-4 LED light up in the fastest possible way, it takes 1960ns (1 bit) * 24 (8 bits for each of the three colors of red, green and blue) + 280us = 47040ns (47.04us) + 280us = 327.04us.
That is, a single WS2812B-4 LED can change colors 3 times per millisecond, or about 3,000 times per second, without considering afterglow.
After that, each expansion of WS2812B-4 LED requires an additional 47.04us of color data, so 60 refreshes per second require 16.66ms = 16,666us – 280us = 16,386us /47.04us = 348 LEDs.
This number of series connections allows us to easily complete the desired design when designing a small DIY RGB light source. This is why WS2812 is highly recommended.
But such a fast speed makes it difficult for us to see how it works. It is absolutely impossible to see the actual situation with a multimeter, because it is too fast and the voltage appears to be 0. So how can we see how the LED is driven by the circuit? We can only use an oscilloscope.
Professional oscilloscopes are very expensive, with many costing tens of thousands, hundreds of thousands, or even millions. These prices are hard for us DIY players to afford. After all, money is hard to earn, and second-, third-, or fourth-hand ones don’t save money and may even result in failure.
Here comes the protagonist of this article, the LOTO oscilloscope. With it, we can get the analysis results of a professional oscilloscope on the computer at a cost of only a few hundred yuan. Of course, you get what you pay for. The bandwidth and sampling are comparable to the price, but general DIY does not require such a professional one. Therefore, LOTO allows you to easily understand and learn circuit principles in daily scenarios without spending a lot of money. It is really worth the money.
As shown in the picture, this perf board uses an STC8G microcontroller and one IO port to drive two WS2812B-4s, making the first one emit green and the second one emit red, and they have a breathing and flashing effect, but you can't see it in the picture.
Because it is a 5V high-level circuit, you need to use a 10X probe. Let's use the 1ms time domain to look at it first. There is only a small spike. The 9600bps communication in 1ms is very clear. Now when I look at the us level, I can only see such a spike. I can only say, it is really fast.
Switching to the 0.1ms gear, we can see continuous ripples, but they are still too dense. We can see that the blue channel A is twice as long as the yellow channel B. This is the 1 group of 24-bit ripples that LED1 forwards to LED2 after receiving 2 groups of 24 bits.
0.1ms is still too "slow", let's go to 10us, which is 0.000,010 seconds. Because it is too fast, triggering is used here to intercept the high level. Otherwise, it is not easy to find the waveform if it flashes too fast. You can see the obvious waveform, but it is still unclear, so let's continue.
1us mode, now you can see the waveform clearly. How about the voltage change of 0.000,001 seconds clearly displayed to you?
You may wonder why the waveform is not flat? Is there something wrong with the oscilloscope? Let's try the oscilloscope first to see if it is the problem. Most oscilloscopes have a standard square wave generation function to facilitate our calibration.
Look at the picture below. This is a standard square wave of 1000 Hz. Hmm, it is very flat, which proves that the oscilloscope is fine. That is, the output of STC8G is the waveform shown in the above picture.
We continue and add labels. We can see that the first high level is 0.323us. This is the waveform representation of the first color of the 8-bit binary color of the high level sent by our microcontroller. 00011101 is the green value of our first light.
Let's zoom out a little and look at all the waveforms. The first group of the first 8 waveforms is green G, the second group is red R, and the third group is blue B.
Then let's take a look at the waveform forwarded by the first WS2812 to the second one. It can be seen that only 150ns have passed before the second WS2812 has received the forwarded waveform signal! It's really fast.
The above is our analysis of the waveform of WS2812B-4 using LOTO virtual oscilloscope. If there is no oscilloscope, you can only blindly adjust the frequency in the microcontroller to adapt the data of WS2812. With LOTO oscilloscope, it is much more convenient. I wonder if you feel the convenience of oscilloscope.
Previous article:How to self-check oscilloscope failure
Next article:Keysight/Agilent MSO9104A oscilloscope maintenance and startup abnormality case
- Popular Resources
- Popular amplifiers
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- Modern manufacturing strategies drive continuous improvement in ICT online testing
- Methods for Correlation of Contact and Non-Contact Measurements
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- EEWORLD University----Live Replay: Security Series 19 - Wireless Charging Authentication in Compliance with the Wireless Charging Consortium WPC
- Help DDS chip (AD9833) cannot output waveform
- Try the flexible ink screen
- The rated capacity of a CR17450 battery is 2300mAh. What does this 2300mAh mean?
- The Secret of Overcurrent/Overvoltage Protection for Sensitive Circuits
- What does a 5G base station look like? This article will help you find out!
- Help! Is there a suitable sensor?
- [TI recommended course] TI development board to realize intelligent servo
- 3 UCOS time management
- Design of intelligent robot for home medical care based on Bluetooth and DSP