How to identify user by smartphone using NFC?

I need to make a simple device that will perform some actions when the user touches it with his phone (Android or iOS).

I thought that I just needed to read the phone identifier through NFC to achieve this. I bought an Arduino Nano and RC522, plugged it in, and launched sample code from the MFRC522 library. It works well for Android and iOS, but it receives different Card IDs on every phone touch.

How to achieve this? Maybe I need to buy another NFC board? Or can I achieve this programmatically with the RC522?

There is no fast solution on that. A smartphone sends different UIDs for each scan you do. you will need an app which takes over the communication and send unique information via APDU commands. Imho there is a clear information within the UID that it is changing, if you google you will find it ...

Edit: see

2.1.1 Random ID (RID)
A single size UID with UID0 = 0x08 indicates a Random Identifier. The Random ID (RID) is dynamically generated, when the PICC powers u

therefore I use something like

    if (uid[0] == 0x08)
      Serial.println (F("I: This card has no fixed UID - don't use it for access control"));

Hi, Just saw this post while looking at NFC applications.

I see what you want to do (Grab an identifier from the phone to validate phone/user identity and trigger an action)... perhaps there is another way to do this.

Use NFC, but have the smartphone's user enter an identifier to authenticate.

It's not complicated to add the NFC interface (and BLE if you want) to any Arduino board with this module (tutorial on Github). The TapNLink PRIMER NB can be configured with a login and password for access control.

The difference is that you would tap once to establish the NFC connection and launch the app on the smartphone. Enter the login/pasword. Tap a second time to trasfer the login and password to the module.

You could also use the NFC and BLE together... tap one to launch the app and pair the Bluetooth LE connection. Then log in while connected by Bluetooth.

I know it's not exactly what you set out to do... but it may be easier at get you the access control that your want.

I am interested in knowing if you work out another solution. Always interested in seeing NFC used.