Giter Site home page Giter Site logo

nerves_io_rc522's Introduction

Nerves.IO.RC522

Build Status

Nerves support for the RC522 RFID reader.

The RC522 is a cheap RFID module which can be used to read MIFARE-compatible tags at 13.56Mhz.

Combined with a Raspberry Pi, this makes for a pretty compact RFID reader. The RC522 board is so small it easily fits inside most Raspberry Pi cases.

Image of RC522 + Pi

Limitations

Currently, only Raspberry Pi is supported as the host platform due to the usage of the BCM2835 library in the Port driver.

Furthermore, this library currently only reads the tag UID. The RC522 supports reading and writing MIFARE tag data, but this library does not yet support it.

Installation

  1. Add nerves_io_rc522 to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:nerves_io_rc522, "~> 0.1.0"}]
end
```
  1. Ensure nerves_io_rc522 is started before your application:
```elixir
def application do
  [applications: [:nerves_io_rc522]]
end
```

Usage

Add the Nerves.IO.RC522 GenServer to your supervision tree:

{Nerves.IO.RC522, {RfidReader.Handler, :tag_scanned}}

When a tag is scanned the function RfidReader.Handler.tag_scanned() function will now be called with the hex-encoded serial number (UID) of the scanned tag as its single argument.

Connecting the hardware

Connecting RC522 module to SPI is pretty easy. You can use this neat website for reference.

Board pin name Board pin Physical RPi pin RPi pin name
SDA 1 24 GPIO8, CE0
SCK 2 23 GPIO11, SCKL
MOSI 3 19 GPIO10, MOSI
MISO 4 21 GPIO9, MISO
GND 6 6, 9, 20, 25 Ground
RST 7 22 GPIO25
3.3V 8 1 3V3

License

The Elixir code of this library is distributed under the Apache license.

The files in the src directory contain the rc522 port driver, which is distributed as GPLv2, as it incorporates the BCM2835 driver library. See src/COPYING for the GPL license.

nerves_io_rc522's People

Contributors

cflegel avatar latachz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.