Introduction: Arduino Magnetic Stripe Decoder

Picture of 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.

Step 1: Hardware

Picture of 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.

Step 2: Software

Step 3: Use It!

Finally, simply open the serial connection in the arduino applet, and start swiping cards! The decoded data from the card will appear in the window as soon as you swipe one.

Step 4: Where Do I Go From Here?

If you're interested in learning more about magnetic stripe cards, the attached article, "A Day in the Life of a Flux Reversal" by Count Zero is required reading. This document is pretty much the bible on the nuts and bolts (volts?) of how magnetic stripes physically work. It also contains information about the standard formatting of the tracks on magnetic stripes, which is helpful in interpreting data that you get from the setup shown in this instructable.

Also, check out Stripe Snoop. This software requires a slightly more complicated hardware setup, but comes with a database of known card formats and will attempt to parse human-readable data out of any card that you swipe through it. For example, if you swipe your credit card or driver's license, it will recognize it, and show you all of your personal information that is stored on that card!

Although, since this setup outputs data directly to the serial port of the computer, I'm sure that with a little code hacking it wouldn't be too hard to get this reader to interface directly to Stripe Snoop.....


hishamb91 (author)2017-09-16

i have this reader can u help me which wires i have to use for ?
thank u

uknative (author)2008-08-08

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.

BenedettoL (author)uknative2017-01-24

I also like you I used a Panasonic player and I Got the Problem of question marks, you come've Solved ????

TagTheWeb (author)2015-05-13

How could you not mention the fact that this device doesn't read track 1?

sweetphilly2. (author)2015-04-23

Where's the code located? I don't see it.

bsechini (author)2014-12-11

Where is the code?

I'm trying but nothing works. Can someone help-me, Im trying to use a CIS LCM-040 module


jwells5 (author)2011-06-09

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.

boelle11 (author)jwells52014-08-14

what PDE ?

styles2012 (author)2010-12-27

does anyone have the schematic and code for this project? Thanks any help appreciated.

jwells5 (author)styles20122011-06-14

heres coding

heres plans let me know how it turns out.

(where its says cover... change to page 106 if not set to 106

boelle11 (author)jwells52014-08-14

got a 404 on that link?

murdocjr (author)2014-08-13

Good night ..

eae guys, someone has the source code that uses eel? because I searched and found it here in sete..quem have put ae ..

goiano (author)2013-05-16

goodnight my name and Paul teclo of Brazil, people seek out the parents or friends to assist me in this work there with projects or even to experience here in Brazil terminals electronics yet most are magnetic taja like to know if you or someone read this material there is some way to try it lar and logical to get some profit out of it, I do what has to be done here in Brazil and send your part if you are interested send me an e-mail or you or someone who has interest.


murdocjr (author)goiano2014-08-13

me add

whatsshap (63)92392003

dudesurge (author)2011-12-24

if you already have a magnetic strip reader why would you need to use other hardware with it?

OCPik4chu (author)dudesurge2012-10-16

Magnetic stripe readers aren't independent devices, they always connect to a system of some kind to actually use the data, like a Point Of Sale system or security system. Just a mag stripe reader doesn't do anything. Plus this is really just a launching point for many other options, he is just showing how to read mag stripes using an Arduino

kgee (author)2011-09-23

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

aselker (author)kgee2012-07-09

What baud rate are you using?

imhotep625 (author)2011-11-09

i have a tranz 330 terminal i want to retrieve the track two information on HELP! : )

njakol (author)2008-08-21

Really nice Instructable! I think you could feed the raw data you get from your reader to stripesnoop, look at this : 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?

romisto (author)njakol2011-09-07

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

lrinetti (author)2011-08-20

It's possible to add an LCD display to read the data on the track/s os the card ?

jwells5 (author)2011-06-14

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.

maxell3775 (author)2011-02-10

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

Goosen (author)2011-01-14

Can you make a instrucable on how to make a writer?

eatmoreart (author)2008-08-05

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?

Kataze (author)eatmoreart2010-10-05

This particular reader is actually pretty easy to modify into a workable multi-track reader. It's not pretty, but it works.

powerpants (author)eatmoreart2008-08-05

no, it's only track 2....

rada194 (author)2009-11-06

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.

VrIgHtEr (author)rada1942010-02-02

 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.

el greeno (author)VrIgHtEr2010-03-04

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?

sporgo (author)el greeno2010-05-10

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.

VrIgHtEr (author)el greeno2010-03-05

in theory, i think so xD *evil grin*... ... ...

evix (author)rada1942009-12-05

Yeah, any info on this?

Great question...

sampd_ (author)2010-01-09

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)

alwinovich (author)sampd_2010-03-21

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

sandman88 (author)2010-02-28

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

y4m4 (author)2009-11-09

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.

grk (author)2009-05-29

nice article, but how to write back data to the card? thank you!

netstat (author)2008-11-23

Why in the diagram your are using data, clock and load But in the code theres only Data and Load

lacabra (author)netstat2009-04-29

each of the two functions attachInterrupt operate on pins 2 & 3 (see to read Data using Clock to sync. Thus, it uses all three lines.

amaze (author)2009-04-10

I have a usb mag reader. do you know any apps take can take the raw data out my cards?

akatsuki666 (author)2009-02-08

finaly a code with no errors

amando96 (author)akatsuki6662009-02-19

very true!

akatsuki666 (author)2009-02-08

scrach that when i put in the code from the "here" button off step 2 it works (wooot)

akatsuki666 (author)2009-02-08

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

_sleeper_ (author)2009-01-16

ok it is a very good instructable, but what about all that electronic inside the reader? Is there not already a microcontroler?

sychie (author)2009-01-06

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

test professor (author)2008-11-14

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

m1sterb0b (author)2008-08-09

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 ?

About This Instructable




More by powerpants:Magnetic stripe card spooferArduino magnetic stripe decoder
Add instructable to: