// ULTIMATE PN532 TEST CODE
#include <Wire.h>
// Try these pin combinations IN ORDER:
#define SDA_PIN 8 // D5 - Try FIRST
#define SCL_PIN 9 // D6
//#define SDA_PIN 21 // D10 - Try SECOND
//#define SCL_PIN 18 // D9
// #define SDA_PIN 11 // A4 - Try THIRD
// #define SCL_PIN 12 // A5
void setup() {
Serial.begin(115200);
delay(2000); // Wait for serial
Serial.println("\n=================================");
Serial.println("PN532 PRECISE MODULE TESTER");
Serial.println("=================================");
Serial.println("\n⚙️ CONFIGURATION CHECK:");
Serial.println("1. Module should say: 'PN532 NFC Precise'");
Serial.println("2. Look for SEL0/SEL1 or I2C/SPI/HSU pads");
Serial.println("3. For I2C: Bridge SEL0 and SEL1");
Serial.println("4. Power: 3.3V (NOT 5V!)");
Serial.println("=================================\n");
Wire.begin(SDA_PIN, SCL_PIN);
// Test I2C communication
testI2C();
}
void testI2C() {
Serial.println("🔍 Scanning I2C bus...");
Serial.println("(Common PN532 addresses: 0x24, 0x48)");
byte foundCount = 0;
// Try standard PN532 addresses
uint8_t pn532Addresses[] = {0x24, 0x48, 0x42, 0x4E};
for(int i = 0; i < 4; i++) {
Wire.beginTransmission(pn532Addresses[i]);
byte error = Wire.endTransmission();
if(error == 0) {
Serial.print("\n✅ SUCCESS! Found PN532 at 0x");
Serial.println(pn532Addresses[i], HEX);
Serial.println(" I2C mode is WORKING correctly!");
foundCount++;
// Additional test
testPN532Communication(pn532Addresses[i]);
}
}
if(foundCount == 0) {
Serial.println("\n❌ NO PN532 FOUND!");
Serial.println("\n🔧 TROUBLESHOOTING STEPS:");
Serial.println("1. CHECK MODE SETTINGS:");
Serial.println(" • Find SEL0/SEL1 pads on your module");
Serial.println(" • BRIDGE BOTH with solder or wire");
Serial.println(" • OR find I2C pads and bridge them");
Serial.println("\n2. CHECK WIRING:");
Serial.println(" PN532 SDA → D5 (GPIO8)");
Serial.println(" PN532 SCL → D6 (GPIO9)");
Serial.println(" PN532 VCC → 3.3V (NOT 5V!)");
Serial.println(" PN532 GND → GND");
Serial.println("\n3. TRY DIFFERENT PINS:");
Serial.println(" Change code to use D10/D9 instead");
Serial.println("\n4. ADD PULL-UP RESISTORS:");
Serial.println(" Connect 4.7kΩ from SDA to 3.3V");
Serial.println(" Connect 4.7kΩ from SCL to 3.3V");
}
}
void testPN532Communication(uint8_t address) {
Serial.println("\n📡 Testing PN532 communication...");
// Send wakeup command
Wire.beginTransmission(address);
Wire.write(0x00); // Preamble
Wire.write(0x00); // Start code
Wire.write(0xFF); // Wakeup
byte error = Wire.endTransmission();
if(error == 0) {
Serial.println("✅ PN532 responding correctly!");
} else {
Serial.println("⚠️ PN532 found but not responding");
}
}
void loop() {
// Blink built-in LED if pin 13 exists
static unsigned long lastBlink = 0;
if(millis() - lastBlink > 1000) {
lastBlink = millis();
digitalWrite(13, !digitalRead(13));
}
}
What is the question and where is the schematic?
Here’s some help: How to get the best out of this forum - Projects / General Guidance - Arduino Forum
Please read the advice in the link again.
Mystery photos are of no help.

