• Main Menu
  • How a Magnetic Card Reader Works


    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.

    Got Something To Say:

    Your email address will not be published. Required fields are marked *

    10 comments
    1. Nurd74

      17 August, 2014 at 3:47 am

      Hi I just bought a keyboard with magnetic stripes reader I want to know if I can write with it for my business.

      Reply
    2. ujala

      27 January, 2014 at 11:14 pm

      LRC stands for4??

      Reply
    3. khoder

      23 October, 2011 at 8:10 pm

      hi sir;
      i have a company and i already bought magnet stripe card reader but i want to know how do i have to program it so i can know which time do my workers come…
      and thanks
       

      Reply
    4. Sreejesh Ellath

      18 August, 2011 at 11:03 am

      Hi sir,
                  I have one application that and we are creating voucher system for our shop. I want to use magnetic card so that i can record the visit of the customer and status of voucher.
      is it possible to write on magnetic tape. if so how is do it using programming language do you have any idea.
      I am a java programer

      Reply
      • Ricky

        22 October, 2014 at 10:36 pm

        I was thinking about that same thing. I think, and this is just me thinking out loud, but I’m quite sure that the magnetic card must contain an identifier; such identifier may be produced with an algorithm to ensure that it is not easy to reproduce or guess. When the card is read by the magnetic reader the id is located on an external database that contains data pertaining to that id.
        The idea is to have a database in which you can make queries, with an identifier for each record that will coincide with the code on the card, so that when the card is read the query is executed and you can do stuff with it.
        input ->input_id
        select Data1,Data2,DataX,Id from Database where Id=Input_id
        If Data1>{^2013.12.31} then
        “everything’s cool”
        else
        “whatever”
        Endif
        and so on

        Reply
    5. Sreejesh Ellath

      18 August, 2011 at 11:00 am

      very much helpful thanks

      Reply
    6. Interested_reader

      9 August, 2011 at 11:21 pm

      Hi.  I’m new to this topic.  I was just wondering how merchants go about accepting cards from new credit card companies.  How do credit card companies enable a merchant’s existing credit card reader to accept new types of payment.

      Reply
    7. Adji

      4 May, 2011 at 8:31 pm

      How can you change balance values. Is it encrypted for each financial facility?

      Reply
      • Kaj Bonfils

        17 May, 2011 at 6:48 pm

        Balance is not recorded on a magnetic card. Only card number and expirationdate is written – and it is not encoded in any way.

        All verification of your balance is done online – so sorry… You cannot change your card and add a 1000 bucks 🙂

        Reply
        • wakawaka

          30 August, 2011 at 2:22 pm

          hahaha that was a nice answer.

          Reply
    Smart Cards
    181 queries in 0.498 seconds.