Optimization Design and Research of Taxi Intelligent Meter

0 Preface

This article refers to the address: http://

With the rapid development of social economy and modern transportation, taxis have become a beautiful landscape in urban public transportation and an indispensable important means of transportation in people's daily life. In China, urban taxis have emerged since the 1980s. The widely used meter for many years only has a simple pricing function. At present, domestic taxi meters are still only based on mileage. With the advancement of society, people have put forward higher and higher requirements for the scientific and rationality of taxi meter. For this reason, the taxi pricing system needs to be optimized. The taxi meter designed in this paper can realize the function of comprehensively calculating the price of the car by time and mileage, and can display relevant information such as time, mileage, unit price and total price. It has more complete functions, more convenient use and more stable system. it is good.

1 Overall design of taxi smart pricing system

The taxi intelligent pricing system is designed to achieve basic clock display, price adjustment, mileage pricing and related expansion. System design ideas: MCS51 microcontroller as the core, hardware module design, and related software design, using I / O port and its control accuracy to achieve system functions. The overall design block diagram of the system is shown in Figure 1.

Optimization Design and Research of Taxi Intelligent Meter

In FIG. 1, the Hall sensor circuit system converts the magnetic induction signal into a pulse signal, and uses this to calculate the taxi mileage; the four-button keyboard control circuit performs the initial pause, split screen switching, day and night alternation, and function setting, respectively. Operation; DS1302 clock chip is used for time calculation and time unit price conversion; AT24C02 chip can realize power-off storage information, caller reading information function; LED1602 is used to display unit price, clock and amount of information.

2 Taxi smart meter main hardware module design

2.1 Timing and time display module design

Using the 24-hour system, three 8-bit LED digital tube dynamic scanning methods are used to display the seconds, minutes and clocks. The three button switches SP1, SP2 and SP3 are respectively connected to the P0.0, P0.1 and P0.2 of the single-chip microcomputer. Port, used to adjust the seconds, minutes, and clocks of the clock signal. The single-pole double-throw switch is used to control the addition, subtraction and adjustment of the seconds, minutes and clocks; when the LED is on, press the button switch to implement the adjustment; when the LED is off, press the button to decrease the adjustment.

2.2 Pricing and Display Module Design

Valuation and display use four 74LS164 drivers to expand 32 parallel ports and use 4-digit LED digital tube to complete the display function. Assume that the starting price of the taxi is 6 yuan, the unit price is 1 yuan per kilometer, and the driving distance is less than 2.5 kilometers according to the starting price. When the driving distance is more than 2.5 kilometers, the fare for each additional kilometer will increase by 1 yuan.

2.3 Mileage sensing module design

The taxi mileage is calculated using the pulse signal detected by the Hall sensor A44E mounted on the taxi wheel. When the mileage information is transmitted to the P3.5 port, it is processed and transmitted to the 4-digit display. The schematic diagram of the system mileage sensing module is shown in Figure 2.

Optimization Design and Research of Taxi Intelligent Meter

3 system software design

3.1 main program module design

In this module design, it is necessary to complete the initialization of the taxi price and unit price, the initialization of each interface chip, the design of the interrupt vector, and the interrupt, cycle waiting, etc., also need to set the start/clear flag register, mileage and price register, and It is initialized. Start, clear, meter, and price calculations are performed according to the requirements of the flag register. The main program flow chart of the system is shown in Figure 3.

Optimization Design and Research of Taxi Intelligent Meter

When the meter switch is pressed, the meter starts the pricing function and calculates according to the contents of the mileage register, and stores the calculation result in the register, and then displays the total running time and the current accumulated amount. When the destination is reached, the Hall switch no longer sends a pulse signal, stops the pricing function, and displays the current amount payable. When the meter is started next time, the system will automatically clear it and the initialization process will be reset.

3.2 System subroutine module design

The system module includes six main subroutines: display subroutine, mileage count interrupt, timer interrupt, midway wait interrupt, start/clear taxi interrupt service routine, and key service program. The functional characteristics of each service subroutine are as follows:

