Design of a Portable Weighing Voice Quotation System Based on Single Chip Microcomputer

: At present, most of the weighing systems also adopted the traditional mechanical weighing method, which did not have the function of voice broadcasting, low level of intelligence and poor interaction ability. Aiming at the difficulty of operation and poor interaction ability of traditional mechanical weighing system, a portable weighing voice quotation system based on single-chip microcomputer was proposed in this paper. AT89C51 single-chip microcomputer was used as the control core in the system, and HX711 weighing module and APR9600 voice control module were combined to realize real-time weighing, online display, unit price and quantity input, and voice quotation functions. The HX711 weighing module was adopt to realize real-time collection of weighing data, which was sent to AT89C51 single-chip microcomputer for processing after internal A/D conversion. A liquid crystal display was used to display the weighted data and the unit price, quantity and total price, and at the same time the APR9600 voice control module was driven for real-time voice broadcast. We had conducted a comprehensive test of the system. Experimental results showed that the system could realize the following functions, such as unit price input, weighing measurement, calculation, display, and voice broadcast functions. The system ran stably, cost-effectively, and could achieve the expected goals.


Introduction
Aiming at the troublesome operation and the poor intelligence of traditional weighing system, a single-chip microcomputer was used as control core, and the voice quotation was realized in this paper. The intelligent voice broadcast function had been a current hot topic [1][2][3][4][5][6][7][8][9]. The application of voice functions was becoming more and more widespread [10][11][12][13][14][15]. Voice functions was used on escalators and achieved good results by Luo Qingping of Qingdao Metro Group Co., Ltd [5]; And voice functions was used for obstacle avoidance of intelligent car and had also achieved good results by Wang Yu of Xi'an Aeronautical Institute and others [7].
This portable weighing voice quotation system used the APR9600 voice recording and playback module as the control object to realize the voice recording and playback function. The APR9600 voice recording and playback chip was another model that adopted analog storage technology after the American ISD company. It had good sound quality, low noise, and was not afraid of power failure. And it was a new type of voice circuit that could be repeatedly recorded and played. The single-chip circuit could record and play for 32 to 60 seconds. It could be divided into more than 256 segments for serial control, and up to 8 segments for parallel control. Its price was three to a quarter of that of similar ISD voice chips. Compared with similar ISD chips, it had many advantages, such as low price, multiple manual control methods, convenient segment management, simple circuit in multi-segment control, adjustable sampling speed and recording and playback time. This system adopted serial control mode, which was flexible in control.

Overall System Design
This system was mainly composed of keyboard acquisition module, weighing module, liquid crystal display module, data processing module and voice broadcast module. First, the user entered the product code through the keyboard acquisition module and collected weighing information. The single-chip microcomputer obtained price information according to the product code and displayed the information on the liquid crystal display module, and then started voice quotation. The specific design block diagram was showed as figure 1.

System Hardware Design
The hardware part of the system mainly included keyboard acquisition module, liquid crystal display module, weighing module and voice control module.

APR9600 Chip Pin Introduction
APR9600 voice control module had 28 pins in total, and the specific pins and functions were shown in Table 1.

The Control Mode Introduction of APR9600 Chip
APR9600 had a variety of control modes, generally divided into serial control and parallel control, realized by the settings of the chips MSEL1 (24-pin), MSEL2 (25-pin), and /M8 (9-pin).
The working mode setting function table was shown in Table 2.

Voice Control Circuit
The voice control module adopted serial control mode, and the 24 and 25 pins were grounded. The concrete circuit design was shown as in Figure 2.

Design of Weighing Control Module
The weighing part adopted a resistance strain gauge, which was composed of a varistor and an acrylic plate. For the data acquisition module, this article used the HX711 module, which was a high-precision load cell with a 24-bit A/D converter. HX711 collected the analog quantity of weighing information through INA+ and INA-, and transformed it into a digital quantity through the internal 24-bit A/D conversion module, and then transmited this digital quantity to the AT89C51 single-chip microcomputer through the digital interface.

System Main Flow Chart
The system software was mainly completed in assembly language, and the main flow chart of the system was shown as Figure 3. After the system was initialized, the system started to query the collection keyboard. If a key was pressed, it entered the key value processing program after delaying the jitter, and returned to the main program after processing. If no key was pressed, it entered the weighing information collection. The unit price and purchase quantity were processed for data and sent to the LCD display. At the same time, the voice quotation function was activated. After the completion, the keyboard would continue to be collected, and the cycle would continue.

Part of the Program Design of the Voice Broadcast
The voice control of this system adopted serial mode. Fewer keys were used for voice broadcast in the system. And the system was convenient and flexible. When recording, MSEL1 (pin 24) and MSEL2 (pin 25) would be connected to ground respectively, and /M8 (pin 9) would be connectted to the power supply +5V, and RE would be set to low level and selected to the recording state. Recording can be done manually. After the recording was completed, RE would be set to high level to the playback state. MSEL1 (pin 24) and MSEL2 (pin 25) were grounded respectively, and /M8 (pin 9) was grounded. M1 (connected to P2.0 of the single-chip microcomputer) and M2 (connected to the P2.1 of the single-chip microcomputer) and CE (connected to the P2.2 of the single-chip microcomputer) and BUSY (connected to the P2.3 of the single-chip microcomputer) controlled the voice playback of the system.
The polite terms involved were: welcome, thank you, welcome again, please pay, collect you, find you.
In order to improve the voice use efficiency of APR9600's and save the voice space, serial single-word recording was adopted. The sequence of recording was as follows: One, two, three, four, five, six, seven, eight, nine, ten, hundred, thousand, yuan, angle, whole, happy, welcome, light, present, again, times, thanks, please, pay, payment, Receive, find, you.
There were 28 words in total. Each word took 500 milliseconds to pronounce. It took 14 seconds to complete the entire design. This could greatly save the voice space of the voice chip APR9600 and improve its efficiency. Correspond to the pronunciation of each word, one subprogram could be compiled which were from SM1 to SM28. If you wanted to broadcast the sentence: "Receive you five hundred yuan", you only needed to call the six programs, such as SM26, SM28, SM5, SM11, SM13, SM15 in turn. For the design principle of the single-word call subprogram, the pronunciation call of "five" was taken as an example to introduce as follows: First voice address would be reset, CE (connected to P2.2 of the single-chip microcomputer) would be given a falling edge, and then M1 (single-chip P2.0) would be given a falling edge, and then M2 (connected to P2.1 of the single-chip microcomputer, fast forward Key) would be given four consecutive falling edges, and finally M1 (microcontroller P2.0) would be given a falling edge to start playback the fifth segment of voice. Next, the BUSY (connected to P2.3 of the microcontroller) status would be queried to determine whether the playback was over. The low level indicated that the playback was in progress. The high level indicated the end of the playback. When the microcontroller found that P2.3 (BUSY) was high, it would return after a delay of 100 milliseconds. When the playback ended, the single word playback interval was selected as 100 milliseconds. The specific program design was as follows: SM5

Conclusion
This system adopted single-chip microcomputer to control APR9600 to realize portable weighing voice quotation. The voice part adopts serial control mode. And the interface with single-chip microcomputer (only four IO ports) was simple, the control was flexible, the voice playback efficiency was high, the cost performance was high, and the practical promotion value was strong too. After the actual test, the system ran stably and all aspects of performance could meet the requirements.