NFC Identification


I am using the Elechouse NFC module V3 (PN532) and an Arduino Uno, communicating via I2C. I would like to be able to produce an output upon reading a card / token programmed with a Uid stored in a list of accepted Uid's. An example may be a door entry system where I would want be able to allow access to one or more users.

I have managed to get it working with a single user by using an "if" statement which I'd imagine could be further expanded to include for other users also. My problem with this approach is that it is almost certainly not the most elegant solution and so I was wondering if somebody could suggest / show me how to compare and confirm a newly read token against a stored library of accepted codes. Would an "array" be the best method and, if so, could anyone show me how to do this?

The Uid is received in hexadecimal so far as I can tell.

if it makes any difference I could limit the maximum number of users to say 10!?

I am new with very limited experience of programming and so any help would be most appreciated.

Thank you in advance.

An array would be easiest and can allow you to control how many people and exactly who can have access.

You can try something like this:

byte size = 3;
int uids[size] = {1, 2, 3}
byte i = 0;

while(i < 3)
   if(uids[i] == readUID)

   i = i + 1;