Magnetic card reader based on single chip microcomputer

Publisher:WeaselLatest update time:2012-02-02 Source: 微计算机信息 Keywords:GPS Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

In today's society, many small and medium-sized cities conduct assessments on public buses, mostly using manual assessment methods. This method has many disadvantages. For example, it is impossible to effectively supervise the time when the vehicle arrives at each stop and the problems of passenger pressure, speeding, overloading, etc. during the journey. More importantly, it wastes a lot of human resources. Therefore, there is an urgent need for a system to effectively manage public buses.

Through market research, there are two main ways to manage public buses: one is the GPS automatic assessment system, and the other is to set a signal transmitter on the bus stop to identify the arrival of the vehicle. Although the former method is more advanced, it is expensive and will only increase the burden on bus companies in small and medium-sized cities. More importantly, it requires the transformation of the original bus stop, and the procedure is cumbersome. Although it belongs to the synchronous assessment method, it is still powerless against traffic jams. Although waiting passengers can know the distance between the vehicle and the station through the bus stop, the exact time of arrival is still uncertain, and the assessment effect is not ideal; the latter method uses the time interval between the vehicle receiving the signal and losing the signal to determine the time when the vehicle stops at the station, but this system can be said to be very poor in actual application. The power supply on the bus stop, the stability of the transmitter, the inconsistency of the receiver sensitivity on the vehicle, and the interference of the opposite station have seriously affected the assessment.

In recent years, single-chip microcomputer technology has developed rapidly and has been widely used in many fields. Since single-chip microcomputers have many advantages such as programmability and good storage scalability, the idea of ​​using single-chip microcomputers to realize automatic assessment and station announcement of public buses has emerged.

2 System Functions

(1) Automatic station announcement function: When the vehicle arrives at a parking station, the system automatically announces the station without the need for manual button pressing.

(2) Automatic assessment function: automatically record the time the vehicle stops and the mileage it has traveled, and automatically record the time and mileage of speeding and underspeeding.

(3) Display time function.

3 System Design Principles

Compared with ordinary vehicles, buses have an obvious feature, that is, they have a fixed route, and the stations and intersections they pass through from the starting point to the end point are also fixed. Therefore, the distance from the starting point to any station or any intersection is relatively unchanged, and the distance between any two stations, intersections, and between stations and intersections is also unchanged. We take advantage of this feature and first record the mileage of the bus from the starting station to each station and each intersection (to be precise, it is a range, that is, the data range of reaching a certain station or intersection obtained after repeated tests) in the system. In actual operation, if the mileage of the bus reaches a certain range (the lowest value of the range), the station will be automatically announced (including prompting that it is an intersection, etc.), which realizes the automatic station announcement function. For the judgment of overspeed and underspeed in automatic assessment, it is only necessary to set a counter in the system (calculating the number of circles the wheels have turned), and use the number of circles the wheels have turned per unit time to judge the overspeed and underspeed of the vehicle, and at the same time record the time of overspeed and underspeed and the mileage in the system. In this way, after the vehicle returns to the terminal, as long as the data inside the system is read, the stops and overspeed and underspeed driving conditions of the vehicle during operation can be known. For recording the vehicle parking time, the method is to start timing when the vehicle stops turning, stop timing when the wheels start turning, and save the timing time in the system. Since the length of the vehicle parking time and the parking time are recorded, it is possible to prevent some buses from delaying the pickup of passengers at the station and stopping to pick up passengers before reaching the station. It should be noted here that the so-called mileage = wheel rotation number * wheel circumference.

4 System Hardware Design

The hardware design of this system can be divided into four parts according to the functional modules: minimum system, display circuit, counting circuit and voice circuit. The following will introduce how to use the single chip microcomputer to realize the automatic assessment and station announcement of public transportation vehicles in combination with each functional module.

1. Minimum system

The minimum system consists of five parts: 89C51, RAM, latch, clock circuit, and reset circuit. This is the core of the system, and all instructions are issued by 89C51.

