Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.gitignore
LICENSE
OLED-MFRC522-MuMaLab.js
README.md

README.md

OLED + RFID reader


Short example of reading RFID/NFC cards by RC522/MFRC522 module and display it on OLED display (4-wire SPI). Everything is wired directly with breadboard wires to the Espruino Pico board. No external power supply needed. Just Plugin to USB Port or power by USB battery pack.
Table of Contents Espruino Pico OLED NFC

SPI OLED + RFID RC522 (#link)


Hardware

Wiring OLED display

OLED Pico
GND A5
VCC A7
SCL B13
SDA B15
RST B14
D/C A6

Wiring RFID RC522 module

RC522 Pico
GND GND
VCC VDD
CS/SS/SDA B1
SCK B3
MISO B4
MOSI B5

Initialize OLED display

var spi = new SPI();
spi.setup({mosi: B15, sck:B13});
// OLED driver and graphic library
var g = require("SSD1306").connectSPI(spi, A6, B14, function() {
  // display is connected...
  // do something 
});

Initialize RFID module

We use the SPI1 port of the Espruino Pico board.

// initial SPI1 for MRFC522 NFC module
  SPI1.setup({sck:B3, miso:B4, mosi:B5 });
  var nfc = require("MFRC522").connect(SPI1, B1/*CS*/);

Read RFID cards

// find cards
nfc.findCards(function(card) {
  print("Found card "+card);
  card = JSON.stringify(card);
  if (card=="[4,19,153,221]") digitalPulse(LED1,1,500);
  if (card=="[0,121,205,3]")  digitalPulse(LED2,1,500);
});
You can’t perform that action at this time.