Design of Queue Management System Based on STC Single Chip Microcomputer

Publisher:polkmmLatest update time:2012-12-20 Source: 现代电子技术 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The queuing problem is a common problem in banks, hospitals, industry and commerce, taxation, telecommunications and other industries. Designing a queue management system that simulates the manual calling process and replaces people's hard work of standing in line through functions such as taking numbers, entering the queue, waiting, and calling services has always been an urgent need for public service departments. However, the structure of mainstream products on the market is mostly based on PCs. This traditional mode occupies the PC only to realize the function of touching the touch screen to take numbers and the system management function that is less frequently used. Its manufacturing cost and development cost are very high, which makes many small and medium-sized industries daunted. In order to overcome this shortcoming, the system in this article uses a powerful and low-cost single-chip microcomputer to achieve comprehensive management and control, and designs and develops a queue management system with small size, simple structure, high reliability, convenient maintenance and operation, and high cost performance. This article introduces the structure and control principle of the queue management system, and focuses on the composition and software and hardware design schemes of the queue system.

1 Queue management system structure and function
The queue management system consists of a main display screen, a voice unit, a printer and a communication module. The specific structure is shown in Figure 1.

a.JPG


The core of the control system is the microcontroller STC89C52 single-chip microcomputer. The P0 port of the host system controls the printer and the voice calling function. Some P1 ports control the display screen and key operations. After the system is powered on, the LCD screen is in the "Hello, welcome" interface. The system counts different business types according to the different number-taking buttons. After the customer presses the number-taking button, the LCD screen will display the business type for the customer to choose. After the customer has made his choice, the system will control the micro-printer to print out the corresponding ticket number, and then return to the main interface. When the slave machine has a number-calling request, the system will control the voice broadcast unit to play the corresponding voice prompt information. At the same time, the LED display screen of the corresponding slave machine displays the customer number to be accepted.
[page]

2 System Hardware Circuit Design
2.1 Display Module Design
The LCD display uses the LCM128645ZK LCD display with Chinese character library produced by Beijing Qingyun Company. It uses a serial interface to transmit data to reduce the use of I/O ports. The connection circuit is shown in Figure 2. The P1_0, P1_1, and P1_2 pins are connected to the E (SCLK), R/W (SID), and RS (CS) pins of LCM128645ZK respectively. In addition, a variable resistor (0-10 kΩ) is connected between the pins "VR" and "V0" to adjust the background color of the display area.

b.JPG


In the module initialization stage, function settings are required. This design sets it as an 8-bit control interface, basic instruction set action, sets it to overall display, clears DDRAM to fill "20H" and sets DDRAM address AC=0, and finally clears the address. Delays 0.5 s to ensure that data can be entered after the module initialization function is completed.
2.2 Printer module design
The printer uses a POS58 line thermal micro printer. It has fast printing speed and strong environmental adaptability. It supports double-width and double-height printing of ANK characters, custom characters, and Chinese characters, as well as printing of different density dot maps and download graphics. It can also adjust the line spacing of characters. This design uses a parallel interface to transmit data, supports the BUSY handshake protocol, and its interface socket is a DB25 pin socket. Data is transmitted through the P0 port to control the micro printer to print, where the /STB end is connected to the /RD end of the microcontroller, and the /BUSY is connected to its INT1 end. When the print function key is pressed and the business type to be printed is selected with the business selection function key, if /BUSY is high, it means the printer is busy and cannot receive data at this time. If the detected signal is low, the data is sent to the P0 port, that is, the data is sent to the data port of the printer, and then the software sets the /STB end to 0, because the /STB end allows data input when it is on the falling edge. After a short delay, /STB is set to 1 again. At this time, the data has been read into the printer, so the corresponding content can be printed out. At the same time, when the printer makes an error, /ERR will be pulled up to a high level by a resistor. In this design, the /ERR port pin is grounded. Similarly, when the /ACK pin is low, it means the printer is ready to receive data, and this port pin is also grounded here. [page]

