You are on page 1of 4

Home Sign Up!

Browse Community Submit


All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech

Arduino Magstripe Emulator


by sketchsk3tch on August 10, 2010

Table of Contents

Arduino Magstripe Emulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Arduino Magstripe Emulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: Putting it Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 3: The Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 4: Attribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

http://www.instructables.com/id/Arduino-Magstripe-Emulator/
Intro: Arduino Magstripe Emulator
This is a simple magnetic stripe emulator. Basically you can stick this into a magnetic card reader and emulate any stripe data you'd like.

Step 1: Parts
Thin piece of ferrous metal (about 1" x 4")

Spool of enamel-covered solid-conductor copper wire (you can get this in a set at Radio Shack)

Electrical Tape

Arduino

Step 2: Putting it Together


1. Get your metal shim and wrap about 2/3 of it in electrical tape. This prevents the sharp edges from cutting through the enamel on the wire you're going to wrap the
shaft in.

2. Wrap the metal shim in wire. Just wrap and wrap. When I wrapped the wire I used an Ohm meter on the buzzing setting (not sure what the real name of it is, it's the
setting where it buzzes when resistance is low between the leads). I connect one end to the metal shaft and the other end to one of the ends of the wire I'm winding.
This way I make sure the metal shaft never cuts through the wire and connects to the metal shaft. If it does then I unwind the part I just wound and wind it differently.

3. Connect the ends of the wire to the Arduino

4. Push the sketch and your done.

http://www.instructables.com/id/Arduino-Magstripe-Emulator/
Step 3: The Sketch
I've attached the code. Magstripes use Biphase Mark Code to encode the data. Here is more information on how this
works http://en.wikipedia.org/wiki/Biphase_mark_code.

File Downloads

spoofMagstripe.pde (3 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'spoofMagstripe.pde']
Step 4: Attribution
A couple of other similar projects:

this project helped inspire mine:


http://www.soniktech.com/sdmce.php

this is another similar project:


http://www.instructables.com/id/Magnetic-stripe-card-spoofer/

Related Instructables

Arduino Turn Your


Arduino Magnetic stripe Examples #2 How to Install Arduino Into an
magnetic stripe card spoofer by Use an Arduino The the Arduino to
as a FTDI ISP by mr_mac3
decoder by powerpants RRRRRRRRRRBBA, the Lithium
powerpants Programmer by a $3 Arduino by Backpack by
qazwsx755 jackzylkin Severino

Comments
12 comments Add Comment

quigath says: Mar 9, 2011. 12:02 PM REPLY


Your code download link is messed up, it downloads as "FGD08X4GCJ0ZRF1.tmp", which I can rename to spoofMagstripe.pde but it was a bit confusing at
first.

ivankin says: Mar 2, 2011. 11:50 AM REPLY


Works perfectly!!
Anybody knows how to emulate the card's first track.
I read theory about and I don't know what seems to be the problem.
The second track works just fine, but first one is not.

I change start sentinel, I encode symbols in 7-bit instead of 5-bit for 2nd track, I add LRC byte at the end. I even tried to play much with the delay time
between bytes - nothing works.

Any ideas? Anybody did it?


Any help wanted..
Best wishes!

SuperSonik says: Aug 14, 2010. 10:33 AM REPLY


http://hackaday.com/2009/09/23/universal-cc/ =3

sketchsk3tch says: Aug 16, 2010. 7:09 AM REPLY


Yeah, that was part of the inspiration for this one. I wasn't able to get mine to work exactly the way he has it. If I understand right from the schematic he's
got one lead from the electromagnet connected directly to ground and is powering the other one. I tried that and my reader never picked it up. I modified
it so each lead of the electromagnet is connected to a different digital pin on the Arduino so I could change the polarity on the electromagnet and it
worked for me.

http://www.instructables.com/id/Arduino-Magstripe-Emulator/
purduecer says: Aug 24, 2010. 7:52 PM REPLY
If it was indeed "part of the inspiration for this one", please cite the original post in your writeup. Failure to do so violates the attribution clause in the
NCSA license on the original material.

sketchsk3tch says: Aug 28, 2010. 11:05 PM REPLY


purduecer, that's an interesting project as well, and one that apparently inspired the one that was linked to above (from hackaday). I haven't really
looked at the MP3 player spoofer, looks interesting though. I don't have a problem citing that project, even though, again I haven't really looked at
it much since I was specifically looking at using an Arduino.

ScavengerHack says: Aug 13, 2010. 10:19 PM REPLY


All you need is one diode to fix the voltage spike. Google for snubber diode. http://en.wikipedia.org/wiki/Flyback_diode

sketchsk3tch says: Aug 16, 2010. 7:06 AM REPLY


Thanks for the tip, will this still work if you're switching polarity on the electromagnet? That's why I was thinking an H-bridge might be the way to go.

rdm_box says: Aug 13, 2010. 10:30 AM REPLY


The 'buzzing' ohm meter is called a continuity tester. :)!

sketchsk3tch says: Aug 16, 2010. 7:05 AM REPLY


Thanks, I knew it was testing for continuity, should have made the leap to continuity tester ;-)

frollard says: Aug 12, 2010. 10:26 PM REPLY


You want to be REALLY careful driving an electromagnet directly from data pins. They aren't designed to handle the current, or the collapsing current kick
back after the magnet shuts off. You can quickly be out a few pins with a setup like this.

sketchsk3tch says: Aug 13, 2010. 7:45 AM REPLY


Good to know, I'll look at modifying the setup (maybe by building an h-bridge). I've actually been running like this for 3 or 4 months and haven't had a
problem so far though.

http://www.instructables.com/id/Arduino-Magstripe-Emulator/

You might also like