A magnetic card reader is a device that reads data on a card. It not only supports reading data on the card, but also supports data writing. The card reader can realize various functions such as automatic charging, card sales, card making, etc. It is practical, fast, convenient, and highly reliable.
The magnetic card reader is used to read and write the magnetic stripe information of the magnetic card and passbook, and can be widely used in the fields of finance, post and telecommunications, commerce, transportation, customs, membership card consumption and point consumption.
This paper analyzes its technical principle through the actual design case of magnetic card reader.
The technique of storing information through magnetic patterns first appeared in the field of audio recording. Since then, the concept has been extended to many different products, such as floppy disks, audio/video tapes, hard drives, and magnetic stripe cards. This article will focus on magnetic strip cards that are widely used in global financial transactions and access control.
Reading a magnetic stripe card requires an important analog circuit in addition to the digital logic that needs to decode the data. Recording data on a magnetic card is a digital process that is accomplished by magnetizing particles along the length of the magnetic strip. Successfully reading a magnetic card is quite challenging because the amplitude of the sensor signal will vary with the speed of the card, the quality of the card, and the sensitivity of the card reader in practical applications. In addition, the frequency will also change as the card speed changes. This requires the analog circuit to adapt to this change and process the sensor signal without distortion. This article describes how to handle the mechanism of sensor signal changes.
Magnetic and magnetic card
In order to understand the effects of card speed, card quality and sensor sensitivity, it is important to know how information is stored on the card and how it is detected by the card reader. In magnetic storage systems, information is represented by a pattern of polarities on a magnetized material such as iron oxide. Figure 1 shows a magnetic strip coated on a magnetized material. The particles on the magnetized material may be in a particular alignment direction or in a random direction due to the fact that they have not been previously exposed to a specific direction magnetic field. However, if a certain external magnetic field is applied, the particles on the magnetic strip will be aligned according to the external magnetic field.
Figure 1: Magnetized materials are arranged in a specific direction under the influence of an external magnetic field
In a practical system, a write head is required, which is actually a coil wound around the core. The direction of the magnetic field can be easily programmed by controlling the direction of the current in the coil. This helps to form a north and south pole pattern on the magnetic card. The narrower the gap between the poles, the higher the data density that can be programmed on the magnetic card.
In the F2F encoding mechanism, if the pole switching occurs in the bit period, it represents logic 1, otherwise it represents logic 0. For example, as shown in Figure 3, if the bit period is Δ and the pole switching occurs at Δ/2, then this The bit is a logic 1, otherwise it is a logic 0. Note that the lengths occupied by logic 1 and logic 0 on the magnetic card are the same. However, the bit period Δ will vary with the speed of the card, and this problem must be solved in the card reading.
Figure 2: Using magnetized magnetized magnetic strips to represent logic 1 and logic 0, which uses the F2F encoding mechanism
Figure 3: Magnetic pole pattern and data
It is worth noting that the bit period length is the same for both logic 1 and logic 0.
Depending on the amount of information, the data will be encoded in different lines, which is called a track. A magnetic card can have up to 3 tracks.
Figure 4: Tracks on the magnetic card
The reading process is just the opposite. It requires the use of a card reader that is identical in construction to the coil-core shown in Figure 2. It should be noted that there should be one sensor per track. When the card is swiped, the magnetic field originating from the magnetic strip will induce a voltage in the card reader coil. Figure 5 shows the waveform obtained from the card reader.
Figure 5: Card Reader (Sensor) Signal
The signal peaks at each flux transition. This is because of the high density of magnetic flux at the edge of the pole. As you can see, the information is represented by the position of the signal peak. The peak detector circuit can decode this signal or use a hysteresis comparator with a threshold very close to the signal peak. However, before we pass this signal to the detector circuit, additional processing is required for the following reasons:
Carding speed: The unit of the carding speed is specified in inches per second (IPS). In general, magnetic card readers are required to operate at speeds ranging from 5 IPS to 50 IPS. The amplitude of the sensor signal varies with the speed of the swipe. As the card speed increases, the rate of change of the magnetic flux cut by the coil in the card reader also increases, so the signal amplitude becomes larger. In contrast, when the card speed is slow, the signal amplitude will decrease, which increases the difficulty of data reading.
Magnetic card quality: As time goes by and the amount of use increases, the quality of the card will decrease as the strength of the magnetic field decreases and the distortion caused by dust and scratches on the magnetic card increases. These factors combine to reduce the amplitude of the sensor signal.
Readhead sensitivity: The sensitivity of the reader depends on the number of turns and the spacing between the reader and the magnetic strip.
Due to the influence of all these parameters, the signal amplitude may vary from a few hundred uV to several tens of mV. This range can be compensated with an amplifier. However, a fixed gain amplifier cannot be used. When the card speed is high and the card quality is good, the amplifier output can be saturated to the rail voltage. When the signal is saturated, the information represented by the time difference between two consecutive peaks will be lost. It is therefore important to faithfully amplify the sensor signal without saturating or changing the waveform. This requires the use of a gain configurable amplifier so that we can adjust the gain at any time. To do this, the system must be able to detect when the signal is weak. This can be done with an ADC that tracks the sensor signal looking for an approximate signal peak.
Figure 6 shows a complete system. Preferably, the amplifying circuit is made in two stages, and the output of the first stage circuit is received by the ADC. This eliminates the need for a high-resolution ADC, and an 8-bit ADC is sufficient for this application. The first stage can be a fixed gain amplifier or a variable gain amplifier. The second stage is a variable gain amplifier. The CPU reads the ADC result and optimizes the signal output of the second stage amplifier by adjusting the gain. The output of the second stage amplifier is sent to the peak detector/hysteresis comparator circuit for peak detection. The pulse output from the detector is fed to a timer for time difference measurement, and then the CPU decodes 1 and 0.
Figure 6: Magnetic Card Reader Block Diagram
At this point, there is still a problem of data loss before the gain update. To avoid this problem, both ends of the card are encoded with leading zeros for synchronization (this supports two-way padding). The purpose of this is to synchronize the decoder to the swipe speed. For example, in track 1, there are approximately 62 leading zeros. Track 1 has a data density of 210 bits. Therefore, we can estimate that the leading zero will last for about 60ms when the card speed is 5 IPS, and the leading zero will last 6ms when the card speed is 50 IPS. It is more or less the same for the other two tracks, as shown in the figure. 7 is shown. It is impossible to start with 50 IPS at the beginning of the man-made card, so the system has a much longer time than 6ms to measure the peak and adjust the gain. Figure 8 shows the gain control process.
Figure 7: Contents of three tracks in a magnetic card
It should be noted that the CPU may continue to fine-tune the gain during the padding to accommodate the magnitude of the change. Under normal circumstances, the speed of the card will increase in the direction of the card, thereby increasing the signal amplitude. Note that this view is incorrect when using an automatic card reader that draws cards at a constant speed.
Figure 8: Gain change process
Implement magnetic card reader
Figure 9 shows the implementation of a Cypress PSoC 1 based dual track magnetic card reader. The PSoC 1 processor features configurable analog and digital blocks integrated with an 8-bit processor core that integrates all functions on a single chip. It should be noted that the passive components shown in the figure are external to the processor.
Figure 9: PSoC 1 Magnetic Card Reader
Since the sensor signal may be negative, it must be biased with DC. In PSoC 1, the analog signal can be referenced to a different location than the power ground. This ground is called analog ground (AGND) and the input signal is clamped to this analog ground. The signal is then amplified in two stages with a programmable gain amplifier (PGA). The PGA is implemented with a continuous time analog module. It has an array of resistors that are used to change the gain when configured as an amplifier. The gain can be configured to one of 18 options between 1 and 48. The CY8C28243 PSoC 1 integrates a 10-bit SAR ADC with a maximum sampling rate of 150ksps.
The CPU reads the ADC and then controls the amplifier gain. The amplified signal is sent to a hysteresis comparator to produce a digital signal with an edge close to the peak of the signal. The CPU must then adjust the amplifier gain so that its threshold is close to the peak but does not exceed the peak. This helps to avoid timing errors when the card is shaken. The hysteresis comparator output is sent to the timer for pulse width measurement. The CPU reads the timer output and decodes it into logic 1 or 0 data. When the card is over, the CPU packs the data bits, checks for errors, and then sends the data to the host via the I2C, SPI, or UART interface.
Hf Drivers - Neodymium,Bullet Tweeter Speaker,Loud And Ultra Crisp Sound,Compression Driver
NINGBO BOILINGSOUND ELECTRONICS CO.,LTD , https://www.tweeterspeaker.com