(1) Display subroutine. The display subroutine mainly includes four subroutines, such as time division/second/clock display, distance unit price display, unit price adjustment display and amount unit price display, which can display data by split screen.

(2) The mileage count is interrupted. Each time the MCU interrupts, the Hall sensor needs to output a low level signal. When the mileage counter accumulates the mileage pulse for 1000 times, the program accumulates the current total amount, so that the MCU enters the mileage count interrupt service routine, and completes the accumulation of the current mileage and total amount. Operate and transfer the final result to the mileage and price registers.

(3) Timed interruption. In the timer interrupt service routine, an interrupt will be generated every 100 ms. When 10 interrupts are generated cumulatively, it will reach 1 s, the data will be sent to the corresponding display buffer unit, and the display subroutine will be called to realize the real-time display function.

(4) Waiting for interruption midway. There is no signal output from the Hall switch in the counting state, and the on-chip timer will start. When the time reaches 5 minutes, the current amount plus the price waiting halfway will be used for the accumulation operation. And each time you wait for 5 minutes, you will automatically add a mid-way waiting price; when the middle of the waiting is over, the meter will automatically switch to normal pricing.

(5) Start/clear the taxi interrupt service routine. When the start/clear interrupt request is generated, the first interrupt is automatically set to start the interrupt, the second interrupt is the clear interrupt, and the contents stored in the flag register are respectively set to "1" or cleared to "0".

(6) Button service program. In the main program, if there is no button operation, the MCU runs the main program cyclically; if there is a button press, it will turn to the button service program to process, and return immediately after the end.

4 system simulation test

In KEIL, the designed program is compiled into the corresponding machine language, enter the ISIS 6 software environment of Proteus, and the generated HEX file is imported into MCS51, the circuit schematic is drawn in Proteus, and the parallel simulation test is carried out. In this process, the problem program can be modified and improved, and debugging can be performed until the simulation result meets the requirements.

4.1 Main parameter simulation

The main parameters of the system include mileage, time consumption, unit price and amount. The simulation results of the main parameters of the system are shown in Figure 4.

Optimization Design and Research of Taxi Intelligent Meter

In Figure 4, the taxi spends 12min27s, the starting price is 2.5km, the waiting time is 1 (3 yuan per timeout), the operating mileage is 6km, and the total amount is 6+(6-2.5) ×1+3=12.5 yuan, which matches the total amount displayed.

4.2 Related important parameter simulation

In the system design, relevant parameters such as starting price mileage, unit price and free waiting time upper limit value can be redesigned. The simulation effect of important parameters related to the system is shown in Figure 5. (To facilitate the research problem, the detailed circuit part of the system is ignored, and only the main data of the system is displayed).

Optimization Design and Research of Taxi Intelligent Meter

As can be seen from Figure 5:

(1) Change the starting price mileage from 2.5km to 3km, the unit price is changed to 2 yuan; Figure 5(a) shows the distance is 2km (within the starting price), the amount is 6 yuan; Figure 5(b) shows the mileage is 22km ( Outside the starting price), the amount is: 6+(22-3)×2=44 yuan.

(2) The upper limit of the free waiting time is set to 5 min, and the multiple waiting for the upper limit time can be repeated. Figure 5 (c) shows the price without waiting time on the road; Figure 5 (d) shows the waiting time on the road. The price (charge 1 yuan), so 1 yuan more than the total amount of the figure (c).

The system simulation results show that the taxi meter can set relevant parameters according to the actual application needs, to meet the taxi time-sharing and sub-scenario pricing functions, and basically realize the system function requirements.

5 Conclusion

The taxi meter designed in this paper is based on the principle of combining single chip microcomputer and Hall sensor to realize the pricing function. The optimized design of the taxi meter integrates many functions such as metering, timing, billing, storage, viewing and statistics. It has the advantages of complete functions, reliable performance and simple circuit, so it has good economic value and application value. . With the development of modern science and technology and the advancement of society, the taxi pricing system will be more scientific and reasonable.

Portable Power Station

Zhejiang BSL battery Co,.Ltd. , https://www.bslbatteryservice.com