SHOPLIFTING

The Anatomy of Magnetic Card Readers

The American company IBM IRD issued the first plastic credit cards with a magnetic stripe in 1970s. The developers continued working on creation of the first service center for magnetic cards and a terminal for verifying transactions. As a result, nowadays we are using magnetic card readers. For 50 years, credit cards have been widely used by banks, insurance companies, hospitals and other establishments. If you are reading this, I bet you have at least one credit card or possibly a good dozen of them.

What is a magnetic card reader?
A magnetic card reader is a hardware device that reads the information encoded in the magnetic stripe from a magnetic card. A magnetic card can store any kind of digital data with the volume of about a hundred bytes. Magnetic card readers read the information either you swipe the card through a slot in the reading device or hold the card close to a magnetic card reader. There are several options to read magnetic card readers. It can be done by a computer, or a USB connection.  

The most common uses of magnetic card readers
The first association that rises with plastic cards has to do a lot with credit cards. But its usage is much more wider. These are ID cards, access control applications, time and attendance, library, gift, and membership cards. Due to the types of magnetic readers, there are two models: swipe (when you swipe the card through the reader) and insertion (when you insert the card quickly into the reader and remove it).

How data is stored on a magnetic card?
There are three separate tracks to store information on the magnetic card. All of them have different bit density and encoded character sets. The average bit density of the first track is 210 bpi, second and third – 75 and 210 bpi. Track one can store around 79 characters, tracks two and three – 40 and 107 characters. Two-frequency coherent phase recording is a special technique used for encoding data on magnetic stripe cards. Using combined data and clock bits allows achieving self-clocking.

The read head and its role
A magnetic card reader is a microcontroller-based device. It has a specific component to read information from a magnetic card called the read head. The last one contains signal amplifiers and line drivers. Advanced coding techniques allow handling the data and reading all three tracks simultaneously. In addition, a magnetic card reader also contains an oscillator section. Its task is to provide the clocks for the recovery section and for the timers to enable and disable. The enable and disable counters make initialization for the recovery section.

How to make a magnetic card reader?
For those who like experiments, this section may be of interest. We provide you with the shallow instruction of how to connect a magnetic card reader to an AVR or Arduino. You will be able to read data from the first track of a card.

1. Prepare necessary equipment
You might have a different list of equipment depending on what kind of magnetic card reader you are going to have in the end. However, the following items are to start with: a magnetic card reader, AVR, Urdino or clone, a solderless breadboard, wire and AVR Terminal or a different application to read your serial port.
2. Connecting magnet card readers
You will need to make the following connections:
·        a red wire goes to +5V
·        a black wire goes to GROUND
·        a green wire is /CARD_PRESENT
·        a yellow wire is /STROBE
·        a white wire is /DATA1
There are other connectors: brown for /STROBE2 and orange for /DATA2. There is no need to use them.
Use a right angle male header connected to a breadboard and connect it to the magnetic card reader.
3. The functions of a magnetic card
You will need to read several functions from a magnetic card: detect when the card has been swiped, read the stream of information, detect when the card has left the reader, process and show data.   

This is not an easy DIY thing to do. Be sure that you know all what you are doing. Making a magnetic card reader from Arduino is a challenging step, but still possible! In any case, we wish you good luck in your own creations!
HELP
Made on
Tilda