How to Interface Swipe Card Reader with AVR


Swipe Card Reader Interface




Swipe Cards are used nowadays at many locations that include Point of Sale Terminals, Access Control, ATM Machines, Motorway Toll, Airline Tickets Verification, Vending Machines, etc. They connect to the host Microprocessor through Direct I/O interface, RS-232 serial ports or USB.
Swipe Cards used in Financial Transaction have a defined size, Track Encoding and card Data Format. Debit Card and Credit Card are example of Financial Transaction Card.

As the Financial Transaction Cards and information related to them are available easily, they are used in this project. Details of FTC are provided as under.
Card Dimensions, Encoding and Data Format for credit cards as per ISO7813






Swipe Card Reader Connector

Magtek is world renowned swipe card manufacturer. Card reader used in this project is Magtek Part number 2105004 which is 101mm compatible, Dual Track (Track 1 & 2) Swipe card reader with cover. The Card has TTL compatible direct I/O interface, as detailed below:

Signal Timing

The timing of signal on CARD PRESENT, STROBE and DATA is as under


Connecting Card Reader to the AVR Project Board
Below is the schematic of the wiring of the card to the AVR project board to capture the track 1 of the card.


J1 in the schematic is the swipe card 8 pin connector.
Note: Remove the MAX 232 from the project board, or use any other port pin for DATA signal as the PD0 and PD1 are directly connected to the MAX 232.
TRACK 1 DATA FORMAT

The following is typical for Track 1 data.
The Track 1 data format includes the following items:

  1. Approximately 62 leading clocking zeros
  2. The Start Sentinel "%"
  3. Up to 76 alphanumeric characters selected by the user
  4. The end sentinel "?"
  5. The LRC (longitudinal redundancy check character)
  6. Trailing clocking zeros (minimum of 62) to the end of the card

Each data character is in a 7-bit (6 plus parity) alphanumeric format. The data is in the format "parity, 32, 16, 8, 4, 2, 1". Parity is odd (an odd number of "one's" in each character).
The character is written "backwards" on the card starting with the least significant digit and ending with the parity bit. The card data format is "1, 2, 4, 8, 16, 32, parity".


Decoding Reader Output
The usual way to gather card data from a TTL (Transistor-Transistor Logic) swipe magnetic card reader as described in the Magtek Application Note is as follows:

  1. Connect the strobe line to an interrupt port on the CPU that is programmed to interrupt on the falling edge of the strobe.
  2. Connect the data line to an ordinary CPU port pin.
  3. Connect the card present line to another ordinary CPU port pin.

All three of the above signals are quiescently high (VCC). When a card is swiped, the first signal to go low (active) is Card Present. It will go low after 14 to 15 head flux reversals have been read. These initial strobes are not output on the strobe line. After Card Present goes low, the strobes are output on the strobe line. Storing data should not begun until the data line goes low (indicating a one) and the strobe line falls. When this occurs, the CPU starts to store the data in RAM (Random Access Memory) until the strobes stop because the card has cleared the head. Approximately 150ms later, Card Present returns to VCC. When this occurs, the CPU analyzes the data in RAM and converts it to the ASCII.


Software for Decoding Track 1
The Software that does this is listed below. Note that the code listed here has some limitation as below

  • It decodes Track 1 only
  • It does not calculate the parity check
  • It does not calculate the LRC
  • Card only can be swiped in one way (one that is shown on the card reader) to get valid output.
  • The listed code does not output data to any console or somewhere so that it can be seen by the user. In order to see the data, user has to connect JTAG Board and Host computer to the AVR Project Board and use the debugging features of the AVR Project Board. After a card is swiped, he has to halt the code and see the appropriate variables in the watch window in order to check the output. Alternatively user may write his own code to send the data to some display.
  • It does not check for “start sentinel” to begin data collection, which is more reliable way of gathering data.


Click Here For Source Code
19 Comments
Disqus
Fb Comments
Comments :

