Current location - Education and Training Encyclopedia - Graduation thesis - Paper on Automatic Tracking of Intelligent Bus
Paper on Automatic Tracking of Intelligent Bus
Bus automatic stop announcer based on single chip microcomputer

-Application of counting function

Counting the pulses of the axle angle and comparing the counted value with the preset value can determine the stop reporting time, so as to achieve the purpose of accuracy and automation. Taking AT89C5 1 as CPU, the external pulse is counted in the interrupt processing program, and the voice is output by combining with the voice chip ISD4004.

Keywords: distance control counter C5 1 ISD4004 programming

Introduction to 0

At present, there are three ways to report stations. One is the bus stop reporting system using GPS. At present, some cities in the United States have put it into use, and there are also research and development of such products in China. Its function is powerful and the system is stable, but the investment is expensive, especially in some small and medium-sized cities. At present, some cities in China adopt manual electronic station reporting and manual station reporting, both of which are inseparable from flight attendants, which increases the work intensity of drivers and passengers. Manual electronic station reporting is generally controlled by drivers or flight attendants, which often leads to false alarms. Based on the above shortcomings, combined with the use characteristics of public transport vehicles and the actual operating environment, an urban intelligent bus stop reporting system was developed. The key technology is to count the pulses of axle rotation angle and compare the counted value with the preset value, so as to determine the stop reporting time and achieve the purpose of accuracy and automation. Taking AT89C5 1 as CPU, the external pulses are counted in the interrupt handler, and the voice is output by ISD4004.

A composition principle

The system consists of pulse detection, pulse counting, comparison and judgment, control signal, voice chip, output display and so on.

1.65438+

1.2 After the signal of the pulse counting photoelectric coupler enters C5 1, the pulses are counted by interruption. External crystal oscillator 12MHz.

1.3 Compare the counted value with the preset value in the comparison and judgment program, and output a signal to control the language chip to report the station when the counted value reaches the preset value.

1.4 control buttons are used for manual control, manual adjustment, preset value input, etc.

1.5 language chip is composed of dedicated voice chip ISD4004, which is erasable and easy to use on different buses.

1.6 reset control The microswitch installed on the door will give a signal to C5 1 when it arrives at the station, so that it will automatically start counting in the next section.

The output display of 1.7 consists of two-bit seven-segment digital tubes, which are displayed by C5 1 in a dynamic scanning mode.

There are two ways for the preset storage of 1.8, one is to write the data into the writer, and the other is to write the number of inter-station pulses into the in-vehicle chip when the single-chip computer is in the input state.

hardware design

The system circuit diagram is as follows:

2. 1 C5 1 is connected with the external language chip ISD4004 through P0.0 to p0.3, in which ISD4004 is packaged in PDIP, and the pin functions are as follows: chip selection (SS): this terminal is low, that is, an instruction is sent to ISD4000 chip, and the level between two instructions is high; MOSI: This terminal is a serial input terminal, and the main controller should input data into this terminal half a cycle before the rising edge of the serial clock of ISD input; Serial Clock (SCLK): The clock input of ISD is generated by the main controller and used to synchronize data transmission between MOSI and MISO. Data is latched into ISD on the rising edge of SCLK and shifted out of ISD on the falling edge; Interrupt (INT): Open-drain output. When ISD detects EOM or OVF in any operation (including fast forward), this terminal goes low and remains unchanged. The interrupt status is cleared at the beginning of the next SPI cycle. The voice is output by AUDOUT to the power amplifier, and then amplified.

2.2 P 1.0 to 1.4 form a key group, which completes front and rear selection, state selection and manual control. And P 1.4 to P 1.7 are reserved as function expansion ports.

2.3 The signal collected by Hall enters P3.2 through optical coupler 4N25. This pin is the input pin of external interrupt O. Once a pulse enters, it will trigger the interrupt of single chip microcomputer and call the handler.

2.4 The microswitch installed on the door will send a signal to C5 1 when it arrives at the station, so that it can automatically start counting in the next section.

2.5 P2.0 to P2.6 directly drive the digital tube, P3.6 P3.7 is the chip selection terminal, and the arrival status is output by dynamic scanning.

2.6 The power supply voltage of ISD 4004 is 3V, which requires a voltage conversion circuit, which is not given here. There are other functions of the station announcer, such as passenger microphone, alarm prompt and so on. Because this paper simply describes the core of the counting function, I won't go into details.

Third, software design.

C language development, including initialization, interrupt handling, automatic operation, manual operation, reading and writing EEPROM, main program module. To develop simulation in XAC environment, it is best to get on the bus and debug.

Debugging and application

After the system is completed, it can be debugged on the computer. When in use, the distance between stations can be written into the single chip microcomputer with a matching burner. If you don't know the distance, you can manually input it on the computer to make the equipment in the input state. Press the Enter key when leaving the station, and press the OK key when arriving at the station to write the corresponding data between stations into the single chip microcomputer. If there is a rough report in use, it can be adjusted manually.

Five-point concluding remarks

In this way, the high-speed counter port of 89C5 1 single chip microcomputer is used for pulse counting, and the time of station reporting is controlled by distance, so that fuzzy control is realized for the first time and the shortcomings of existing equipment are changed. Simple, practical and highly automated. The application of sensors in buses greatly improves the functions of equipment.