How Magnetic Card Reader Works

Dear Readers,

A magnetic card is a rectangular plastic object (credit/debit card) that contains either a magnetic object embedded within the card or a magnetic stripe on the card’s exterior. A magnetic card can store any form of digital data.

The electronic devices designed to read stored information from a magnetic card do so either when someone swipes the card through a slot in the reading device or holds the card next to a magnetic card reader. About a hundred bytes of information can be stored on a magnetic card.

Because of their extensive use, most magnetic cards employ standards that describe a magnetic stripe’s physical and magnetic characteristics on a plastic card. These standards also define specifications for a storage format and information exchange.

Before describing how a magnetic card reader works, look at how data is stored on a magnetic card and the format of data storage collected.

According to existing standards, a magnetic card stores information in three separate tracks. All three tracks possess different bit densities and encoded character sets. The average bit density of the first track is 210 bits per inch (bpi). A 64-bit character data set stores information in track 1. The characters are made up of six data bits and an odd parity bit. The encoding format grants the least significant bit to come first and the parity bit, last. So, track one can hold around 79 characters.

The information density of the second and third tracks is around 75 and 210 bpi respectively. Only numeric data can be stored on the second and third track. 4-bit binary encoding is used as a decimal subset with odd parity and it is encoded with the least significant bit first and the parity bit last. The second and third tracks hold 40 and 107 characters respectively. The actual usable data stored will be minimized as the Start Sentinel, End Sentinel, and LRC characters are added.

“Two-Frequency, Coherent Phase Recording” is used for encoding magnetic cards. It is also called F/2F sampling-encoding. By using combined data and clock bits, self-clocking is achieved.

For all 3 tracks, the data storage format is as follows: Leading zero bits are encoded to specify the presence of an encoded magnetic card and provide synchronization pulses to the read head electronics and, ultimately, to the controller. The Start Sentinel character then indicates the initiation of actual data. The coded data follows the Start Sentinel character, which the End Sentinel character follows. The End Sentinel character terminates the card’s data portion, which an LRC byte (used for error detection) follows. Zero bits fill the remaining card.

Now that it is understood how data is stored on a magnetic card, it is a bit easier to build on that foundation to gain an understanding of how the reader actually works.

The magnetic card reader uses a specific component to read data from a magnetic card, which is referred to as the read head. The magnetic card reader is a microcontroller-based device. The read heads contain signal amplifiers and line drivers. All modern magnetic read heads contain integrated F/2F bit recovery circuitry and interface with the host controller.

Using good coding techniques, interrupt driven sampling can be used to read and handle the data. Most of the head will read the first and second tracks simultaneously. Some of advanced read heads can read all three tracks simultaneously. Linear conditioning is used for noise reduction and signal conditioning.

The reader also contains an oscillator section that provides the clocks for the recovery section and for the enable/disable timers. The enable/disable counters provide initialization for the recovery section. The recovery section locks onto the data rate and recovers the individual data bits from the data stream.

The magnetic card reader is a microcontroller-based device and has been programmed for a specific application. That program simply reads the card in a forward direction in a simple data format or it can be complex enough to read the card in any direction with a corresponding encoding format.

About Ambimat Electronics:

With design experience of close to 4 decades of excellence, world-class talent, and innovative breakthroughs, Ambimat Electronics is a single-stop solution enabler to Leading PSUs, private sector companies, and start-ups to deliver design capabilities and develop manufacturing capabilities in various industries and markets. AmbiIoT design services have helped develop SmartwatchesSmart homesMedicalsRobotics, RetailPubs and brewerySecurity 

Ambimat Electronics has come a long way to become one of India’s leading IoT(Internet of things) product designers and manufacturers today. We present below some of our solutions that can be implemented and parameterized according to specific business needs. AmbiPay, AmbiPower, AmbiCon, AmbiSecure, AmbiSense, AmbiAutomation.

To know more about us or what Ambimat does, we invite you to follow us on LinkedIn or visit our website.


Hardware Security Module (HSM)
IP code