SparkFun Simultaneous RFID Reader – M6E Nano Interfacing with Arduino

Description:

The SparkFun Simultaneous RFID Reader is an Arduino-compatible board to get you started with the M6E Nano UHF RFID Reader. Radio Frequency Identification (RFID) is becoming popular everywhere for tracking practically everything. Whether you want to get started by adding an RFID reader on your toolbox with tags on all your tools or allowing access to the tree house for your secret society meetings, this board may be for you!

With the Arduino shield footprint, you can connect this directly to an Arduino-compatible board, or a different microcontroller. You can also connect directly to your computer using the FTDI header on the board and read data using the Universal Reader Assistant.

Once you’ve started, this board will read EPCglobal Gen 2 tags (see Recommended Products) at up to 150 tags per second. Writing of tags is also possible at 80msec standard write. The board has adjustable power output from 0dBm to 27dBm, meaning that with the correct antenna you can read up to 16 feet (4.9m), or 1 to 2 feet with the onboard antenna.

Read full content @www.tecexco.wordpress.com

Features:

  • EPCglobal Gen 2 (ISO 18000-6C) with nominal backscatter rate of 250kbps
  • Separate read and write levels, command adjustable from 0dBm to 27dBm in 0.01 dB steps
  • 0.84W in ready mode
  • 0.00025W in shutdown mode
  • Up to 150 tags/sec to read 96-bit EPC
  • 80msec typical for standard write of 96-bit EPC

14066-01a

Documents:

imageedit_1_7493397999

file-pdf-icon

DATASHEET OF

RFID CHIP in M6E

(clickable image)

PIN CONFIGURATION

SOFTWARE REQUIRED

ARDUINO IDE (for windows)

SCHEMATICS

Great thing about this product is that it comes with pre-configurable ardiuno library and its compatible shield. So all you need to do is :

  1. BUY
  2. ATTACH SHIELD
  3. ENJOY ^_^

14066-07_1

Other Schematics include:

Simultaneous_RFID_Tag_Reader

 

FIND FULL HARDWARE HOOKUP HERE !

 

ARDUINO SOURCE CODE

arduino-icon-2

  • /*
      Reading multiple RFID tags, simultaneously!
      By: Shubham Gupta
      Date: October 23rd, 2016
      https://tecexcirc.wordpress.com
    
      Constantly reads and outputs any tags heard
    
      If using the Simultaneous RFID Tag Reader (SRTR) shield, make sure the serial slide
      switch is in the 'SW-UART' position
    */
    
    #include <SoftwareSerial.h> //Used for transmitting to the device
    
    SoftwareSerial softSerial(2, 3); //RX, TX
    
    #include "SparkFun_UHF_RFID_Reader.h" //Library for controlling the M6E Nano module
    RFID nano; //Create instance
    
    void setup()
    {
      Serial.begin(115200);
      while (!Serial); //Wait for the serial port to come online
    
      if (setupNano(38400) == false) //Configure nano to run at 38400bps
      {
        Serial.println(F("Module failed to respond. Please check wiring."));
        while (1); //Freeze!
      }
    
      nano.setRegion(REGION_NORTHAMERICA); //Set to North America
    
      nano.setReadPower(500); //5.00 dBm. Higher values may caues USB port to brown out
      //Max Read TX Power is 27.00 dBm and may cause temperature-limit throttling
    
      Serial.println(F("Press a key to begin scanning for tags."));
      while (!Serial.available()); //Wait for user to send a character
      Serial.read(); //Throw away the user's character
    
      nano.startReading(); //Begin scanning for tags
    }
    
    void loop()
    {
      if (nano.check() == true) //Check to see if any new data has come in from module
      {
        byte responseType = nano.parseResponse(); //Break response into tag ID, RSSI, frequency, and timestamp
    
        if (responseType == RESPONSE_IS_KEEPALIVE)
        {
          Serial.println(F("Scanning"));
        }
        else if (responseType == RESPONSE_IS_TAGFOUND)
        {
          //If we have a full record we can pull out the fun bits
          int rssi = nano.getTagRSSI(); //Get the RSSI for this tag read
    
          long freq = nano.getTagFreq(); //Get the frequency this tag was detected at
    
          long timeStamp = nano.getTagTimestamp(); //Get the time this was read, (ms) since last keep-alive message
    
          byte tagEPCBytes = nano.getTagEPCBytes(); //Get the number of bytes of EPC from response
    
          Serial.print(F(" rssi["));
          Serial.print(rssi);
          Serial.print(F("]"));
    
          Serial.print(F(" freq["));
          Serial.print(freq);
          Serial.print(F("]"));
    
          Serial.print(F(" time["));
          Serial.print(timeStamp);
          Serial.print(F("]"));
    
          //Print EPC bytes, this is a subsection of bytes from the response/msg array
          Serial.print(F(" epc["));
          for (byte x = 0 ; x < tagEPCBytes ; x++)
          {
            if (nano.msg[31 + x] < 0x10) Serial.print(F("0")); //Pretty print
            Serial.print(nano.msg[31 + x], HEX);
            Serial.print(F(" "));
          }
          Serial.print(F("]"));
    
          Serial.println();
        }
        else if (responseType == ERROR_CORRUPT_RESPONSE)
        {
          Serial.println("Bad CRC");
        }
        else
        {
          //Unknown response
          Serial.print("Unknown error");
        }
      }
    }
    
    //Gracefully handles a reader that is already configured and already reading continuously
    //Because Stream does not have a .begin() we have to do this outside the library
    boolean setupNano(long baudRate)
    {
      nano.begin(softSerial); //Tell the library to communicate over software serial port
    
      //Test to see if we are already connected to a module
      //This would be the case if the Arduino has been reprogrammed and the module has stayed powered
      softSerial.begin(baudRate); //For this test, assume module is already at our desired baud rate
      while(!softSerial); //Wait for port to open
    
      //About 200ms from power on the module will send its firmware version at 115200. We need to ignore this.
      while(softSerial.available()) softSerial.read();
      
      nano.getVersion();
    
      if (nano.msg[0] == ERROR_WRONG_OPCODE_RESPONSE)
      {
        //This happens if the baud rate is correct but the module is doing a ccontinuous read
        nano.stopReading();
    
        Serial.println(F("Module continuously reading. Asking it to stop..."));
    
        delay(1500);
      }
      else
      {
        //The module did not respond so assume it's just been powered on and communicating at 115200bps
        softSerial.begin(115200); //Start software serial at 115200
    
        nano.setBaud(baudRate); //Tell the module to go to the chosen baud rate. Ignore the response msg
    
        softSerial.begin(baudRate); //Start the software serial port, this time at user's chosen baud rate
      }
    
      //Test the connection
      nano.getVersion();
      if (nano.msg[0] != ALL_GOOD) return (false); //Something is not right
    
      //The M6E has these settings no matter what
      nano.setTagProtocol(); //Set protocol to GEN2
    
      nano.setAntennaPort(); //Set TX/RX antenna ports to 1
    
      return (true); //We are ready to rock
    }

 GITHUB LIBRARY LINK

 

HAPPY INTERFACING:)

SHUBHAM GUPTA-TECEX

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s