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.

Keyless Dorm Entry

Step 3Magnetic Card Reader

Magnetic Card Reader

The first step in this project is establishing how the card reader actually works. The datasheet can be found here: http://www.allelectronics.com/mas_assets/spec/MCR-12.pdf

The two most important data lines are RDT and RCT, which are data and clock respectively. The way this card reader sends what it's reading is using these two pins. When the clock line goes from 1 to 0, that means the next bit of the card is present on RDT. There is an example in the first picture.

The RDT line is inverted, meaning when the clock goes from 0 to 1, if a 0 is present on RDT, that means there's a 1 on the next bit of the card. The example above shows what might happen if the data "1101" was on the card. Note that the frequency of the clock pulses are purely dependent on the rate in which the card is scanned. They are not necessary uniform width.

The next part after grabbing the data is interpreting it. Most magnetic cards use the same format, including the school IDs. There is a picture of example data provided.

The data is in groups of 5 bits with 4 data bits and one odd parity bit. The first bit is a semi-colon, or a 'start sentinel'. It has the value of 11, and signifies the beginning of the card. There is also one parity byte at the end of the card. For this simplified design, the parity bits are ignored, because any misread card will simply result in an access denied error.

 


« Previous StepDownload PDFView All StepsNext Step »
1 comment
Dec 12, 2010. 8:14 PMmikebook says:
So I take it that this uses odd parity? Also, doesn't having the left most bit being the ones place go against most convention of binary? Finally, is the data in ASCII or is it raw binary to decimal data conversion?

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!
4
Followers
1
Author:JefffN