Arduino magnetic stripe decoder

Arduino magnetic stripe decoder
This instructable shows how to use some freely available code, an arduino, and a standard magnetic stripe reader to scan and display the data stored on magnetic stripe cards such as credit cards, student IDs, etc.

I was inspired to post this after reading the intro to magnetic stripe reading and Stripe Snoop that is found in MAKE magazine Volume 1. That tutorial details how to interface a stripe reader to a game port interface, but I have a mac laptop, so I don't have a game port interface!

Also, I think that the arduino suite of hardware/software is much more integrated and easy to understand for beginners than the "traditional" approach presented on the Stripe Snoop website and MAKE magazine.

However, this application simply shows the data that's on a magnetic stripe; it does not have any of the more advanced features that Stripe Snoop does.

The last step of this instructable has some links to more in-depth information about this topic for those who are interested.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Hardware

Hardware
Obviously, you first must obtain a magnetic stripe reader. I'm using an Omron V3A-4K that I ordered from digikey. It cost me $20.00 or so. If you can't find one of these, any standard TTL reader will do.

Don't worry about buying one of the fancy harnesses that they sell. There are breakout pads on the circuit board inside of the reader. Once you have received your reader, pop off the side cover, and solder wires to the pads as shown in the picture. Of course, if you have a different reader, the wiring will probably be different. In this case, consult your reader's datasheet to locate the necessary pads.

Next, connect the wires to the Arduino's digital pins as follows:

DATA - 2
CLK - 3
LOAD - 5

Finally, connect the +5v and GND to their respective terminals on the Arduino board.
« Previous StepDownload PDFView All StepsNext Step »
49 comments
1-40 of 49next »
Dec 24, 2011. 3:02 PMdudesurge says:
if you already have a magnetic strip reader why would you need to use other hardware with it?
Nov 9, 2011. 4:00 PMimhotep625 says:
i have a tranz 330 terminal i want to retrieve the track two information on HELP! : )
Sep 23, 2011. 11:06 PMkgee says:
im getting different results. when i click monitor serial port it shows numbers and symbols. but now what you have, which version of the arduino do you have? the program that is. im using 22
Aug 21, 2008. 1:48 PMnjakol says:
Really nice Instructable! I think you could feed the raw data you get from your reader to stripesnoop, look at this : http://ossguy.com/ss_usb/http://ossguy.com/ss_usb/ He has built an usb stripe reader and writes:

"This adapter converts electrical signals from a TTL magnetic stripe reader into 1's and 0's that are "typed" on the USB keyboard device that the adapter registers when it is plugged into a computer. This string of 1's and 0's can be fed into Stripe Snoop using ss -i or saved to disk for later analysis"

So you should be able to do something like that.

Yes, I read little in the docs that come with stripesnoop, it has "input mode" where you can take any bitstream as input (via stdin) so just do
yourbitstream | ss -i, in linux at least. Maybe you have to convert it to binary first, I don't know.

I have to try this myself soon, the problem is that the stripe-reader I have is of some unknown model and I don't know which of the cables is for what, but it is 5 of them so I think I should be able to use it, if I only find out which ones are the right ones. Does anybody have any ideas on how to find out?
Sep 7, 2011. 11:20 PMromisto says:
It's possible to have the raw data by Arduino ??

Give me the .pde File please. i want to have data as this :

Stripe_Data: 0001101001010111010101111100000
Stripe_Data: 111100011000100
...
Aug 20, 2011. 7:50 AMlrinetti says:
It's possible to add an LCD display to read the data on the track/s os the card ?
Dec 27, 2010. 2:18 AMstyles2012 says:
does anyone have the schematic and code for this project? Thanks any help appreciated.
Jun 14, 2011. 4:17 PMjwells5 says:
heres coding http://www.instructables.com/files/orig/FIO/E4OW/FJBYZ4TE/FIOE4OWFJBYZ4TE.tmp

heres plans let me know how it turns out.
http://m-cdn.dashdigital.com/make/vol01/#pg106

