1

I have installed an MFRC522 RFID reader in my house. The main use so far is to tell the house I've arrived using an RFID keychain, by leaving it in the key holder.

I would also like for the house to detect when I'm gone, and I was thinking that, if I can detect when a tag is present, I should also be able to detect when it is not. However, this poses some challenges like the following:

  • Should I be constantly reading the tag until it disappears from range? (when I take it from the key holder).
  • What if I have more than one RFID Keychain/Tag in the range of the reader? (because there could be other keychains in the same key holder). Would I get multiple readings or could one tag interfere with another in some way?

I realize that maybe this is not the typical RFID scenario when the tag is scanned and then moved away from the reader. I've been searching about "RFID tag absence detection" but I've only found what seemed to me like very theoretical papers.

Do you have any advice or experience in implementing something like this?

Thanks!

2

I don't think it is particularly practical, unless you make your own RFID scanner. The off-the-shelf ones generally only respond once when a particular card is in range, so you can't even detect if the card is left next the reader, or not.

Also, as the range is usually quite limited (a few cm) I don't see how it could tell the difference between you being out of the house, or taking a bath.

What might work better would be to have an active transmitter (eg. a nrf24l01) in your pocket, which every minute or so sent a "I'm home!" message to a central place. The absence of such a message after 10 minutes could indicate you are out.

The other approach would be to "check out" with your RFID scanner. I did an RFID event management system a little while back. You use a special "admin" card to indicate that a person was leaving an event for a while (a pass-out). You could do that, or have a button by the door, which you press. The "I am leaving" button.

0

Oh Yes it is possible. I did a project which allows to transmit data from RFID card to a bluetooth device.
You can use below code to identify presence & gone:

#include <SPI.h>
#include <MFRC522.h>
#include <SoftwareSerial.h>

#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.

SoftwareSerial BTserial(0, 1); // RX | TX
int sensorPin = A0;
int sensorValue = 0;
String lastBlock="";
void setup() {
    Serial.begin(9600); // Initialize serial communications with the PC
SPI.begin();            // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
//mfrc522.setPassiveActivationRetries(0x9A); // for example
//Serial.println("Scan PICC to see UID and type...");
BTserial.begin(9600); 
Serial.println("Scan PICC to see UID and type...");
}
boolean flag=false;
int counter=0;
void loop() {
// Look for new cards
BTserial.println("Scan PICC to see UID and type...");
if ( !mfrc522.PICC_IsNewCardPresent()) {
  if(mfrc522.PICC_IsNewCardPresent()){
    if(!flag){
    byte sector         = 1;
byte blockAddr      = 4;
byte dataBlock[]    = {
    0x01, 0x02, 0x03, 0x04, //  1,  2,   3,  4,
    0x05, 0x06, 0x07, 0x08, //  5,  6,   7,  8,
    0x08, 0x09, 0xff, 0x0b, //  9, 10, 255, 12,
    0x0c, 0x0d, 0x0e, 0x0f  // 13, 14,  15, 16
};

byte trailerBlock   = 7;
byte status;
byte buffer[18];
byte size = sizeof(buffer);
status = mfrc522.MIFARE_Read(blockAddr, buffer, &size);
dump_byte_array(buffer, 16); 

    flag=true;
    }
  }
  else{
    if(flag){
    flag=false;
    }
  }
      return;
}  
}

void dump_byte_array(byte *buffer, byte bufferSize) {
String a=String((char)buffer[9]);
String b=String((char)buffer[10]);
String c=String((char)buffer[11]);
String d=String((char)buffer[12]);
String str="";
str+=a;
str+=b;
str+=c;
str+=d;
lastBlock=str;
Serial.println(str);
BTserial.println(str);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.