No commit activity in last 3 years
No release in over 3 years
MFRC522 RFID Reader Library for RaspberryPi
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 2.0.0, ~> 2.0.0
 Project Readme

MFRC522_Ruby

Gem Version

This project is aiming to provide easy access to MIFARE RFID tags using MFRC522 and Raspberry Pi.

The code itself can be ported to other platform with little effort since it's purely written in Ruby.

Inspired by miguelbalboa/rfid and Elmue/electronic RFID Door Lock.

Installation

You can install it by doing gem install mfrc522 or using bundler.

Documentation

RDoc is available at RubyDoc.

Hardware

This library assumes you have the reader connected to SPI0 CE0 on Raspberry Pi, and the NRSTPD(RST) pin is connected to BCM24.

If not, adjust the parameters when calling MFRC522 initialize method.

Supported RFID tags

The following models are fully supported and have been tested by the author:

  • Mifare Classic
  • Mifare Ultralight
  • Mifare Ultralight C
  • Mifare DESFire EV1

If the card model you want to use is not on the list, you can implement it on top of the PICC or ISO144434 class.

The library provide basic access to ISO 14443-3 and ISO 14443-4 protocol, so it shouldn't be a problem.

Known issue

I can't get my reader to work at baud rate higher than 106kBd, so the baud rate negotiation in ISO 14443-4 will be fixed to 106kBd until I find the workaround.

Get started

Check out files in folder test for example usage.

You have to rescue exceptions yourself.