(where its says cover... change to page 106 if not set to 106
Jun 14, 2011. 3:54 PMjwells5 says:
i did this and it didn't what yours did, it only said upload finished and my board was flashing when it was uploading the coding..... also to @amaze... im not sure if this user is answring anymore.... been waiting atleast anyone with insite.
Jun 9, 2011. 9:59 PMjwells5 says:
well the .PDE file loaded to my board and i see it was rapidly blinking and then it said uploadiing done..... but it didnt read the card reader... not sure what's up with this.
Feb 10, 2011. 6:24 AMmaxell3775 says:
Good Morning, Is there a way to get the data come straight from a usb port?, instead of having is to come from a audio source, that you could connect the spoofer to a USB port and send the data, and if it is not possible with this king of design, is there a USB SWIPE CARD like Justin longs in DIe Hard 4? when he tries to bypass woodlands server room door.

THank you
Jan 14, 2011. 8:52 AMGoosen says:
Can you make a instrucable on how to make a writer?
Aug 5, 2008. 6:44 AMeatmoreart says:
This is wicked awesome, and I am going to make one of my very own. One question - does the software support all three tracks on a card, or just one? Digikey says the card reader is Track 2 only - what if you had one that was 1, 2, & 3 track?
Oct 5, 2010. 10:30 AMKataze says:
This particular reader is actually pretty easy to modify into a workable multi-track reader. http://stripesnoop.sourceforge.net/hardware/mod.html It's not pretty, but it works.
Nov 6, 2009. 1:05 PMrada194 says:
is there any way to download stuff on to it once you swipe it.
like if you swipe a boomers card can you put points on to it.
Feb 2, 2010. 5:07 AMVrIgHtEr says:
 The magnetic strip usually only stores an ID code of the card itself... The amount of points is stored at the store itself and when the card is swiped, they know which account they have to access from their own data. That's how it works afaik. Writing to the card to increase the amount of points is not possible, i think. Altering the code to access somebody else's account is theoretically possible although it's hard to pick a good ID. If, for example, the store has 100 customers, the code would probably still allow for millions of different combinations, rendering most of them useless anyway.
Mar 4, 2010. 9:55 PMel greeno says:
How about for a vending machine card?

They have no data storage system accesible to every machine.

Could you, in theory, use this to 'credit' your vending card?
May 10, 2010. 7:08 PMsporgo says:
Yes this can be done. In fact it also works for other types of cards like those used at laundromats for example. Basically any card where the data is stored locally on the card and not in a database.  Use caution when changing data on cards as some systems use both locally and remotely stored info and a difference can set off red flags. Any card which is not traceable back to you personally mod away I say.  Thats what the Doctor would do.
Mar 5, 2010. 8:31 AMVrIgHtEr says:
in theory, i think so xD *evil grin*... ... ...
Dec 5, 2009. 3:27 PMevix says:
Yeah, any info on this?

Great question...
Jan 9, 2010. 6:42 AMsampd_ says:
Great tutorial! Has anyone tried using this with an XBEE shield? Am having issues regarding which pins to use for the mag stripe reader (as the shield uses 0-7)
Mar 21, 2010. 3:32 AMalwinovich says:
try to find a pinout PDF of the reader, they are usually available through either the guys that make them or the ones that sell them
Feb 28, 2010. 5:32 AMsandman88 says:
Is it possible to store the data from the magnetic card on the Arduino's flashmemory? And get the information out of the flashmemory in a later stadium??

Thanks in advance,

a student from the Netherlands
Nov 9, 2009. 3:49 PMy4m4 says:
I did this and it works nicely. I used the Panasonic reader that only costs $3.50 from All Electronics. Check out my site below for details.

http://cal.freeshell.org/?p=21
May 29, 2009. 12:31 AMgrk says:
nice article, but how to write back data to the card? thank you!
Nov 23, 2008. 5:01 PMnetstat says:
Why in the diagram your are using data, clock and load But in the code theres only Data and Load
Apr 29, 2009. 9:07 PMlacabra says:
each of the two functions attachInterrupt operate on pins 2 & 3 (see http://www.arduino.cc/en/Reference/AttachInterrupt) to read Data using Clock to sync. Thus, it uses all three lines.
Apr 10, 2009. 6:56 PMamaze says:
I have a usb mag reader. do you know any apps take can take the raw data out my cards?
Feb 8, 2009. 2:38 PMakatsuki666 says:
finaly a code with no errors
Feb 19, 2009. 11:46 AMamando96 says:
very true!
Feb 8, 2009. 2:34 PMakatsuki666 says:
scrach that when i put in the code from the "here" button off step 2 it works (wooot)
Feb 8, 2009. 2:31 PMakatsuki666 says:
the software when put into my arduino skech it said error (this is for anything i put into my skech) anycode i put in there from any instructable it always has a error about it!!!!!!!!! anyone wana help me??????????????????????????????????
Jan 16, 2009. 4:26 PM_sleeper_ says:
ok it is a very good instructable, but what about all that electronic inside the reader? Is there not already a microcontroler?
Jan 6, 2009. 8:05 AMsychie says:
i want to know how the magnetic stripe reader is being connected to the computer that will appear the information inside the cards. i want also to if its programmable because after that i want it to be saved the information with my created program. i wish you would help me.tenx a lot...
Nov 14, 2008. 2:01 PMtest professor says:
has anyone come across any information on how to encode the card and then read it on a reader. I do not want to pay a lot of money for the encoder. So I would like to make my own encoder. not just copy but but put what i want on the card. this would be great for clubs or mine. see ya
Aug 9, 2008. 5:41 PMm1sterb0b says:
Where can I get a card reader that can read all 3 tracks? Also if I read through this correctly, the one you purchased reads only one track (right?), so if I get one that reads all 3 tracks then how can I tell which pins to solder wires to to hook up to the arduino ?
Sep 27, 2008. 6:34 AMmilo0is0hot0 says:
ebay :P they were selling 3 track readers for £30/$60 in cluding delivery
Aug 8, 2008. 3:48 PMuknative says:
I have built this with a different reader. A Panasonic one that I got off of Allelectronics. The only problem I have is that the data is all questions marks. If anyone has any suggestions please send them my way. I did just get this to work five minutes ago so I may be able to figure it out. Thanks for the great instructable to get me started.
Aug 7, 2008. 11:49 AMmutface says:
Does anybody know how to get this same program to work with a basic stamp?
1-40 of 49next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
36
Followers
2
Author:powerpants