Trying to use a NFC PN532 but the R3 wont detect it?

Im trying to just get a NFC module (PN532) to be detected by the uno r3

My wiring is ...

PN532 VCC to Arduino 5V
PN532 GND to Arduino GND
PN532 SDA to Arduino A4
PN532 SCL to Aduino A5

Actions I have taken -

-Rechecked the wiring and tried different wires.

  • Tried different libraries for the NFC module
  • I havent tried a different module because I dont have one - the one i have does power up.
  • prayed to the god of electronics

I have set the jumper to I2C mode, i think.


the code to find if I2C is connected is below...

#include <Wire.h>

void setup() {
  Wire.begin();
  Serial.begin(9600);
  while (!Serial); // Wait for serial to open
  Serial.println("I2C Scanner");
}

void loop() {
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for (address = 1; address < 127; address++) {
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address < 16) {
        Serial.print("0");
      }
      Serial.print(address, HEX);
      Serial.println("  !");
      nDevices++;
    } else if (error == 4) {
      Serial.print("Unknown error at address 0x");
      if (address < 16) {
        Serial.print("0");
      }
      Serial.println(address, HEX);
    }
  }

  if (nDevices == 0) {
    Serial.println("No I2C devices found\n");
  } else {
    Serial.println("Done\n");
  }
  delay(3000);```
1 Like

Do you have any other IIC device you could try - just to verify the diagnostic is working.

Does this module have pullup resistors fitted to these two lines? They should be pulled up to Vcc. Try adding two resistors of 3k3 or 4k7 between both of these pins and 5V.

You need to turn on your spot 3 full circles, then bow once (deeply) to the moon while Jupiter is in retrogade and make an offering of five drops of resin-core solder.

thankyou so much for your reply.

I dont believe it has pullup resistors so im trying to install them . Im not sure I really understand (im new to all this).

this is how ive installed them....

im sure this is probably wrong if someone could comment.

I would literally buy a bundle of arduino stuff for whoever finally gets this working for me. im not kidding :smiley:

That is correct but I would use 4.7K

1 Like

I used 10k because thats all I had. Ill order some 4.7k and hope it works.

definately didnt work using the design above

Which way is '1'?
Try it one way then the other. (Reset between tries.)

You can put two 10K in parallel to give 5K

1 Like

No it's not, you're doing great. Heed @jim-p 's suggestions above. Use 2x 10k in parallel for each SDA and SCL. This makes 5k on each, which should be ample.

There's a minor 'typo' in your schematic here:
image
It looks like you shorted the GND and 5V strips, but I bet you didn't do this in the real world.

Also do what @dougp suggested and try the I2C scanner sketch with a different I2C device. Maybe you have an LCD display with I2C backpack lying around, or some kind of other sensor? Give that a try.
The NFC reader is actually a fairly complex device.

thanks for your reply. and everyone else.

Your right about the typo shorting the GND, I didnt do that in real life :slight_smile: thankfully :smiley:

Unfortunately I have no i2c modules. Im very new to learning arduino. Ive ordered lots more stuff to have a play with.

I tried to wire in parallel. No luck either im afraid.

Also tried @anon85221860 idea of changing the jumpers.

I think its likely that this module is faulty but Ive ordered some more I2C devices to test them also.

Thankyou for everyones help, it is very much appreciated, ill post back here when my modules arrive in a few days.

Usually it's really user error, but it's kind of hard to tell what's going wrong here. Could be something silly like an intermittent contact involving one of the Dupont cables.

I'd suggest to set this aside for a few days until you've got some more I2C stuff you can test and then revisit it.

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