tamashii-io / MFRC522_Ruby

MFRC522 RFID Reader Library for Raspberry Pi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

MFRC522 RFID Reader Library for Raspberry Pi

License:MIT License


Languages

Language:Ruby 100.0%