NFC Shield for Arduino - PN532 & LibNFC

by Mimi_Salade on Mon Aug 13, 2012 4:05 pm

Hi everybody !

I just got my brand new NFC Shield from Adafruit and I'd like to use it with LibNFC.
I installed everything correctly on both Ubuntu & Backtrack.
The shield is on an Arduino Uno and connected to my computer using the USB cable plugged in the Arduino.
I think I might need a FTDI cable to communicate with my computer.
Could you tell me if there's a way to do that simply using the USB cable plugged in the Arduino ?
If that's not possible, can I build my own cable easily ? I'll buy one otherwise...

Just a last question : I also have an Arduino Leonardo but the shield doesn't seem to work fine with it. Will Adafruit release a library for this Arduino soon ?

Thank you very much for your time and patience.
Kind regards.
Kate.
Mimi_Salade
 
Posts: 11
Joined: Sun Aug 12, 2012 2:24 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

by adafruit_support_rick on Mon Aug 13, 2012 4:44 pm

Mimi_Salade wrote:Hi everybody !

I just got my brand new NFC Shield from Adafruit and I'd like to use it with LibNFC.
I installed everything correctly on both Ubuntu & Backtrack.
The shield is on an Arduino Uno and connected to my computer using the USB cable plugged in the Arduino.
I think I might need a FTDI cable to communicate with my computer.
Could you tell me if there's a way to do that simply using the USB cable plugged in the Arduino ?
If that's not possible, can I build my own cable easily ? I'll buy one otherwise…

You should be able to just be able to directly connect to the UNO with a USB cable. The UNO should show up as something like /dev/ttyUSB0 or /dev/ttyACM0.

I have unbuntu 11.04, and the UNO shows up as /dev/ttyACM0:
unoubuntu.png
unoubuntu.png (111.62 KiB) Viewed 3859 times


Have a look at LadyAda's tutorial on connecting to Linux:
http://www.ladyada.net/learn/arduino/lesson0-lin.html

Just a last question : I also have an Arduino Leonardo but the shield doesn't seem to work fine with it. Will Adafruit release a library for this Arduino soon ?

Unfortunately, the pinout on the Leonardo is not compatible with the NFC shield. The shield would require hardware as well as software modifications in order to work with the Leo
User avatar
adafruit_support_rick
 
Posts: 8435
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: NFC Shield for Arduino - PN532 & LibNFC

by Mimi_Salade on Sun Aug 19, 2012 7:25 am

Thanks for your message. Unfortunately, LibNFC doesn't seem to find my arduino and my NFC shield.
When I plug in my arduino, Ubuntu links it to /dev/ttyACM0. I also created a symbolink link from /dev/ttyUSB0 to /dev/ACM0 (just in case...)
Are you sure it is possible to use LibNFC without a FTDI cable and just with the Arduino Uno ?
Am I missing something ? nfc-list always says : "pn53x_check_communication: Operation timed-out"
Do I need to upload a special program to my Arduino ?

Thanks for your help :)
Mimi_Salade
 
Posts: 11
Joined: Sun Aug 12, 2012 2:24 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

by adafruit_support_rick on Sun Aug 19, 2012 11:37 am

Sorry - I thought you were asking about connecting to the arduino. For LibNFC you'll need an FTDI Friend or an FTDI cable.
http://www.adafruit.com/products/284
http://www.adafruit.com/products/70
User avatar
adafruit_support_rick
 
Posts: 8435
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: NFC Shield for Arduino - PN532 & LibNFC

by Mimi_Salade on Tue Nov 20, 2012 7:32 am

Hi! I'm back.

It's been a while, but I have a FTDI friend now.
I don't understand very well how to wire it, and i've seen it was possible to mess up with the +5V on the Shield (should I have taken the breakboard?).

Here is a photo of what I have now. Could you please help me wiring it correctly?
I just want to use the Shield with my computer (LibNFC and stuff...).
Will I be able to connect it with a USB cable?

Thank you very much for your help and sorry for my dumbness.
Kate.

0075.png
NFC Shield and FTDI Friend
0075.png (593.73 KiB) Viewed 3462 times
Mimi_Salade
 
Posts: 11
Joined: Sun Aug 12, 2012 2:24 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

by adafruit_support_rick on Tue Nov 20, 2012 1:20 pm

Hi, Kate -

To use the FTDI Friend with the NFC Shield, you simply connect the TX, RX, and GND lines between the Friend and the shield.

You can power the shield by leaving it plugged into an arduino, or you can power the shield stand-alone by also connecting the 5V line from the Friend.

There is a six-hole area where you can solder either a male or female header. This is where the TX and RX lines connect (you can also permanently solder wires directly to the holes, without using a header strip, if you plan to always use the shield this way).

Connect the shield to the Friend as follows:
Friend Shield
TXO SS
RXI MOSI
5V 5V
GND GND

For 5V and GND, there are open holes on the shield, right next to the 5V and GND holes where the arduino header pins are soldered.

Finally, you need to configure SEL0 and SEL1 for UART mode. Melt a blob of solder to bridge across the copper pads at SEL0, and make sure that there is NO connection between the pads at SEL1. Note that, once you do this, the shield will no longer work with the arduino, since the shield is no longer configured to communicate with either SPI or I2C. If you want to go back to using the shield with the arduino, you will have to undo the changes you made to SEL0 and SEL1
User avatar
adafruit_support_rick
 
