Adafruit PN532 RFID/NFC HELP

by BillyJ on Tue Feb 05, 2013 5:34 pm

Hi guys,

I have recently got my hands on the Adafruit PN532 board and I'm having a blast playing with it!
I have looked through the sketches and played around with them as much as I'm comfortable doing.
What i really need is a sketch that will let me add cards/remove cards from an internal database, and when a card that's in the database is presented i need a logic high sent to a pin that i can use for something else!

Kind of like a security entry system.

If anyone could help out, that would be great!
Thanks,
BillyJ
BillyJ
 
Posts: 5
Joined: Tue Feb 05, 2013 5:29 pm

Re: Adafruit PN532 RFID/NFC HELP

by ktownsend on Tue Feb 05, 2013 6:59 pm

Hi Billy:

I think you have everything you need on the PN532 side ... it looks like you just need to read the unique ID of the Mifare Ultralight or Mifare Classic card using the provided examples.

Getting that into a database and doing something with the data is a project in itself, though. Maybe someone on the forum here is interested in working on this together, or perhaps you can post it up on the Adafruit jobs forum if you're looking for someone to help you with it? http://www.adafruit.com/jobs/

Kevin
User avatar
ktownsend
 
Posts: 325
Joined: Thu Nov 05, 2009 1:18 am

Re: Adafruit PN532 RFID/NFC HELP

by BillyJ on Tue Feb 05, 2013 7:45 pm

Hi Kevin,
Thanks for the reply,
I can read the card no problems, but how would I go about adding to a database and sending a logic high if recognized?
I don't really want to post it in jobs and was hoping someone here could help? :D

Billy
BillyJ
 
Posts: 5
Joined: Tue Feb 05, 2013 5:29 pm

Re: Adafruit PN532 RFID/NFC HELP

by adafruit_support_bill on Tue Feb 05, 2013 9:36 pm

What you are asking for is custom application development. You might be fortunate enough to find someone that has what you need. But we can't write it for you.
User avatar
adafruit_support_bill
 
Posts: 28104
Joined: Sat Feb 07, 2009 9:11 am

Re: Adafruit PN532 RFID/NFC HELP

by BillyJ on Wed Feb 06, 2013 4:43 am

OK, fair enough.
where would i go looking? I've searched google, and i cant find much...
i would of thought it had been done before?

Thanks

EDIT: I'm being stupid... a better question to ask would be:
how do i edit the ladyada demo read sketch to output a high when it recognizes a certain card?
BillyJ
 
Posts: 5
Joined: Tue Feb 05, 2013 5:29 pm

Re: Adafruit PN532 RFID/NFC HELP

by adafruit_support_bill on Wed Feb 06, 2013 6:47 am

how do i edit the ladyada demo read sketch to output a high when it recognizes a certain card?

Find this section of code and add your UID test as below:

Code: Select all | TOGGLE FULL SIZE
  // Wait for an ISO14443A type cards (Mifare, etc.).  When one is found
  // 'uid' will be populated with the UID, and uidLength will indicate
  // if the uid is 4 bytes (Mifare Classic) or 7 bytes (Mifare Ultralight)
    Serial.print(".");
  success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, &uidLength, 10);
 
  if (success)
  {
    // Display some basic information about the card
    Serial.println("Found an ISO14443A card");
    Serial.print("  UID Length: ");Serial.print(uidLength, DEC);Serial.println(" bytes");
    Serial.print("  UID Value: ");
    nfc.PrintHex(uid, uidLength);
    Serial.println("");

    if (uid == MyUid) // compare with a code you know and trust
    {
      digitalWrite(13, HIGH); // Set pin 13 high
    }
  }


User avatar
adafruit_support_bill
 
Posts: 28104
Joined: Sat Feb 07, 2009 9:11 am

Re: Adafruit PN532 RFID/NFC HELP

by BillyJ on Wed Feb 06, 2013 3:47 pm

I get
Code: Select all | TOGGLE FULL SIZE
no matching function for call to 'Adafruit_NFCShield_I2C::readPassiveTargetID(int, uint8_t [7], uint8_t*, int)'


Is there a modified library your using? And how would i declare Myuid?

Thank you for your help!
BillyJ
 
Posts: 5
Joined: Tue Feb 05, 2013 5:29 pm

Re: Adafruit PN532 RFID/NFC HELP

by adafruit_support_bill on Wed Feb 06, 2013 5:41 pm

Sorry. That was for a modified library. Just leave off th last parameter - 10.
User avatar
adafruit_support_bill
 
Posts: 28104
Joined: Sat Feb 07, 2009 9:11 am

Re: Adafruit PN532 RFID/NFC HELP

by BillyJ on Thu Feb 07, 2013 2:54 pm

ahh, ok thank you very much, i'll see what can be done :D
BillyJ
 
Posts: 5
Joined: Tue Feb 05, 2013 5:29 pm