3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Turn your Arduino into a Magnetic Card Reader!

Turn your Arduino into a Magnetic Card Reader!
Everyone has used a magnetic card reader, I believe. I mean, who carries cash these days? They're not difficult to get your hands on, either, and during a trip to my favorite local electronics shop, I found a bin full of these guys. So....of course, I picked one up and brought it home to see what sort of stuff I could do with it and an AVR.

This instructable will show you how to connect a Magtek magnetic card reader to an AVR or Arduino/clone and read data from the first track of card. Buckle your seats; magnetic card readers have a high bit rate!
 
Remove these adsRemove these ads by Signing Up
 

Step 1The Equipment List

The Equipment List
Here are a few things you'll need to get started.
  • Magnetic card reader (Mine is a Magetk 90mm dual-head reader. $5.00)
  • AVR, Arduino, or clone (ATmega328p ~ $4.30 from Mouser.com
  • solderless breadboard
  • some wire
  • maybe a header if you like that sorta thing.
  • something to read your serial port. I use AVR Terminal from BattleDroids.net

That's all you should need to get started. Depending on the magcard reader you end up getting, you may have to modify these instructions, and most assuredly the code, to work with your specific reader. However, the code I've written should get you pretty far, I hope.
« Previous StepDownload PDFView All StepsNext Step »
69 comments
1-40 of 69next »
Nov 14, 2010. 7:05 AMBuild_it_Bob says:
Awesome work on this. You explained all the steps in a way that takes something that is compli cated and kept it interresting all the way through. I didn't know much about what was on a stripe and now I have at least a basic idea . Thanks for the education!
Build_it_Bob
Oct 3, 2010. 4:34 PMSpiralEdge says:
I'm new to electronics and got lost at the part where the coding begins. How did you connect the card reader to the computer in order to read data from it?
Feb 14, 2012. 4:07 PMpdrocb says:
Hello! Thanks fo your post!

I have an Arduino... but normally you have a .pde extension in the .zip i dont see any. Can you please help me, how can I use your code into Arduino.

Thank you!

Another question did you use a Magtek MiniWedge Stripe with RS232 or usb or keyboard?
Oct 1, 2010. 2:22 AMCoolKoon says:
Could you by any chance get one with a similar price that could write these cards as well? :P I could really make use of one :P
Oct 2, 2010. 2:03 PMSpaceman Spiff says:
Identity Theft anyone? Just kidding, ha ha ha.
Oct 2, 2010. 2:56 PMCoolKoon says:
Nah, I hate magnetic cards and would love to develop a way to introduce some false information on them (in a BOFH way) :D
Apr 10, 2011. 6:52 PMhintss says:
I like iButtons for that.
Oct 5, 2010. 4:41 AMCoolKoon says:
Yeah, but I'd need a writer for that as well. I suppose yours can't do that, can it?
Oct 5, 2010. 6:08 AMCoolKoon says:
I'm not really settled on mag cards, but haven't seen RFID writers either. I could make use of one too :P
Oct 9, 2010. 9:22 AMCoolKoon says:
Thanks for the idea! I even managed to find such chip at a local supplier. I'll see whether I can make it into something useful ;)
Feb 26, 2011. 3:58 AMducktape3618 says:
awesome to hack my dad his new credit card!
Jan 12, 2011. 12:02 PMjcouch1227 says:
Anyone know what that red thing is called, a header? the thing in the second picture above. thanks
Dec 5, 2010. 5:38 PMakrolik says:
Is there a link as to where a $5.00 card reader can be purchased?
Oct 24, 2010. 3:05 PMbonez13 says:
Sweet, being looking for project like this...
Sep 23, 2010. 1:25 AMlimerick says:
must say though that in general, rfid is more secure in a sense, than keypad codes as with a card, you have to have a physical credential versus a keypad code which an be obtained in several ways from 'shoulder surfing' to someone
telling another, to some dufus writing it down and misplacing it and it falls into the wrong hands.
Aug 19, 2009. 3:17 PMneedtobuild says:
Pretty sweet !
It would be cool to make a door lock for a house with this =)
Aug 20, 2009. 11:43 AMTheSodaJerk says:
You could build a pretty solid electromagnetic door lock pretty easily, and those things hold like beasts
Sep 23, 2010. 1:10 AMlimerick says:
@TheSodaJerk:

the maglocks are they are called in the locksmith/access control business
come in a number of holding force pound ratings. 300, 600, 1200, 1500 & 3000
# ratings. And they are NOT positive latching, meaning that they have to have CONSTANT power to hold. If power fails, you need sufficient battery backup amp hour capacity. hope that info helps.
Aug 20, 2009. 11:58 AMdannydutton says:
Yeah, it wouldn't be that difficult. All you would need is a heavy duty solenoid, a relay, and probably some sort of hardware from an old deadbolt.
Sep 23, 2010. 1:13 AMlimerick says:
@dannydutton - yes, it could be done. truly in a hacker spirit. you'd need to fabricate a contraption to rotate on a limited basis - a flat tailpiece to drive the bolt, and use the solenoid to drive said contraption. then of course there is your
control system. certainly doable! :)
Nov 4, 2010. 11:00 AMcarpe_noctem says:
sounds right. I'm in russia and all the soviet era apartments (pretty much all the apartments i think) have a "domofone" at the front door, which is a magnetic lock (no latch, just a beefy electromagnet and plate), some console for calling apartments, and magnetic keys and the reader. the keys are little disks in a plastic holder that allows you to put them on a key ring, not cards.
Aug 21, 2009. 5:41 PMWillTheRescue says:
Oct 17, 2009. 3:43 PMTheBestJohn says:
Electromagnets and magnetic cards are not an overall good paring.
Sep 23, 2010. 1:14 AMlimerick says:
in close proximity, that is certainly TRUE! :) good bye/scramble whatever info is encoded on your magnetic strip.
Sep 19, 2010. 10:36 AMxarlock667 says:
So, there you are, all set to go inside your house, and your card is demagnetized. Or the power is out. (With a magnetic lock, your house could be unsecured.) Electro mechanical is the way to go, but it is still useless. All that security is for nothing if I can get in your window, go through your garage, pop the face off the lock plate and bypass your circuit, or in the case of a electromagnetic lock over power the magnet with another magnet. Mechanical locks are cheaper, last longer, and do not demagnetize. Further they do not tell thieves you have anything worth protecting.
Nov 19, 2010. 6:10 PMmutput7 says:
You sound pretty pro at this sort of thing...
1-40 of 69next »

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!
63
Followers
22
Author:nevdull(The Bold Scientist)
Gian is the VP Research & Development at Open Design Strategies and holds a BA in Molecular/Cellular Biology and an MS in Computer Science. He has a collection of 8-bit microcontrollers and a room fu...
more »