RAM: Since the vehicle needs to record a large amount of data during driving, such as the time the vehicle stops, the time of slow driving, the time of speeding, etc., the 89C51 has only 256B of data storage RAM, of which 128B is available to the user. The data capacity cannot meet the needs of the system at all, so an external RAM is required.

Latch: Although 89C51 has four 8-bit I/O ports, P0, P1, P2, and P3, only P0 can be used directly for read/write operations on external memory, and P0 also outputs the low 8-bit address of the external memory (the high 8-bit address is directly output by 89C51's P2 port). In order to avoid signal conflicts between data and address, a latch (74LS373 is used in the experiment) needs to be added between 89C51 and RAM to enable time-sharing output of data and address.

Clock circuit: The system must have a reliable clock to work stably. This system uses an internal clock mode, an external 6MHZ crystal oscillator, and a parallel resonant oscillation circuit composed of a crystal oscillator and a capacitor (15P), so that the circuit inside the 89C51 can generate self-oscillation.

Reset circuit: When a high level appears at the RESET terminal of 89C51 for 10ms, the microcontroller is reset. The system combines manual reset and power-on reset together.

(II) Display circuit

The display part mainly displays the time. In the system design, since the parallel port of 89C51 itself is limited, 8155 is used in the system to expand the parallel port. We use the 8155PB port to output the segment code (that is, the data to be displayed), and use the lower four bits (PA0, PA1, PA2, PA3) of the 8155PA port to generate 16 bit selection signals after decoding by a 74LS154 (four-sixteen decoder). If a bit selection signal is valid, the corresponding LED light will be lit. We use the dynamic display method here. The obvious advantage of this method over the static display method is that it occupies less I/O port resources, so there is no need to expand the I/O port of 89C51.

(III) Counting circuit

During the operation of the vehicle, how do we calculate the mileage of the vehicle and how to judge whether the vehicle is speeding or underspeeding? These are all achieved through the counting circuit. We only need to record the number of revolutions of the wheel and then multiply it by the circumference of the wheel to get the mileage of the vehicle. As for the speed, set the system to collect the count value (i.e. the number of vehicle revolutions) at a fixed time interval (such as 5 seconds), multiply this value by the circumference of the wheel to get the mileage of the vehicle, and then divide it by the time to get the speed. In this way, we can judge whether the vehicle is speeding or underspeeding. In fact, the counting circuit is very simple. It only uses the external interrupt INT0 of 89C51. Whenever this pin has a falling edge signal, the counter is increased by 1 (a 16-bit counter is used in the system, and the maximum count value can reach 65535). In the process of conducting experiments, we found that the pulse interference generated by the simulated wheel is very large. The use of software delay is not ideal, and it affects the display (the LED light used for display produces obvious jitter), so we think of using hardware delay at the INT0 end. The RS trigger has good characteristics in this regard, so an RS trigger is added between the INT0 pin and the wheel that generates the pulse. [page]

(IV) Voice circuit

The station announcement function of the automatic assessment and station announcement system is mainly realized by the voice circuit. The voice chip we used in the experiment is ISD4002-120P. The storage time of this chip is only 120 seconds. It can only be used in the laboratory stage. In actual applications, the chip with a longer storage time can be replaced. Since the vehicle only needs to announce the station while it is running, and no recording is required, we use the circuit shown in Figure 1 to record the voice chip.

Figure 1 Voice recording and playback circuit

The switch is in the recording state when it is at the "REC" end. Press and hold the "AN" key, and the indicator light will light up, and you can speak into the microphone to record. Release the key to stop recording and form a segment. Press it again to record the next segment. Press the "STOP" key to reset, and start recording from the first segment again. The switch is in the playback state when it is on the "PLAY" side. Press "AN" once to play a segment, and it will automatically stop playing after a segment ends. Press the "AN" key again to play the next segment.

Put the recorded chip into the system. When the vehicle's mileage reaches a certain range, we use the fast-forward function of the voice chip to jump to the corresponding voice segment and start playing, thereby realizing automatic station announcement.

5 System Software Design

The system software adopts a modular structure, mainly composed of the main program, counting interrupt subroutine, and time interrupt subroutine. The main program flow chart (as shown in Figure 2) and the counting interrupt subroutine flow chart (as shown in Figure 3) are listed below:

6 Conclusion

In general, this system adopts a relatively novel idea, using a single-chip microcomputer to realize the automatic assessment and announcement of public transportation vehicles. It can effectively manage public transportation vehicles and has a good market prospect. In actual use, the keyboard can be expanded in the system to prevent the bus route from changing and some abnormal situations from occurring, and the keyboard can be used to control the announcement of stops.

References

[1] He Limin. MCS-51 Series Single Chip Microcomputer Application System Design: System Configuration and Interface Technology. Beijing: Beijing University of Aeronautics and Astronautics Press, 1990.

[2] Liu Leshan, Ye Jizhong. Principles and Applications of Microcomputer Interface Technology. Hubei: Huazhong University of Science and Technology Press, 1996.

Keywords:GPS Reference address:Magnetic card reader based on single chip microcomputer

Previous article:Design of building direct-press visual intercom doorbell system based on single-chip microcomputer
Next article:Design and implementation of automatic storage cabinet based on AT89C52 single chip microcomputer

Recommended ReadingLatest update time:2024-11-17 06:32

Design of Single Chip Microcomputer in GPS and CDMA Timing System
It is superior to other electronic products in terms of reliability, scalability, control function, volume, power consumption, etc. It is widely used in astronomy, seismic stations, aerospace and other occasions with high time accuracy, as well as defense, communications, electricity, transportation and other fields t
[Microcontroller]
Design of Single Chip Microcomputer in GPS and CDMA Timing System
More powerful and accurate than GPS, researchers develop positioning system with 10cm accuracy
According to foreign media reports, researchers from Delft University of Technology, Vrije Universiteit Amsterdam and the Netherlands Institute of Metrology (VSL) have developed an alternative positioning system that is more powerful and accurate than GPS. , especially in urban environments. A working prototype demons
[Automotive Electronics]
More powerful and accurate than GPS, researchers develop positioning system with 10cm accuracy
Providing test systems for automotive radio and GPS
 Authors: Etienne Frenette, Averna, Hans-Joachim Tepper Tepper - IAV Automotive Engineering “Today, the high-throughput RF data streaming capabilities of NI PXI technology allow us to effectively record and replay all common analog and wireless signals in use, as well as a variety of signal impairments.” challenge
[Test Measurement]
Providing test systems for automotive radio and GPS
Taxi safety monitoring system based on TMS320DM355 processor
With the rapid development of society and the improvement of people's living standards, taking a taxi has become a very convenient and indispensable way of daily travel. While taxis are convenient for people's daily lives, their safety issues are also increasingly concerned. How to protect the personal and property
[Embedded]
Application of GPS in Vehicle Positioning and Navigation System
introduction In recent years, with the rapid development of the economy, the growth rate of motor vehicles is much higher than the speed of road construction. Any city is facing a situation where the improvement of road conditions is relatively lagging, resulting in traffic congestion and environmental
[Power Management]
Satellite Navigation System for Internet of Things
1. Development of satellite navigation systems The global satellite navigation system, also known as the Global Navigation Satellite System (GNSS), is an air-based radio navigation and positioning system that can provide users with all-weather three-dimensional coordinates, speed and time information at any l
[Embedded]
Satellite Navigation System for Internet of Things
89C51 reset circuit principle, conditions, schematic diagram and clock concept
1. reset condition The 89C51 microcontroller needs a high level for 24 clock cycles to reset. The function of reset is to make the program pointer point to address 0. Each program starts executing from address 0, so the concept of reset is to start the program from the beginning. implement. 2. Reset circuit schemati
[Microcontroller]
89C51 reset circuit principle, conditions, schematic diagram and clock concept
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号