Identifying Phone with PN532 NFC Reader

I’m working with an ESP32 and a PN532 NFC tag reader, and I’ve successfully used the code
below to read NFC tags.

Now, I’d like to identify a phone (Android/iPhone) by placing it near the PN532. I’ve tried using the NFC Tool app to simulate writing text data to the card (and tried to send that data to pn532), but when I place the phone near the PN532, I don’t see any data being read by it.

Is there a way or any suggestions on how I can use a phone to get a serial ID or some data to the PN532 so i can identify that its my phone and do some task based on that

i need something like this video: https://youtu.be/_kW7hPiGi2o?t=27
i check his code (the one he added in youtube desciption rdiot-s192/basic_test.ino at master · rdiot/rdiot-s192 · GitHub ) but idk how the phone send the uid, my android phone send everytime different UID , and iphone is not sending anything

#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>

PN532_I2C pn532i2c(Wire);
PN532 nfc(pn532i2c);

void setup() {
    nfc.begin();
    nfc.setPassiveActivationRetries(0x02);
    nfc.SAMConfig();
}

void loop() {
    uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };
    uint8_t uidLength;
 
    if (nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength, 100)) {
        String hexString = "";
        for (int i = 0; i < uidLength; i++) {
            hexString += String(uid[i] >> 4, HEX);
            hexString += String(uid[i] & 0x0F, HEX);
        }
        Serial.print(hexString);
    }
}

yes that is as it should be. The UID will change every time you read the phone.
If you have a debit card or credit card in your GooglePay (or ApplePay) you could read the card data and use the PAN (primary account number) as an identifier.

So your Arduino/PN532 should act like a POS terminal and try to read the card data from the phone. That would be a possibility to get it working for Android and iPhones.

Here I have a description of how to read credit card data with a PN532 - it will also work with a smartphone

http://werner.rothschopf.net/201703_arduino_esp8266_nfc.htm

@arpa123 I am not sure if this topic helps, but I found this topic that uses the CC & Exp from the iPhone to use the PN532

Opening front door with Apple Pay : r/homeautomation (reddit.com)

HI @arpa123
I face same problem
i hope you overcome it and help me to slove it
thanks in advance

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.