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

 
Remove these adsRemove these ads by Signing Up

Step 1: Parts

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

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

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.

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/
pockybum5228 months ago

These are important reads if you want to learn a lot about magnetic cards and such:

http://www.phrack.org/issues.html?id=6&issue=37

http://blog.tehinterweb.com/?p=60

question. Were do I put the the car ID code into. There are no comments telling you were to put the card data???
Pooloop3 years ago
Can I use a Arduino Pro Mini?
quigath3 years ago
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.
ivankin3 years ago
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!
SuperSonik4 years ago
sketchsk3tch (author)  SuperSonik4 years ago
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.
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 (author)  purduecer4 years ago
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.
All you need is one diode to fix the voltage spike. Google for snubber diode. http://en.wikipedia.org/wiki/Flyback_diode
sketchsk3tch (author)  ScavengerHack4 years ago
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_box4 years ago
The 'buzzing' ohm meter is called a continuity tester. :)!
sketchsk3tch (author)  rdm_box4 years ago
Thanks, I knew it was testing for continuity, should have made the leap to continuity tester ;-)
frollard4 years ago
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 (author)  frollard4 years ago
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.