Circuit Lake

Electronic Project and Circuit Collection

Magnetic Stripe Card Reader

03/08/2010 Category: AVR, Data Acquisition, Project

This AVR-based magnetic stripe card reader will read the data from track 1 of a credit card, or any other card that uses a similar format, and will send it out an RS232 port where it can be displayed on a PC using any communications program.


There can be up to three tracks used on magnetic stripe cards. Track 1 contains alphanumeric data and includes the Primary Account Number (PAN), cardholder name, expiration date, LRC, and other discretionary data such as verification values and validation codes. Track 2 contains numeric data only and includes the PAN, expiration date, LRC, and discretionary data. Track 3 is also numeric only and contains the PAN along with security and discretionary data, said Kevin George, the project designer.

The magnetic stripe card reader utilizes the Atmel AVR AT90S2313 controller and interfaces to a PC using a standard 9 pin RS232 cable. The controller card reader interfaces to a Magtek 21065005 TTL level insertion card reader (similar to the kind used in pay-at-the-pump gas pumps). The Magtek 21065005 is capable of reading track 1 and track 2 however, for this project track 1 only is implemented. The schematic shows the connections to tracks 1, 2, and 3, with tracks 2 and 3 to be implemented at a later date. Tracks 2 and 3 should just require some minor software changes because of the word length of the data, tracks 2 and 3 are 5 bits instead of 7 bits.

Magnetic Card Reader
Project Detail and Documentation