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

Ruby version 2.3+ is required.

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

Models supported and have been tested by the author:

  • MIFARE Classic
  • MIFARE Ultralight
  • MIFARE Ultralight C
  • MIFARE DESFire EV1, without ISO-7816 APDU
  • MIFARE DESFire EV2, without ISO-7816 APDU and new features since EV1

Models implemented but not tested:

  • MIFARE Ultralight EV1

Models under development:

  • MIFARE Plus

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

The library provide basic access to ISO 14443-3 and ISO 14443-4 protocol.

Get started

Check out files in folder test for example usage.

You have to rescue exceptions yourself.