Posts: 8435
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: NFC Shield for Arduino - PN532 & LibNFC

by Mimi_Salade on Wed Nov 21, 2012 4:39 am

Thank you very much for your clear explanations.
I had done a few tests close to what you describe, but I had used the wrong pins for SS and MOSI.
I'll try again with the right ones, hope it will work fine.
I'm also looking for a temporary solution to solder the selector 0. For now, I have a tiny piece of copper held by a plastic clip.
It would be nice to have jumpers on those connections.

Thanks again for your help :)
Kate.
Mimi_Salade
 
Posts: 11
Joined: Sun Aug 12, 2012 2:24 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

by adafruit_support_rick on Wed Nov 21, 2012 11:35 am

I'm also looking for a temporary solution to solder the selector 0. For now, I have a tiny piece of copper held by a plastic clip.
It would be nice to have jumpers on those connections.

You can solder a cut-off resistor lead across it. Un-solder and lift one end to disconnect. The NFC breakout has jumper pins, but the recommended mode for NFC shields is I2C, so the jumper pins weren't used. Maybe in the future we could drill the pads, giving users the option to add jumper pins. I'll pass along the suggestion.
User avatar
adafruit_support_rick
 
Posts: 8435
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: NFC Shield for Arduino - PN532 & LibNFC

by Mimi_Salade on Wed Nov 21, 2012 2:22 pm

Thank you for your answer. I know i'm complaining about things I could find on the breakout board, but I thought it would be nice to have only one board for both serial and Anrduino use.

Guess I'll have to stick to the Arduino usage because I wasn't able to make it work the way you described.
I properly connected the MOSI and SS pins but I think there is no communication between the board and the FTDI friend...

:cry:
Mimi_Salade
 
Posts: 11
Joined: Sun Aug 12, 2012 2:24 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

by Mimi_Salade on Thu Nov 22, 2012 6:54 am

This is driving me crazy :shock:
I had a close look to the datasheets, searched across lots of forums, tried other pins.
I just can't make it work.

Do I have to change the baud rate of my FTDI friend ? Do the MOSI and SS pins match the TX and RX serial connections ?
The FTDI friend communicates with LibNFC (the debug is clear) but nothing reaches the shield.

Any idea ? I'd really love to play with it :(
Mimi_Salade
 
Posts: 11
Joined: Sun Aug 12, 2012 2:24 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

by satspace on Thu Nov 22, 2012 11:22 am

Mimi_Salade wrote:This is driving me crazy :shock:
I had a close look to the datasheets, searched across lots of forums, tried other pins.
I just can't make it work.

Do I have to change the baud rate of my FTDI friend ? Do the MOSI and SS pins match the TX and RX serial connections ?
The FTDI friend communicates with LibNFC (the debug is clear) but nothing reaches the shield.

Any idea ? I'd really love to play with it :(



I have the same doubt but I suppose the concept is tx with rx
satspace
 
Posts: 4
Joined: Wed Nov 21, 2012 9:47 am

Re: NFC Shield for Arduino - PN532 & LibNFC

by ktownsend on Thu Nov 22, 2012 6:18 pm

Normally with UART the RXD pin on one side gets connected to the TXD pin on the other side, and vice versa for the other pin. The UART connection should work out of the box but libnfc can also be extremely finicky if it isn't built correctly or depending on the version, and I found some versions simply wouldn't detect the board even if it was properly connected. I have also only ever used Ubuntu and we have no means to verify anything else.

Have you looked here, BTW? ... http://www.ladyada.net/products/rfidnfc/libnfc.html

You also need to be sure that you are setting the PN532 to use UART as a bus, but this is really only easy to do with the breakout (which also contains a connector for the FTDI cables on purpose). I would really recommend using the breakout board since it was designed for libnfc, and we can only guarantee and directly support the shield in the intended use of I2C with an Arduino since this is the scenario that they are tested with during manufacturing.
User avatar
ktownsend
 
Posts: 277
Joined: Thu Nov 05, 2009 1:18 am

Re: NFC Shield for Arduino - PN532 & LibNFC

by Mimi_Salade on Fri Nov 23, 2012 5:05 am

Hi !

That's what I did : TX to RX and RX to TX.
Board in UART mode (SEL0 closed).
I had already read the tutorial from Ladyada.
I'll try compiling other versions of Libnfc.

Edit : 1.4, 1.5, 1.6 : same problem. No ACK received from PN532.
Mimi_Salade
 
Posts: 11
Joined: Sun Aug 12, 2012 2:24 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

by ktownsend on Sat Nov 24, 2012 2:10 pm

What are you powering the board with? When the magnetic field is active these boards draw a decent amount of current.
User avatar
ktownsend
 
Posts: 277
Joined: Thu Nov 05, 2009 1:18 am

Re: NFC Shield for Arduino - PN532 & LibNFC

by satspace on Sat Nov 24, 2012 3:59 pm

ktownsend wrote:What are you powering the board with? When the magnetic field is active these boards draw a decent amount of current.


Hi, I'm the same point of Mimi_Salade

Same tests, same problems... (also tested with latest libnfc 1.6rc1) "ERROR: Unable to open NFC device" ALWAYS

And to answer about current: I also tried to power the shield with external cc 5v power supply, same situation.

Any idea at this point ?
satspace
 
Posts: 4
Joined: Wed Nov 21, 2012 9:47 am