WiFi RFID Reader

Written by: roboguru

The main idea was to read in 13.56 MHz RFID (tags / tokes / stickers / wristbands / cards) by a magic box and post the RFID UID to a local database by WiFi network.

This instructable builds the base of the whole system - the first working RFID reader on ESP8266 WiFi SoC. (many thanks to nikxha from the ESP8266 forum for the initial help)

Step 1: Requirements

You have to install the Arduino IDE 1.6.4. or higher.

 

  • Arduino > Preferences > "Additional Boards Manager URLs:" and add:http://arduino.esp8266.com/package_esp8266com_index.json
  • Arduino > Tools > Board > Boards Manager > type in ESP8266 and install the board
  • download MFRC522 module (see Libraries) and copy folder to Arduino library path

 

Libraries

 

Step 2: Wiring RFID RC522 module

wiring the MFRC522 to ESP8266 (ESP-12)

RST     = GPIO15SDA(SS) = GPIO2MOSI    = GPIO13MISO    = GPIO12SCK     = GPIO14GND     = GND3.3V    = 3.3V

 

Step 3: Software

define RFID module

#include "MFRC522.h"#define RST_PIN 15 // RST-PIN for RC522 - RFID - SPI - Modul GPIO15 #define SS_PIN  2  // SDA-PIN for RC522 - RFID - SPI - Modul GPIO2MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance

Initialize RFID module

void setup() {  Serial.begin(9600);    // Initialize serial communications  SPI.begin();           // Init SPI bus  mfrc522.PCD_Init();    // Init MFRC522 }

Read RFID tag

void loop() {   // Look for new cards  if ( ! mfrc522.PICC_IsNewCardPresent()) {    delay(50);    return;  }  // Select one of the cards  if ( ! mfrc522.PICC_ReadCardSerial()) {    delay(50);    return;  }  // Show some details of the PICC (that is: the tag/card)  Serial.print(F("Card UID:"));  dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);  Serial.println();}// Helper routine to dump a byte array as hex values to Serialvoid dump_byte_array(byte *buffer, byte bufferSize) {  for (byte i = 0; i < bufferSize; i++) {    Serial.print(buffer[i] < 0x10 ? " 0" : " ");    Serial.print(buffer[i], HEX);  }}

Step 4: Final steps ...

As I wrote at the beginn of this short instructable, this is just the base.
But you can make many funny projects by using this hard and software.

For my next project I'm using not only the RFID module (SPI), I will use a small OLED display (I2C), and toggle button. 
The boxes are fully self configurable by one master RFID card.
There is also a webinterface to manage all boxes and add some topics, tags and description.

If I'm finished the project, I will upload it to instructables - so stay tuned.
There will be also a link here to the new tutorial.

Leave a Reply