Abstract: In view of the widespread application of LED dot matrix display screens and the advantage of GPRS network nationwide coverage, a wireless LED display screen control system solution based on GPRS technology is proposed. The system structure, software and hardware design process and communication protocol formulation of the control system are introduced in detail. This design has obvious advantages when multiple LED display screens are networked and controlled, and the LED screens are distributed over a wide range. It can broaden the application field of LED display screens and has certain application value.
0 Introduction
With the development and improvement of LED technology, large-scale LED display screens have been widely used in various public places to display multimedia information such as text, graphics, video images, etc. In the construction of urban information modernization, LED display screens have become one of the important media for modern information dissemination. With the rapid increase in the number of outdoor LED screens and the expansion of their scope of use, new requirements have been put forward for the management and control of LED display screens.
1 System Working Principle
This system is mainly composed of a host computer and a slave computer. The host computer is a device that is installed with LED screen management software and can connect to the Internet or GPRS network, such as a PC, mobile device, etc. The slave computer is a LED screen wireless controller based on an AVR microcontroller control module. The system topology is shown in Figure 1.
The system mainly uses the GPRS module as a wireless modem to realize the dial-up Internet access of the LED display wireless controller (as the client), and conducts TCP wireless communication with the host computer on the Internet (as the server) to realize data transmission and complete the wireless data update of the LED screen.
2 Lower Computer Hardware Design
As shown in Figure 2, the LED screen wireless controller is mainly composed of four parts: power module, GPRS module, AVR microcontroller control module, and LED display screen.
2.1 AVR MCU Control Module
In order to ensure the real-time and efficiency of communication data and drive the LED display at the same time, the MCU used in this module is ATMEL's ATmega162 with dual serial ports. It is an 8-bit low-power CMOS microcontroller based on AVRRISC. It has very high stability and reliability, can adapt to various environments, and is suitable for various wireless LED display environments.
This module mainly processes the information received by the GPRS module, and transmits the received screen information to the LED screen. At the same time, it sends AT commands through the serial port to monitor whether the GPRS module has new messages. Once there is, it immediately enters the serial port interrupt and processes the data. Under the TCP/IP protocol, the data is transmitted in hexadecimal format, and there is no need to decode Chinese characters, which greatly simplifies the design of the system's peripheral circuits.
2.2 GPRS module circuit
The GPRS module uses SIM300 from SIMCOM. This module is compact and has outstanding performance. It can be widely used in wireless voice transmission, vehicle-mounted systems, remote meter reading, security monitoring, remote control and telemetry, handheld devices and other fields.
The SIM300 module has a fully functional system interface, with an internally integrated TCP/IP protocol stack and expanded TCP/IP AT commands, and can interactively operate the AT commands provided by the serial port. This can reduce the difficulty of development, facilitate data transmission, and has low costs and good system scalability.
SIM300 needs an external SIM card holder, whose serial port is connected to the serial port of the microcontroller, to transmit the information received by the GPRS module to the microcontroller for data processing. The AVR microcontroller controls the switch of the SIM300 module. The connection diagram of the AVR microcontroller and the SIM300 module is shown in Figure 3.
2.3 LED screen drive circuit
The LED strip screen of this system uses the classic 74HC595 as the column driver of the dot matrix output and ULN2803 as the row driver. The drive circuit design of this solution is simple in software and hardware design, and has low power consumption, strong driving ability, and fewer occupied I/O port lines. It is a low-cost and flexible design solution.
3 Communication Protocol Design
Since this system uses the GPRS network communication mode, the host computer sets up an LED controller management platform to manage all LED controllers. This LED controller management platform (i.e., "host computer software") communicates with the LED screen wireless controller through the TCP/IP protocol, and can control multiple units at the same time. The host computer software and the LED screen wireless controller are connected using GPRS, and the connection relationship between them is shown in Figure 4.
The LED screen wireless controller is the client, and its data transmission and reception is controlled by the host computer software. When the LED screen controller is powered on, it will actively establish a connection with the host computer software and shake hands. After successful login, the host computer software and the LED controller can transmit data.
The communication protocol between the host computer software and each LED screen wireless controller is based on the TCP protocol, and a custom STCP protocol layer is used to encapsulate the PDU (data unit) data layer protocol. The STCP protocol layer only provides a safe and reliable transmission process for the PDU's carrying framework. The communication network layer structure diagram is shown in Figure 5.
Figure 5 Communication network layer structure diagram
In the custom STCP communication protocol, a series of communication instructions for managing the wireless LED display controller are formulated, mainly to provide specific communication structure and specifications for the programming of the host computer software. The communication packet format is shown in Table 1:
Table 1 Communication packet format
Note:
Complete data length: Integer byte (4 bytes in length), the length of the entire communication packet;
Command word: According to the wireless LED display controller communication instruction table, see Table 2;
Explicit control word: 0-none; 1-up; 2-down; 3-left; 4-right; 5-still; 6-flash; 7-delete;
Data content: information content that needs to be displayed;
Checksum: Cumulative checksum of all data;
According to the actual application needs of the wireless LED display screen controller, the send, delete, display, connect, and disconnect instructions are formulated. The codes and main functions of these instructions are shown in Table 2.
Table 2 Communication command table
After the host computer software sends data to the wireless LED display controller through the Internet, the LED display controller needs to process the received data. According to different instructions, the display content and display mode of the LED display can be controlled (such as up, down, left, right, still, flashing, delete, etc.).
4 Software Design
The software design of this system consists of two parts: the host computer software and the control program of the AVR microcontroller. The host computer software completes the communication with the GPRS module and controls the data information displayed on the LED display screen; the control software of the AVR microcontroller mainly completes the system initialization, GPRS network connection, receives the information sent by the host computer, analyzes the content of the received information, completes the instructions, and converts the published information into dot matrix information as needed, and sends it to the LED display screen for display.
4.1 AVR MCU control program
The control program of AVR microcontroller mainly completes the following functions: connecting to GPRS network, data transmission, and controlling LED screen display.
(1) Initialize the system and SIM300 module and connect to the GPRS network; (2) According to the communication protocol between the display controller and the host computer, communicate and shake hands with the host computer, receive instructions, parse instructions, and store and process information such as display data; (3) Drive the LED screen through the serial port to display information, etc.
The following is a brief introduction to the TCP/IP wireless communication process between the SIM300 module and the host computer.
AT+CGDCONT=1,"IP","CMNET" --Register China Mobile network
OK
AT+CGCLASS? --Display the type of GPRS information mobile
+CGCLASS: "B"
OK
AT+CGATT? --GPRS service attachment/detachment
+CGATT: 1
OK
AT+CGACT=1,1 --Environment activation
OK
AT +CIPSTART = "TCP","202.196.87.7","2020" -- Start
TCP connection (host computer IP address and port number)
OK
CONNECT OK --Connection successful
AT+CIPSEND --Send data via TCP
> HELLO
SEND OK -- sent successfully
4.2 Host computer software
The host computer software of this system mainly uses VC to design a communication interface to realize communication with the LED remote controller. The user interface part is implemented based on Dialog using the MFC framework. When using Visual C++ to develop data transmission through the TCP/IP protocol network, the IOCP framework is used to implement the completion port model of Windows Socket.
IOCP, or I/O Completion Port, is an asynchronous I/O API that can efficiently notify applications of I/O events. After a socket is created, it is associated with a completion port. When an event occurs, the completion port will be added to a queue by the operating system, and then the application can query the core layer to obtain the completion port. Once an I/O operation is completed, a worker thread that can process the result of the operation will receive a notification. Create a certain number of worker threads in this application to handle notifications of overlapping I/O requests.
The startup process of the IOCP framework is shown in Figure 6.
The implementation steps of the IOCP framework are as follows:
(1) Initialize the Winsock working environment, create a completion port, create a completion port thread, establish a listening socket, and associate the socket with the completion port;
(2) The listening socket starts working. When the listening socket receives a connection request from the client TCP, IOCP obtains and processes the message, creates a corresponding Socket object for receiving and processing, and completes the connection work;
(3) After the client completes the TCP connection, data communication can begin. The I/O thread is responsible for distributing I/O requests and allocating the logical processing environment through the thread pool.
(4) After receiving the data, an I/O data structure (WSAOVERLAPPED) provided by Microsoft is expanded to complete protocol parsing and data processing.
In addition, the thread pool here is just a management queue, which is used to manage thread resources and complete the processing of maximum business logic with the least number of threads. The actual executed thread function does not complete the detailed business processing, but only completes the re-call of I/O requests, and the re-processing of I/O requests is realized by virtual functions.
In order to improve the friendliness of the software, the framework uses the Windows message mechanism to interact with the UI and pass the relevant information of the framework to the UI window through window messages. Therefore, a pointer member is reserved in the framework, and when necessary, the message response function is called through the pointer to send a message to the window, and the UI reflects the running information of the framework according to the message.
5 Conclusion
According to the development trend of GSM/GPRS data communication technology in recent years, this paper proposes a design scheme of wireless LED screen controller based on GPRS network and using low-cost SIM300 module. The system uses TCP/IP protocol to realize the transmission of wireless data based on GPRS network. The host computer transmits text or picture information data to the remote LED screen terminal through GPRS network, and can also receive data sent by the client, and then complete various commands according to the content of the data to control the LED screen to display the corresponding information. The system design has achieved good results after testing.
Previous article:SD storage technology and its application based on S3C2410
Next article:Research on solar photovoltaic power generation system based on network technology
- Popular Resources
- Popular amplifiers
- Mir T527 series core board, high-performance vehicle video surveillance, departmental standard all-in-one solution
- Akamai Expands Control Over Media Platforms with New Video Workflow Capabilities
- Tsinghua Unigroup launches the world's first open architecture security chip E450R, which has obtained the National Security Level 2 Certification
- Pickering exhibits a variety of modular signal switches and simulation solutions at the Defense Electronics Show
- Parker Hannifin Launches Service Master COMPACT Measuring Device for Field Monitoring and Diagnostics
- Connection and distance: A new trend in security cameras - Wi-Fi HaLow brings longer transmission distance and lower power consumption
- Smartway made a strong appearance at the 2023 CPSE Expo with a number of blockbuster products
- Dual-wheel drive, Intellifusion launches 12TOPS edge vision SoC
- Toyota receives Japanese administrative guidance due to information leakage case involving 2.41 million pieces of user data
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- SinlinxA33 Set up qt program to start automatically
- Several considerations for selecting a thermometer
- Which one has faster sampling speed, ADS1220 or AD7799?
- 2005 National Undergraduate Electronic Design Competition Topic
- EEWORLD University----[High Precision Laboratory] Interface: HDMI
- How to Make DSP Digital Oscillator Generate Phase-Shifted Sine Wave
- WIFI 6 is coming, do you know about it?
- Discuss one of the STM32H750
- Book an appointment to win a gift: Book an appointment for the live broadcast of power integrity design of ideal power distribution network, gain knowledge and win a Keysight gift
- The first article GD32VF103C START development board unboxing running lights