1

Im using ESP32 with PN532 NFC module with I2C And Im using this library https://github.com/elechouse/PN532 And using this documents https://www.elechouse.com/elechouse/images/product/PN532_module_V3/PN532_%20Manual_V3.pdf

Normally, it finds the PN532 and reads the card successfully when I scan it. However, sometimes after starting, it doesn't detect the PN532 and never finds it.It say PN53x card not found!. When I unplug and plug in the sensor cable, the ESP32 can detect the sensor, but I shouldn't have to do it this way. Therefore, if it can't find the PN532 twice, I wanted to reset it as follows:

void resetPN532() {
digitalWrite(PNP532_IRQ_Pin, LOW);
delay(100);
digitalWrite(PNP532_IRQ_Pin, HIGH);
delay(100);
digitalWrite(PNP532_RSTO_Pin, LOW);
delay(100);
digitalWrite(PNP532_RSTO_Pin, HIGH);
 }

This is code for the find:

`  uint32_t versiondata = nfc.getFirmwareVersion();
  
  if (Serial.available() > 0) {
  processCommand("command");
  }

  if (!versiondata) {
    Serial.println("PN53x card not found!");
    resetCounter++;
    if (resetCounter >= 2) {
      Serial.println("Reset PNP");
      resetPN532();
      resetCounter = 0;
    }


    return false;
  }

`

This is my connections: enter image description here

Why I faced with this issue I dont know but how can I solve this problem ?

. When I unplug and plug in the sensor cable, the ESP32 can detect the sensor, but I shouldn't have to do it this way. Therefore, if it can't find the PN532 twice, I wanted to reset it as follows:

1 Answer 1

0

i have this problem too, I checked the current source and found that the voltage source is not able to provide enough current to keep the circuit working, so the problem was solved by replacing a voltage source with a higher current. the necessary current for ESP32 is at least 500mA and i think 500mA for pn532 is enough so use at least a 1A power source

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.