HandySwipe portable magnetic card reader

type 2 reader

The HandySwipe provides a portable magnetic card reader interface and display. It collects card data from a “Type 2″ card reader (shown here), and displays the data on a small character LCD screen. Type 2 stripes are by far the most common in use, such as on credit cards and drivers’ licenses. The device can store up to 50 cards, runs on four AA’s, and has a serial connection to download its memory to your computer in CSV format. It can also download data in a raw bistream format compatable with StripeSnoop, so you can take advantage of StripeSnoop’s powerful parsing and analysis features (LRC error checking, backwards swipes, card type/contents/issuers/etc.)

Update (6/6/06): Note, I put this page together to share my beginner electronics experience with the public. I DON’T and am NOT going to sell this as a product. Sorry. If you want to buy a portable reader, check out Mag-Stripe.com. - n.


compl
I had two real goals in making this project:
  • Play with the MagTek reader
  • Try out an efficient LCD interface for use with a PIC microprocessor
  • I got my reader for less than five bucks from All Electronics. All the parts combined are under $20.

    Here’s a shot of the completed project:

    Software

    mcpusb programmer For programming, I use the MCP-USB from Olimex. I got it from SparkFun, and I highly recommend their getting started document. It’s fully compatible with MPLAB, and I’ve never had problems with it. I cut a hole so I could just leave my programmer right in the its original box. Here it is with the 16F688 chip I used for this project.I’m using a MagTek brand TTL card reader, which has a pretty generic serial interface. The actual bits are sent using a typical data/clock pair, and there’s a “card present” line to let you know when to start paying attention.
    This diagram from the data sheet shows all three interface lines in action: card reader datashet
    One things to be aware of are that signals are all inverted (ie: card present goes LOW when you stick in a card… same for data and clock). Another trick is that all the data characters are made up of five (5) bits (as opposed to the 8 we’re used to). Use the data sheet to decode the 5-bit bytes to meaningful numbers.I use a LogicPort Logic Analyzer in most of my projects and I just love it. It gives you wonderful insight into how digital circuits behave and is worth every penny! Click for a picture of how the board looks connected to the LogicPort.
    Here’s part of what the LogicPort saw when I ran a card through the MagTek reader. The top line represents the probe connected to the Card Present pin, the middle is the Strobe (or clock) from the reader, and the bottom line is from the reader’s data pin. Sorry I didn’t get these in the same order as in the data sheet above:logicport
    I used a shift register to reduce the number of pins that were required to run the LCD display. Typically, a minimum of six pins are required. By shifting data into the shift register, you’re able to get away with only using three pins. The LCD doesn’t draw out characters quite as fast, but I’m not trying to play video games on it. If you want to know more about this, read Myke Predko’s excellent page which has great diagrams and info. He even has a plan for interfacing using only two pins. In practice, it’s probably more efficient (and definitely less soldering, software, and components!) to just buy a microprocessor with enough IO to drive the LCD directly. Still, it was an interesting exercise.
    Here’s what the menus look like as you scroll through them. You “click” the single pushbutton to go to the next menu item… you hold the pushbutton for 2 seconds to select a menu item.
    menu shots

    I use the CCS C compiler, so I can write all my code in C. I’m going to clean up the code before I post it, but if anyone’s anxious to see it please let me know. Since I didn’t draw a circuit diagram for this project I don’t think the compiled HEX file would be very useful.

    Hardware

    Short of a circuit diagram, here’s photos of the front and back of the board:

    board front
    board back
    On the back, most of the red wires are power-related, most of the blue ones are signals to/from the PIC, and the white wires are signals from the shift register to the LCD.
    Here’s a picture that labels each of the components on the front:
    labeled components
    pinout
    Here’s the pinout of the Type 2 card reader. This was taken from the MagTek data sheet.

    Results

    HS in hand Here is the “finished product” in use:

    26 Responses to “HandySwipe portable magnetic card reader”

    1. [ Randalica Men ] » Blog Archive » Magnetkarten billig auslesen… Says:

      […] Nun, die frage ist ja eigentlich nicht das auslesen, sondern das “wo” und “wie” auslesen, oder? Diese Anleitung kann sich meiner Meinung nach zumindest sehen lassen. Hier gibts es Infos, wie man sich einen portablen Katenausleser für magnetische Karten bauen kann. Ich frage mich allerdings gerade, was denn ggf. mit vorhandener Verschlüsselung ist…. Nunja, ich bin das manual auch nur kurz überflogen! Viel Spass beim lesen und überlegen… […]

    2. AlbanyWiFi.com » Blog Archive » HandySwipe portable magnetic card reader Says:

      […] camelspit.org/handyswipe/ […]

    3. Donghai Ma » links for 2006-05-03 Says:

      […] NedLog » HandySwipe portable magnetic card reader (tags: DIY electronics hacks hardware projects reference) […]

    4. links for 2006-05-03 at ebyblog Says:

      […] NedLog » HandySwipe portable magnetic card reader (tags: hacks projects diy howto) […]

    5. 2dayBlog - Technology Journal, New Gadget everyday! » Blog Archive » How-To: HandySwipe Card Reader Says:

      […] I don’t think this is a nice gadget for the bad people. Becareful with your credity card next time, they just need to get hold of your credit card for 3 second and DONE! Your information is stolen. I think i would like to make one for myself. Check out the tutorial website. […]

    6. technology guerilla » Blog Archive » Magnetkartenleser zum mitnehmen Says:

      […] Was macht man mit einem PIC, einem LCD-Display und einem Typ-2 Kartenleser ? hmm, wie wäre ein portabler Magnetkartenleser. http://camelspit.org/handyswipe/ […]

    7. Jason’s Weblog » Blog Archive » Magnetic Card Reader Says:

      […] HandySwipe portable magnetic card reader. […]

    8. james Says:

      I am very interested in the card reader. I have studied this in the passing at college, and though I got the hardware interface set up, i cannot seem to get the C code to work. I am very interested in seeing your C code if you do not mind. But I have exams in a week or so and so would like to be able to finish this before.

      thanx,
      James

    9. Txinga Says:

      I guess this is so you can steal people’s credit card info. Nice job, scumbag

    10. Fernando Says:

      This project looks very interesting, i would like to have more information about it.
      I am thinking to design a project like this for a library.
      Could be possible to get more detais,i use low level programming with mplab.
      many thanks

    11. Paul Says:

      Hello, it is a very interesting project and I would like to try it .
      where is possible to download the files for to realize this project ?

    12. lol Says:

      lol

    13. Anonymous Says:

      hello,this project looks very interesting, i would like to have more information about it.
      is it possible to have further details for the building?

    14. ADRIAN Says:

      it is a very ingenios project , and you are able to see all the data on the card ? even the pin code? can i buy one for me and my family ? i hope you will answer me , thanks you very much.

    15. AndyB Says:

      I’ve found these cheap card readers really hard to come by. All Electronics doesnt seem to stock them anymore.

      Good job though, quite like to have a go at making one, time to relight my interest in electronics.

    16. mmmm Says:

      this is some smart shit cheers

    17. Michael Says:

      Very nice! I was just thinking about this, my friend I have some ideas to improve your project, but this is close to what I was thinking. I would be very interested in talking to you and exchanging ideas, maybe even taking a peek at your code if you would allow it. Drop me an email, you can add me to your messenger if you got it.

    18. chupete Says:

      This projects seems to be really nice, where can i get the magazine to start to work on it.
      I would like to have a look at the program…would be possible??

    19. kiax Says:

      i want a skimmer, here i find some one to buy ? please help me ! nice HandySwipe i like

    20. Ziggy Says:

      This device is not for stealing PIN numbers and credit card numbers. It’s for reading the data on any kind of swipable. For example, I’d really like to know what data is kept on my driver’s license, or my student ID. It’s a damned hobby, not a way for you to steal other people’s money (ADRIAN, this means you).

      Ned, good job. Looks cool. Makes me wish I knew electronics that good.

    21. mark Says:

      could i get the c code from your project?
      i think this cool stuff

    22. Fhnio Says:

      I love how everyone words it like “I would love to have one of these so I can use it lawfully and not do anything bad…my family yes…family”

      Whereas I: “If I had one I would steal so much money.”
      But I dont’ care enough.. oh well.

    23. Jose Luis Says:

      Holla.
      I gratfully thanks to anyone
      who can help me with this
      project.I need the plans and the code for the PIC.Y can pay
      up to $100 for buying the reader functional.
      I´m from Spain.My mail is
      jose_luis_martinez43@yahoo.com

    24. Jose Luis Says:

      I can pay up to $100 for the reader,jut drop me a mail and i will soon answer.
      jose_luis_martinez43@yahoo.com

    25. raul Says:

      Hello Ned.
      Tell me why do you never ask
      to any of the asking that appears here.
      I ask you some time ago abouth the plans or the C software of this project but
      you never ask me.Why?
      You just posted this for demonstrate that you are good?

    26. Christian Says:

      Can you publish your components/schematics, etc.?

      I sure you have an interested audience.