Menu

HandySwipe portable magnetic card 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.

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

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:
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:

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.

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:

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:

Here’s the pinout of the Type 2 card reader. This was taken from the MagTek data sheet.

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.

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

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.

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).

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 isjose_luis_martinez43@yahoo.com

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?