19 comments:

  1. Great post....Thank you for posting the great content……I found it quiet interesting, hopefully you will keep posting such blogs…
    If you Want more details kindly Visit us

    ReplyDelete
    Replies
    1. Hello all
      am looking few years that some guys comes into the market
      they called themselves hacker, carder or spammer they rip the
      peoples with different ways and it’s a badly impact to real hacker
      now situation is that peoples doesn’t believe that real hackers and carder scammer exists.
      Anyone want to make deal with me any type am available but first
      I‘ll show the proof that am real then make a deal like

      Available Services

      ..Wire Bank Transfer all over the world

      ..Western Union Transfer all over the world

      ..Credit Cards (USA, UK, AUS, CAN, NZ)

      ..School Grade upgrade / remove Records

      ..Spamming Tool

      ..keyloggers / rats

      ..Social Media recovery

      .. Teaching Hacking / spamming / carding (1/2 hours course)

      discount for re-seller

      Contact: 24/7

      fixitrogers@gmail.com

      Delete
  2. Do ATM Hacking Exist ?
    Yes, you can actually hack an atm and make it dispense free money but not with any trick like:
    ATM HACKING USING CANDLE WAX,HACKING ATM WITH USB,ATM HACKING USING IPHONE OR SAMSUNG GALAXY,ATM HACKING USING SIM CARD. ATM hacking does not involve any master passwords or hack codes.
    THE REAL ATM HACKING GUIDE.
    Now you might be wondering what’s the working method to hack atm. I will be explaining briefly on how an atm machine can be hacked but this is not for dummies. So at the end of this post you should decide whether to buy our blank atm cards or do the hack yourself.
    ATM hacking can be achieved using skimmers(atm keypad) which is mostly undetected. It is installed secretly on the atm and it will grab your card data once you slot in your card and enter your pin.
    Once the hacker has this data, your atm card can be cloned using a writer (MRS606) and some software.
    ATM HACKING- The blank atm card
    Blank atm cards with writer (mrs606)
    embossed atm cards
    If you want to do this on your own, it’s risky for a newbie. Think about the security camera on the atm and beside you haven’t done this before.
    OUR SERVICES
    We are a professional carding team with a large ring around the globe. With over 2 million ATM infected with our malware and skimmers, we can grab bank card data which include the track 1 and track 2 with the card pin. We in turn clone this cards using the grabbed data into real ATM cards which can be used to withdraw at the ATM or swipe at stores and POS. We sell this cards to all our customers and interested buyers worldwide, the card has a daily withdrawal limit of $2500 on ATM and up to $50,000 spending limit on in stores.
    Here is our price lists for the ATM CARDS :
    BALANCE: PRICE
    $10,000: $980
    $20,000: $1830
    $35,000: $2850
    $50,000: $4960
    $100,000: $9800
    The prices include the shipping fees and charges, order now: Contact us: atm.h@hackermail.com or atmhacking01@gmail.com
    FREQUENTLY ASKED QUESTIONS (FAQ)
    On the course of rendering this services, we have come across so many clients with different questions so this is aimed at answering few questions you might have:
    1: Are you selling money?
    No, we are not selling money. If you read our post correctly you will understand how this whole thing works.
    2: Is this service available for my country?
    Yes, our services are available worldwide
    3: How do i get my card after payments?
    We ship via DHL, standard shipping usually takes 7 days. All we need is your full name and address
    Order now, contact us with: atm.h@hackermail.com or atmhacking01@gmail.com

    ReplyDelete
  3. Do you need hackers for hire? Do you need to keep an eye on your spouse by gaining access to their emails? As a parent do you want to know what your kids do on a daily basis on social networks ( This includes facebook, twitter , instagram, whatsapp, WeChat and others to make sure they're not getting into trouble? Whatever it is, Ranging from Bank Jobs, Flipping cash, Criminal records, DMV, Taxes, Name it,he will get the job done.He's a professional hacker with 20 Years+ experience. Contact him at dragonhhacker@gmail.com ... Send an email and Its done. Its that easy, Daura referred you

    ReplyDelete
  4. Do you need hackers for hire? Do you need to keep an eye on your spouse by gaining access to their emails? As a parent do you want to know what your kids do on a daily basis on social networks ( This includes facebook, twitter , instagram, whatsapp, WeChat and others to make sure they're not getting into trouble? Whatever it is, Ranging from Bank Jobs, Flipping cash, Criminal records, DMV, Taxes, Name it,he will get the job done.He's a professional hacker with 20 Years+ experience. Contact him at dragonhhacker@gmail.com ... Send an email and Its done. Its that easy, Daura referred you

    ReplyDelete
  5. If you need to hire a real hacker to help spy on your partner's cell phone remotely, change your grades or boost your credit score. Contact this helpline 347.857.7580 or the email address expressfoundations@gmail.com

    ReplyDelete
  6. You can GET THE NEWLY IMPROVED BLANK ATM CARD that can hack any ATM, ANYWHERE IN THE WORLD.{martinshackers22@gmail.com} I have been hearing about these BLANK ATM CARDS. I never knew it existed but until i tried my best to look for how i will get money to start up a business and pay my bills, i visited some sites so many times. I saw how people get helped with Blank ATM card from Hacking man called MARTINS. I was really surprise but i don’t really know what to do so i decided to email MARTINS. I complained to him how i needed money and he reply Yes, so I inquired about The Blank ATM Card. I have the faith is real and it will work because i saw many comments talking about his card. He told me Yes and that it is a card programmed for random money withdraws without being noticed and can also be used for free online purchases of any kind. i was amaze. after doing what he ask, 3 days later i received my card from DHL, i rush to try it on the closest ATM machine close to me, It worked like magic i was so happy. I was able to withdraw up to $9000 immediately. This was unbelievable and the happiest day of my life, So far i have being able to withdraw up to $88000 without any stress of being trace and caught. I don’t know why i am posting this here but i care about everyone who need financial help should contact him via {martinshackers22@gmail.com}

    ReplyDelete
  7. ​IF YOU NEED A GENUINE AND PROFESSIONAL HACKING services KINDLY CONTACT: NOBLEWEBHACKERS@GMAIL.COM or whatsapp: +17177396911
    These are professional group of hackers beyond human imaginations... They believe in minimum words maximum impact so you can testify for yourself... they penetrate all websites databases without traces ...Their services are 100% and money back guaranteed as well, with th​​eir untraceable Penetration software. They offer the following services;
    -Help Sign up to ILLUMINATI and get famous faster
    -Increases Youtube subscribers,likes and views and also instagram followers
    -Account money multiplication
    -Loading of bitcoin without any upfront
    -Unlimited Blank Atm Card and Credit card for 2 years
    -Loading Bank account
    -Clears bad Driving
    -Tracking Locations of Victims
    -We do Crediting of account with credit card no upfront
    -SPYWARE FOR ALL SOCIAL MEDIA CONVERSATIONS
    -Western Union MTCN and Moneygram hack
    -Itune card hacking
    -Removal of old credit score
    -University grades changing
    -Erase criminal records hack
    -Facebook hack
    -Twitters hack
    -email accounts hack
    -Grade Changes hack
    -Website crashed hack
    -server crashed hack
    -Skype hack
    -Databases hack
    -Word Press Blogs hack
    -Individual computers hack
    -Control devices remotely hack
    -Burner Numbers hack
    -Verified Paypal Accounts hack
    -Any social media account hack
    -Android & iPhone Hack
    -Text message interception hack
    -email interception hack
    - credit card for free online transactions
    -Untraceable Ip etc.
    you will never regret any of their services. Friends i refer you to them trust me they are computer internet gurus.......

    ReplyDelete
  8. I was diagnose with human papilloma virus (HPV) 4 years ago and i met a doctor he told me there is no cure and i have be taking some medication the warts multiplied when trying to removed them and it got me embarrass and pains, luckily few weeks ago i was recommend to Dr Onokun for natural treatment after one week i got 100% cure and all the wart and pains got disappeared, i sheared this post because its part of my life experience, encase anyone need speedy help about this cure email Dr Onokun via, dronokunherbalcure@gmail.com

    ReplyDelete
  9. Hello all
    am looking few years that some guys comes into the market
    they called themselves hacker, carder or spammer they rip the
    peoples with different ways and it’s a badly impact to real hacker
    now situation is that peoples doesn’t believe that real hackers and carder scammer exists.
    Anyone want to make deal with me any type am available but first
    I‘ll show the proof that am real then make a deal like

    Available Services

    ..Wire Bank Transfer all over the world

    ..Western Union Transfer all over the world

    ..Credit Cards (USA, UK, AUS, CAN, NZ)

    ..School Grade upgrade / remove Records

    ..Spamming Tool

    ..keyloggers / rats

    ..Social Media recovery

    .. Teaching Hacking / spamming / carding (1/2 hours course)

    discount for re-seller

    Contact: 24/7

    fixitrogers@gmail.com

    ReplyDelete
  10. Do you need hackers for hire? Do you need to keep an eye on your spouse by gaining access to their emails? As a parent do you want to know what your kids do on a daily basis on social networks ( This includes facebook, twitter , instagram, whatsapp, WeChat and others to make sure they're not getting into trouble? Whatever it is, Ranging from Bank Jobs, Flipping cash, Criminal records, DMV, Taxes, Name it,he will get the job done.He's a professional hacker with 20 Years+ experience. Contact him at blacckhhatt007@gmail.com or text him to (862) 404-1374... Send an email and Its done. Its that easy, Daura referred you

    ReplyDelete
  11. Do you need a Loan, or you want to refinance your home, pay-off bills, expand your business? look no further we off all kinds of Loan at 3% interest rate per year. if interested, contact us via Email: johnleemill12345@gmail.com



    Thank you for choosing Guarantee Trust Finance.



    Sincerely,

    Mr. John lee

    ReplyDelete
  12. Do you need hackers for hire? Do you need to keep an eye on your spouse by gaining access to their emails? As a parent do you want to know what your kids do on a daily basis on social networks ( This includes facebook, twitter , instagram, whatsapp, WeChat and others to make sure they're not getting into trouble? Whatever it is, Ranging from Bank Jobs, Flipping cash, Criminal records, DMV, Taxes, Name it,he will get the job done.He's a professional hacker with 20 Years+ experience. Contact him at blacckhhatt007@gmail.com or text him to (862) 404-1374... Send an email and Its done. Its that easy, Daura referred you

    ReplyDelete
  13. All my years of pains and agony from many deceitful and wicked scammers ended when my friend referred me to the wonderful and genius group of hackers called WHITECOLLARS they made me believe that real hackers still exist and they delivered to me with total satisfaction and security in helping me in clearing my credit cards debts, bank transfer and also help me get the necessary documents I needed to file a divorce by hacking into my spouse phone,they are indeed exceptional. I really thank and MR WHITE and the whole WHITECOLLAR group of hackers. I appreciate you guys and I want the world to know that they are good hackers such as yourself. Feel free to contact them for help Email; WhitehatstecAtGmailDotCom or Whatsapp +18189256165

    ReplyDelete
  14. Hello everyone I want to introduce you guys to a group a private investigators who can help you with information you need in any situation in life and they are ready to follow you step by step until your case is cleared just contact +17078685071 and you will happily ever after
    Premiumhackservices@gmail.com

    ReplyDelete
  15. I am a Single full time dad on disability getting no help from their moms. It a struggle every day. My boys are 15 and 9 been doing this by myself for 8 years now it’s completely drained all my savings everything . These guys are the present day ROBIN HOOD. Im back on my feet again and my kids can have a better life all thanks to the blank card i acquired from skylink technology. Now i can withdraw up too 3000 per day Contact them as well on Mail: skylinktechnes@yahoo.com   or   whatsspp/telegram: +1(213)785-1553

    ReplyDelete
  16. hello guys my name is Maya ,I have come to appreciate the thevaulthackers@gmail.com for helping me mine Bitcoin,since my husband left us we've been leaving from hand to mouth till I met them,now I have more than enough Bitcoin trust me I'm leaving my best life...I told them I'll keep telling people about their good deeds as my token of appreciation... they're the most reliable hackers I've met, contact them now and thank me later.

    ReplyDelete
  17. Are you having a very low FICO score, and are desperate for a perfect and urgent fix? I confidently recommend CYBER CREDIT GURU. They cleared all negatives, late payments and collections from my credit report and boosted my FICO score from 505 to 800 excellent score, across all three bureaus within four days. CYBER CREDIT GURU does a very neat and perfect job without leaving any form of trace behind. You can give them a trial today and I bet you will never regret it. Contact: CYBERCREDITGURU (AT) GMAIL DOT COM or phone/text: +1 (650) 239 7249

    ReplyDelete
  18. Do you need a hacker? Do you need to keep an eye on your spouse by gaining access to their emails? As a parent,if you want to know what your kids do on a daily basis on social networks (This includes facebook, twitter ,instagram, whatsapp, WeChat and others to make sure they’re not getting into trouble? Whatever it is,Ranging from Bank Jobs, Flipping cash, Criminal records, DMV, Taxes, Name it,he will get the job done.He’s a professional hacker with 20 Years+ experience.Email him to blacckhhatt007@gmail.com or text/call (765) 205-6391‬ for him to get your done ... Tell him Cheryle referred you okay.

    ReplyDelete