This article documented the process of controlling the WS2812B_RGB lamp using the STONE display module.
RGB lamp is a kind of lamp that we often see in our daily life. It is widely used, such as city night scene, light show, indoor lighting, auxiliary lighting, advertising module lighting, luminous word, counter lighting, shopping mall lighting, jewelry display case lighting, etc.
This project is to achieve RGB lamp control by STONE display module:
Control the color of the light
Control the brightness of the light
Control the four modes of the lamp
STONE control TFT-LCD display module
The STONE STVC070WT-01 is a 7-inch display module with a resolution of 800*480. This display module can be purchased from the official website of STONE. The communication mode is uart-rs232 and uart-ttl. The development method is very simple, MCU only needs to send instructions to the STONE display module to control the display content through UART. In the same principle, when the user touches the STONE display module, the display module also sends relevant instructions to MCU through UART, and MCU then controls the device (WS2812B_RGB lamp in this project).
7 inches STONE STVC070WT-01
The following picture shows the package and accessories I received:
Connection and interface
USB to TTL adapter plate
USB flash drive (including development information)
Micro USB cable
USB transfer board
STONE STVC070WT-01 display module
12V power adapter
The function of the STONE control display module
STVC070WT-01 is a TFT display and touch controller.It includes a processor, control program, driver, flash memory, RS232/RS485/TTL port, touch screen, power supply, etc. It is a powerful display system
The operating system is simple and can be controlled by any single-chip microcomputer.
STVC070WT-01 can be used to perform all basic functions, such as text display, image display, curve display, touch function, video and audio function, etc.
built-in Cortex CPU and driver
can be controlled by any single-chip microcomputer
65536 color TFT display
can be touched
RS232/ RS485/ TTL UART interface and USB port
wide voltage range
How the STONE TFT-LCD control display works
The TFT-LCD module communicates with the customer’s MCU through commands (hexadecimal code), and the MCU then controls the connected device to work according to the commands received.
The development steps for the STONE control display module
Use STONE’s TFT-LCD module in only 3 steps:
Design a beautiful set of graphical user interfaces.
Connect directly to the client’s MCU via RS232, RS485, or TTL.
Write a simple program, by the MCU command control TFT-LCD module. (hex).
TFT LCD module serial command frame consists of 5 data blocks, all serial commands or data are expressed in hexadecimal format. Data transfer in MSB mode. For example, for 0x1234, first send 0x12, then 0x34.
Application scenarios of the STONE TFT-LCD control display module
The STONE control display module is widely used in various industrial fields, such as Medical beauty equipment, construction machinery, and vehicle equipment, electronic instruments, industrial control system, power industry, civil electronic equipment, automation equipment, transportation.
UI image design for STONE control TFT-LCD
The interface designed by using Photoshop is as follows:
The first picture is the main screen picture, and the second picture is the effect when the button is pressed.
Use STONE TOOL box to generate LCD module configuration files
Click the button indicated by the arrow to generate the configuration file, and then download the configuration file into the display module to display the UI interface we designed.
Wiring and welding
Having completed the touch display control above, we can focus on the development of MCU and WS2812B_RGB lamps.
But before that, we need to do some welding.
The power adapter is 12V, which needs to power the STONE STVC070WT-01 display module and to power the MCU module and WS2812B_RGB lamp by lowering the voltage to 5v through the dc-dc buck.
Accessories used in the project
Main accessories are
Dc-dc buck module
Since the communication mode of STONE STVC070WT-01 is uart-TTL by default, we do not need the RS232 interface for the connection. Remove the RS232 interface:
Weld these parts together and the effect is as follows:
There are 3 interfaces, as shown above.
When this part is ready, you can program the MCU. But before we do that, we need to determine how the WS2812B_RGB lamp will be driven.
WS2812B is actually an RGB driver chip. The control circuit and RGB chip are integrated into a 5050 package of components to form a complete pixel point. Built-in signal shaping circuit, any pixel received the signal after waveform shaping output, to ensure that the waveform distortion of the circuit accumulation. Built-in power-on reset and power off reset circuit. The color of each pixel can achieve 256 levels of brightness display, complete the full-color display of 16777216 colors, Serial interface, can complete data reception and decoding through a signal line. The transmission distance between any two points is no more than 5 meters without any additional circuit. When the refresh rate is 30 frames/SEC, the cascade number of low-speed mode should be no less than 512 points, and that of high-speed mode should be no less than 1024 points. Data transmission speed up to 8Kbps.The color of the light is highly consistent and cost-effective.
DOUT: Data output, control data signal output
DIN: Data input, control data signal input
VCC: Logic power supply, control circuit power supply
VDD: Power supply, LED power supply
LED full-color light string, LED full-color module, LED full-color soft light bar hard light bar, LED guardrail tube, LED point light source, LED pixel screen, LED special-shaped screen, various electronic products, electrical equipment running horse light.
Driver for WS2812
The driving mode of WS2812 is simple. MCU only needs a signal line to complete the brightness and color control.
STM32 driver code
There are many materials and development documents about this chip on the Internet. Here is a brief introduction of this chip.
This is the development board of STM32F103C8T6, the purchase link:
I’m not going to say much about this chip. The chip download code is j-link, as shown below:
This is a simple version of j-link, only supporting SWD mode debugging and download, not supporting JTAG. But for the development of the STM32 chip, SWD debugging method is enough.
Download the code to the STM32 chip.
Ensure the correct wiring of j-link and STM32F103C8T6, and then the chip can be identified in the KEIL development environment:
Click the download button to download the code to the chip:
The buttons and text in the display screen have corresponding addresses. In this project, the addresses of the display screen components are as follows:
Finally, the code is downloaded into the STM32 chip, and the completed circuit board is connected to the control display screen, and the power supply is guaranteed to be stable. Then the brightness and color of the RGB lamp can be controlled by the STONE control display module.
The final hardware connection diagram
STONE HMI+BC1110 Bluetooth Transparent Transmission Mobile Phone Display Synchronously
STONE Touch Screen+ ESP32 for Massage Chair
STONE STVC070WT-01 HMI Screen+Arduino+Musical Metronome
Raspberry PI Pico and STONE Display Dazzling Light Control System
Automotive Car LCD Screen Project Solutions
Ultrasonic module test with STONE LCD module
STONE TFT LCD Module STM32 Service Robot Motion Status Monitoring
By Customer : STONE Intelligent TFT Touch Display Beginners Guide
STONE TFT LCD + ESP32 +Medical Ventilator
Fingerprint Identification with STM32 MCU and Serial TFT LCD Module