2.3 Voice module design
ISD1420 is a typical single-chip high-quality short-period voice recording and playback integrated circuit developed by Taiwan Winbond Corporation. It adopts CMOS technology and contains on-chip clock microphone preamplifier automatic gain control, bandpass filter smoothing filter and power amplifier. This design mainly uses the P0 port of STC89C52 to control the A0-A7 pins of the ISD1420 voice chip to realize the segmented recording and playback of voice. Its connection circuit is shown in Figure 3. First, the voice to be broadcast is recorded in segments to the storage address. Press the recording button to start recording. The software controls it to end recording after 0.5 seconds. Press the playback button to check the sound quality. If you press the add address button, the address can be increased by 4, and the address of the recording at this time can be displayed on the LCD screen. In this way, the voice recording can be controlled from this address. Here, since the longest recording time of the ISD1420 voice chip is 20 s, and its minimum resolution is 0.125 s, it can record up to 20/0.125=160 segments of voice. The address unit that can store voice is 00H~7FH, a total of 128 addresses, which shows that one address is enough to store 0.125 s of voice. Because the 19 segments of voice of this bank calling machine are delayed by 0.5 s each, 0.5/0.125=4, it can be seen that it is enough to allocate 4 addresses for each segment of voice with a delay of 0.5 s.

c.JPG


In the main program, when the slave machine's call request is queried, it will call in sequence: "Please ask customer No. **** to go to window No. * to handle it", and after the call is completed, it will wait for the next call request. In this way, the selected segment playback is realized, and the definition of each button is shown in Table 1.

d.JPG


The audio output end of the ISD1420 voice chip, i.e. the SP+ port, is connected to an LM386 amplifier to amplify the sound signal. It drives an 8 Ω, 0.5 W speaker to play sound. It should be noted that the bypass port of the LM386 must be connected to a capacitor and then grounded or left hanging. It cannot be directly grounded, otherwise the speaker cannot make a sound, as shown in Figure 4.
2.4 Serial communication
The system uses a bus-type master-slave structure to achieve multi-machine communication, that is, among several single-chip microcomputers, one is the host and the rest are slaves. The slaves must obey the scheduling and control of the host. This design uses the RS-485 serial standard bus for data transmission. The half-duplex communication MAX485 interface chip is used to convert the TTL level of the single-chip microcomputer to the RS-485 level.
The structure and pins of the MAX485 chip are very simple, and it contains a driver and a receiver inside. RO and D1 are the output of the receiver and the input of the driver respectively, which are connected to the RXD and TXD of the microcontroller; /RE and DE are the enable terminals for receiving and sending respectively. When /RE is logic 0, the device is in the receiving state; when DE is logic 1, the device is in the sending state. Because MAX485 works in half-duplex state, only the P32 pin of the microcontroller is needed to control these two pins; A and B are the differential signal terminals for receiving and sending respectively. When the level of pin A is higher than that of pin B, it means that the data sent is 1; when the level of pin A is lower than that of pin B, it means that the data sent is 0.

[page]

3 System software design
The system software program mainly includes two parts. First, the voice information to be broadcast is stored in the ISD1420 voice chip. In order to ensure the quality of each recording, we combine the LCD screen to write this part of the program, and display the storage address of each recording in decimal form. The pin P2_7 of the single-chip microcomputer controls the /REC pin of the voice chip, and P2_5 controls the /PLAYL key. When the call function button is pressed, the software sets the /REC pin of the voice chip to a low level, that is, recording begins. Similarly, when the playback function button is pressed, the /PLAYL pin of the voice chip is set to a low level to start playback. In addition, when the add address function button is pressed, the software can be used to control the address of the P0 port to add 4. Because the P0 port is connected to the A0~A7 pins of the voice chip, the recording address is also increased by 4 accordingly, and the address is converted into a decimal number and displayed on the LCD screen. According to this method, if a certain sound is not recorded well, the button can be used to control the single-chip microcomputer to return to this address and re-record. After storing the voice segments to be played in the voice chip, the display part, the calling part and the printing part can be integrated in the main program, thus forming a simple queue management system. The program flow chart is shown in Figure 5.

e.JPG



4 Conclusion
Aiming at the noisy, disorderly and inefficient queuing problems in the service industry, this paper designs a queue management system based on the STC89C52 microcontroller, which has the characteristics of low cost and portability. Through welding circuit boards, debugging and preliminary application experiments, it is shown that this system works stably and reliably, can meet the design requirements, and has certain market application potential.

Reference address:Design of Queue Management System Based on STC Single Chip Microcomputer

Previous article:Basic features of MSP430 microcontroller
Next article:A UAV remote control link implementation based on long code spread spectrum technology

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号