Design of a queuing system control system based on RS485 and microcontroller
2026-04-06 08:16:44··#1
Abstract: With the development of computer and network technologies, RS-485 network control systems are applied to queuing control, designing a system that can replace people in queuing and improve their quality of life. This paper details the design of each controller in the queuing machine system, including the hardware circuits and control software design of each functional module. These functional modules and controllers are important components of the queuing machine control system. Keywords: RS485, Single-chip computer, Control system, Queue machine Abstract: With the assistance of computers and networks, we can apply RS-485 in queue control, which can queue for people and improve their quality of life. In this paper, we introduce the design of controllers in the queue system, including the hardware circuit and software, which are important parts of the whole system. Keywords: RS485; Single-chip computer; Control system; Queue machine 1 Introduction Many single-machine control systems have gradually developed towards multi-machine networking, such as data acquisition, fire protection, access control, and consumption control systems. This requires networking these single-machine control systems for mutual communication, evolving from simple centralized control to complex distributed, multi-control terminal forms, resulting in new control forms based on network communication technology. Serial communication, as a simple and inexpensive communication method, is widely used in control engineering, among which the RS-485 bus-type multi-CPU network control system has been promoted and developed. This paper designs a complete queuing system based on RS-485 multi-CPU control, including a main controller (printing queue tickets and assigning queue numbers), sub-controllers (calling numbers and processing transactions at each window), keyboard operation, voice calling, screen display, and an advertising host computer (counting queue numbers and playing advertisements). This system is an RS-485 network system, where each terminal on the network performs its respective function. 2. Main Controller Design Based on cost control and the need for less complex functionality, the main controller can be implemented using a microcontroller. The main controller acts as the host in the RS-485 network, serving as a network server, connecting multiple CPU control nodes on the RS-485 network via a bus to form a complete communication network system. In the design, the core unit of the main controller, the CPU, adopts a new core microprocessor from Winbond, the W77E58, which is compatible with the MCS-51 microcontroller and features dual serial ports. It boasts strong processing power, two full-duplex serial ports eliminating the hassle of expansion and compatibility, and its large on-chip program memory is sufficient for the system's program, eliminating the need for external program memory expansion and saving I/O ports. For queuing information data storage, a 32K battery-operated data memory was chosen to maintain a large amount of data even when power is off. The perpetual calendar clock chip is the powerful and easy-to-use DS12C887, which is very convenient to control and can operate accurately even when power is off. The design diagram of each functional module of the main controller is shown in Figure 1. As can be seen from the figure, in addition to the CPU central unit, the main controller also includes a storage module, a printer control module, a system clock module, a voice module, and two sets of serial ports. The design of each functional module will be described in detail below. Furthermore, as will be mentioned later, the voice module will be separated from the main control board and connected to the RS-485 network as a separate control board. [align=center]Figure 1 Main Control Board Module Design Diagram[/align] 3 Sub-Controller Design The sub-controller is essentially a terminal for interaction with the customer in the system application. Simple and commonly used human-machine interfaces are generally implemented using a keyboard and display screen. This system adopts a design based on a commonly used bank keyboard, consisting of a 16-key keyboard and an LCD segment display module. A communication module is added to interact with the main controller via an RS-485 network, transmitting user input information to the host. After processing by the host, the results are fed back to the sub-controller's LCD display screen, providing the user with sufficient prompts. In the design, the CPU uses the AT89S51; the LCD module uses the LCM061A segment display module from Beijing Qingyun Technology Co., Ltd.; the keyboard uses a typical 4x4 matrix keyboard. Although the simple and easy-to-use keyboard display chip 8279 can perform keyboard scanning and LED segment display functions, due to the limitation of keyboard size, it is necessary to use as few chips as possible to save space. Therefore, the P2 port of the AT89S51 is used as the keyboard interface circuit, and the program scans the keyboard input. As shown in Figure 2, the keyboard sub-controller, in addition to the CPU, also includes a keyboard input module, an LCD display module, and a 485 network communication module. [align=center] Figure 2 Schematic diagram of the sub-CPU controller module[/align] 4 Keyboard Display Module The keyboard display module of this system uses a typical 4x4 matrix keyboard and a segment LCD liquid crystal display module. The LCD liquid crystal display module LCM061A is a 6-bit multi-functional general-purpose 8-segment (8.8.8.8.8.8.) liquid crystal display module, integrating the liquid crystal display and core circuit into one unit. It uses serial control and has only n pins, making it very convenient to connect to a microcontroller. [align=center] Figure 3 Keyboard display interface circuit[/align] The LCM061A LCD display module uses a serial control method. All functions are completed through programming control of the C/S, R/D, /WR, and DATA pins. All control instructions and data are read and written through the DATA data transmission terminal. Functionally, these instructions can be divided into three categories: read display RAM instructions, write control command instructions, and write display data instructions. The LCM061A uses a serial control method, so the required circuitry is very simple. The circuit diagram for the keyboard display circuit is shown in Figure 3. 5. System Clock Module The system clock is a crucial pointer for the entire queuing sequence. It not only displays queuing time information on each queue number but also records the time of different events to achieve various time-related functions, such as statistics on queuing information from the host computer. This system uses the DS12C887 clock chip. 6. Voice Broadcast Module Voice broadcast uses voice to provide prompts via broadcast or speakers. Queuing systems are designed to facilitate users and create a relaxed lifestyle. Voice broadcast prompts offer an intuitive and friendly experience, and users don't need to constantly stare at the display screen or queue status, easily diverting their attention from the complex surrounding environment. Automatic voice broadcasting further liberates staff from this manual labor, becoming a vital component of the queuing system. The ISD2560 is a permanent memory-type voice recording and playback integrated chip with advantages such as power failure resistance, good sound quality, and ease of use. Its most significant feature is its on-chip E2PROM capacity of 480K, resulting in long recording and playback times, up to 60 seconds. Furthermore, the recorded sample values are directly stored in the E2PROM, eliminating the need for A/D and D/A converters. It has 10 address inputs, providing up to 1024 bits of addressing capability, with a maximum of 600 segments. An OVF (overflow) terminal is provided for easy cascading of multiple devices. Its high integration includes a preamplifier, internal clock, timer, sampling clock, filter, automatic gain control, logic control, analog transceiver, and decoder. Figure 4 shows the voice broadcast module circuit. The AT89S51's P2 port connects to the ISD2560's A0-A7 pins. Pin P1.1 is connected to A8 as an address line, and A9 is grounded, always using address mode, allowing addressing from 000h to 1EFh. P1.2 is connected to CE, and P1.3 is connected to P/R; these two pins can be used to control the start and stop of the ISD2560's broadcast/recording. P1.4 connects to the EOM terminal to detect the end of each voice segment. XCLD is grounded, indicating that an external clock is not used. [align=center] Figure 4 Voice Module Interface Circuit[/align] 7 System Control Software Design A complete queuing system operation process is as follows: The host waits for the customer to press the ticket button. After the keyboard scans the pressed key value, it generates a queue number according to the ticket type and reads the current system time, queue status, service type, and other information, and prints it as a queue ticket. At this time, if the operator at a window finishes serving a customer and presses "Next" on the window keyboard, this information will be transmitted to the host. The host, based on the current queue status and service status, responds to the window with the queue number of the nearest customer that can be served in the queue sequence. After receiving the response, the window keyboard immediately updates the display of the queue number to be served. At the same time, the host also sends this queue number to some other slave units: the window LED display screen, so that it also displays the latest queue number; the voice broadcast slave unit, so that it broadcasts the queue number to remind the customer to come for service; and the host PC video queuing software, so that it displays and broadcasts the current queue number in a multimedia manner. In addition to these functions, the system can also perform various other functions using these modules. For example, it has a keyboard with administrator privileges, which can be used to configure system settings such as password, system time, and business type. It can also handle special situations, such as prioritizing urgent customers, handling customers who haven't heard their numbers called, or temporarily leaving the window. Therefore, the keyboard needs to provide functions like "priority," "recall," and "pause." These functions are basically achieved through the invocation of various functional modules and the operation of the queuing queue. The queuing queue is stored on the main controller, and its operation is performed through the main controller. The system has generated nearly 100,000 yuan in economic benefits after its implementation. The data mainly comes from experiments, and the development adopted a research method combining theoretical and experimental verification. The author's innovations: This paper introduces the design of the main and sub-controllers and provides a detailed description of the development of each functional module. The system clock, voice broadcast, keyboard display, and LED display are all indispensable functional modules, and their coordinated control enables the local CPU network control system to operate smoothly and efficiently. The entire paper introduces all the components of the queuing machine system. References: [1] Fan Hui. Comparison of RS-485 bus and CAN bus applications [J]. Journal of Shanghai Dianji University, 2005.8(5):54-56 [2] Wang Tianyi, Yang Jianzhong. Application of a new RS-485 interface chip in remote multi-machine communication [J]. Instrumentation Standardization and Metrology, 2004(5):35-40 [3] Wei An, Liu Guoping. Research and development of industrial real-time TCP/IP protocol stack [J]. Control Engineering, 2005.12(4):389-392 [4] Shi Yanhui, Gao Meng, Li Tuoxin. Application of RS485 bus in intelligent power supply system [J]. Microcomputer Information, 2007, 5-2:79-80