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.
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.
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]
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.
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.
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.
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.
Previous article:Basic features of MSP430 microcontroller
Next article:A UAV remote control link implementation based on long code spread spectrum technology
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- If you don’t lose weight in spring, you will regret it in summer. Let me share some tips on how to lose weight and keep in shape!
- [Embedded Linux] RK3399 Android7.1 CPU is overheating
- 【Chuanglong TL570x-EVM】Button control LED light
- TI Automotive SPD-SmartGlass Driver Reference Design
- Start with a simple board
- iwr1642
- How to export Altium's customize settings for backup
- Why is FPGA difficult to learn?
- Why does the DIY capacitor spot welder have no current after spot welding once?
- Tsinghua University successfully developed a brain-computer interface system that can play football with the mind