This module is very easy to setup and use. Here is how I wired it for the arduino uno.
Reset > Pin 5
SS > Pin 10
MOSI > Pin 11
MISO > Pin 12
SCK > Pin 13
Ground > Ground
3.3v > 3.3v
I used the following code example. There is also similar code at github however the comments are all in spanish. Both sets of code are basically the same code and both compiled and worked on ardiono 1.0.1. With the first code listed you do have to uncomment lines 186-196 to get it to read the card. There is a lot of code there to play with and develope a basic understanding of how to work with this module. Once you have the code compiled and uploaded just open up the serial monitor and put a card in front of the reader. You should see the data pop up in the serial monitor.
It’s probably worth noting that this code uses SPI which is Synchronous – That means that the clock signal accompanies the data signal. MOSI – Master Out Slave In; MISO – Master In Slave Out; SCK – Clock signal from master to slave; SS – Slave Select signal selects salve devices. SPI is a bus and can have multiple devices on the bus. Because the clock signal is present, SPI can be operated faster than UART.
Here is a link to my pde file. I used to have it as text in the blog post but I recently figured out that wordpress didn’t handle it well, sorry for any issues that caused.
Edited to add – I used the same code with an arduio micro and the MF522-AN
There are a couple more things I would like to take the time to point out. This post has been linked to by several sites selling this product and that is fine. And while I have written a couple articles about the MF522-AN module, I have not been compensated in any way nor have I received anything directly or indirectly from any one or any business. These are strictly my opinions based solely on my experience. If you find value in them great and if not that’s fine too. If you are like me you tend to read up on a product as much as possible before making that final decision to purchase a product. The sample code is available from various sources all linked within this article and my version of it is here.
- Fedora 19 first look
- electronics prototyping supplies