You are on page 1of 1

ALGORITHM:

1. Swipe the card.


2. Signal detection and data collection is done when card is
swiped.
3. Check for the leading zeros.
4. Once the zeros are identified, start collection of data.
5. The 0s and 1s are identified depending on the threshold
peak values.
6. The time period for 1 is always double than that of 0.
7. The direction in which the card is swiped is determined and
according to that the appropriate decoding routine is called.
8. Decoding can be forward or backward.
9. In case of Track1, 7 bits form a single ASCII character.
10. In case of Track2 and Track3, 5 bits form a single ASCII
character.
11. So according to the track, bits are converted to their
corresponding characters.
12. The decoded track data is checked for errors in Start
Sentinel, End Sentinel, Parity and LRC (Longitudinal
Redundancy Check) errors.
13. The data is then sent through the UART to the computer
14. Data on the card can be read.

CODE (IN C):


<PASTE THAT CODE>

You might also like