PN532 questions

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
DerekJ
 
Posts: 6
Joined: Mon Jul 28, 2014 5:26 pm

PN532 questions

Post by DerekJ »

According to the PN532 tutorial https://learn.adafruit.com/adafruit-pn5 ... c?view=all, "The PN532 chip and breakout is designed to be used by 3.3V systems. To use it with a 5V system such as an Arduino, a level shifter is required to convert the high voltages into 3.3V."

The picture of the older v1.0 breakout only shows a 3.3V connection, but the latest v1.6 breakout https://www.adafruit.com/products/364 also has a 5V connection. The latest PN532 docs http://www.nxp.com/documents/short_data ... 32_SDS.pdf state "2.7 to 5.5V power supply operating range". Is the breakout also now 5V compatible?

Also, the UNO docs http://www.arduino.cc/en/Main/arduinoBoardUno state the "DC Current for 3.3V Pin 50mA", but the latest PN532 docs state "Transmitter supply current" is 60mA (Typ) and 150mA (Max). Is the antenna tuned to not exceed 50mA? At either 3.3 or 5V?

I was planning to use the PN532 breakout with a Teensy 3.1 using USB power.

Should I connect the
a) Teensy Vin pin to the breakout 5.0V pin?
b) Teensy 3.3V pin (only supplies 100mA) to the breakout 3.3V pin?
Do I need the level shifter? With either connection?

If I forgo the Teensy and just write code for the PC, which of the following
a) FTDI Serial TTL-232 USB Cable https://www.adafruit.com/products/70
b) Adafruit FT232H Breakout - General Purpose USB to GPIO+SPI+I2C https://www.adafruit.com/products/2264
c) FTDI Friend + extras - v1.0 https://www.adafruit.com/products/284
is the best route (strictly to read/write Mifare cards)? Advantages/disadvantages of each?

Also, the board and schematic on github are v1.4. What are the differences with v1.6?

And finally (whew), are you aware of any documentation that explains the NXP part numbering on the chip?

Thanks in advance,
Derek

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: PN532 questions

Post by adafruit_support_rick »

The recent NFC breakouts have a voltage regulator that shifts the 5V down to 3.3V. You still need to use a level shifter on the data lines if you're using it with a 5V microcontroller.

Use the 5V USB voltage to power the breakout. The teensy logic pins are 3.3V, are they not? If so, then you don't need a level shifter.

As far as the USB cables/interfaces, they're all interchangeable as far as this application is concerned.

User avatar
DerekJ
 
Posts: 6
Joined: Mon Jul 28, 2014 5:26 pm

Re: PN532 questions

Post by DerekJ »

I have the Teensy 3.1 successfully communicating with a PN532 breakout via SPI.
Fig1.png
Fig1.png (9.46 KiB) Viewed 1422 times
I have written a PC application that communicates thru the virtual serial port with the Teensy (Serial.) This prevents using the Arduino serial monitor for debugging.

I would like to use the Teensy's serial UART (Serial1) for debugging with a terminal emulator, using an FTDI USB cable.

Do I just hook up RX and TX, or do I need to connect GND and/or VCC?
Fig2.png
Fig2.png (12.78 KiB) Viewed 1422 times
NOTE: The FTDI cable may be plugged into the same PC or a different one (any additional circuitry required?)

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: PN532 questions

Post by adafruit_support_rick »

You need GND. You don't need Vcc.

User avatar
DerekJ
 
Posts: 6
Joined: Mon Jul 28, 2014 5:26 pm

Re: PN532 questions

Post by DerekJ »

If the two USB cables are plugged into different PCs, can this potentially create a ground loop? Shouldn't an isolation transformer or a resistor be added?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: PN532 questions

Post by adafruit_support_rick »

Shouldn't be necessary. The ground simply serves as a reference for the data signals.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: PN532 questions

Post by adafruit_support_rick »

You've reconfigured the jumpers to enable SPI mode on the breakout?

Can you post some pictures of your soldering and wiring?

User avatar
elix
 
Posts: 19
Joined: Tue Oct 22, 2013 2:46 pm

Re: PN532 questions

Post by elix »

I have managed to use the PN532 RFID with Teensy3.1 over I2C lines by editing the Adafruit_NFCShield_I2C.cpp library. I just added the following condition to make it work with a bunch of warnings that seem to be harmless "|| defined(__MK20DX256__)":

Code: Select all

#include <Wire.h>

#if defined(__AVR__) || defined(__i386__) || defined(__MK20DX256__)//compatibility with Intel BANNED
 #define WIRE Wire
#else // Arduino Due
 #define WIRE Wire1
#endif


#include "Adafruit_NFCShield_I2C.h"
Now, I noticed that range of my RFID reader module has decreased in comparison when I was using it with Arduino Nano! Does that make sense?!
I used to scan card tags at a distance of 3 inches when used Arduino Nano; And now, when I am using Teensy3.1, I can scan card tags at a reduced distance of roughly 1 inch!!!
I am using pull-up resistors of 2.2Kohm on I2C lines. Do I need another pull-up resistor on IRQ?

Any advice that would let me scan tags at a distance of 3 inches would be appreciated.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: PN532 questions

Post by adafruit_support_rick »

Try supplying 5V to VIN on the PN532 breakout

User avatar
elix
 
Posts: 19
Joined: Tue Oct 22, 2013 2:46 pm

Re: PN532 questions

Post by elix »

That's actually what I did, powered the RFID board through 5V supply, and pulled up the I2C lines to 3.3V of the RFID board through 2.2Kohm resistors.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: PN532 questions

Post by adafruit_support_rick »

Weird. I can't account for that. It's not a software or I2C thing. It can only have to do with the power going to the antenna.

User avatar
elix
 
Posts: 19
Joined: Tue Oct 22, 2013 2:46 pm

Re: PN532 questions

Post by elix »

I figured out what the problem was. when I was wiring the RFID board to Teensy3.1, my RFID antenna was resting on top of my breadboard. Apparently there should be no copper/metallic surfaces on neither side of the antenna for best reading range. I can now read cards at approximately 3.75 inch gap. The copper surface beneath my RFID antenna reduced the reading range by about 2.5 inches!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: PN532 questions

Post by adafruit_support_rick »

Wow - good find!

User avatar
sellithy
 
Posts: 1
Joined: Thu Nov 26, 2015 3:34 am

Re: PN532 questions

Post by sellithy »

I am sorry I am piggybacking, but i need help BEFORE buying.(I am not sure how to do that)

I wanted to know the range that the Adafruit PN532 can detect a passive HF tag.
Thank You

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: PN532 questions

Post by adafruit_support_rick »

What sore of tag? The PN532 is tested to work with MiFare tags. Range is 2-3 cm

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”