Arduino and NFC
-
G'day there. I've got a few modules on order from various chinese re-sellers, so I'll be able to weigh in on this once they actually arrive and I've been able to have a bit of a play.
In the meantime, if anyone else has used a good module with their rings then let us know!When ordering, make sure you don't get an old style rfid unit at the wrong frequency. The one you want is 13.56MHz.
-
G'day there. I've got a few modules on order from various chinese re-sellers, so I'll be able to weigh in on this once they actually arrive and I've been able to have a bit of a play.
Good info, the itead module is the correct frequency. Looking forward to your results. Hopefully I will get my itead up and running again soon.
-
What so we think of this one?
Seems to tick a few boxes but would it be compatible with the rings?
-
What so we think of this one?
I actually considered buying one of those before I ended up on the itead. I ended up getting mine for less with free 2day through amazon prime, 25 usd each.
I've only used spi with my itead, not i2c, but i suppose you could break it out to spi if necessary.
I think the only limiting factor would be the antenna design, basically someone will need to test it to find out.It wouldn't surprise me to find out this is one of the modules lokki bought.
-
lol, yep. That's one of the modules I bought - I'm going to see how well it fits into a 2-way microphone, assuming it works.
-
Ok I think I'll get one of those at the end of the month. I know we're all pretty much guessing as to ring compatibility but hopefully it is.
-
Yeah until we get a good number of people playing around with various different types of module and shield we'll be running pretty much blind. But we'll get there!
-
Unfortunate news on my front. No luck getting the itead pn532 to read my ring :(
/e my only two thoughts:
Support issue?
What kind of chip is in these rings?Antenna issue?
Anyone know where I can get an nfc antenna with one of those mini coaxial connections?
I suppose I could attempt to surface mount a cellphone nfc antenna, I see quite a few of those around.found a couple antenna's, nothing coaxial yet:
3 options here: [url:1gpi40ad]http://www.mouser.com/new/pulse/pulse-nfc-antennas/[/url:1gpi40ad]
Thanks to one of Lokki's posts: [url:1gpi40ad]http://flomio.com/shop/nfc-readers/antenna/[/url:1gpi40ad]Any thoughts on designing a pcb antenna specifically for the rings? I don't know much about.... nfc antenna theory?
-
yes, I think you hit it on the nose, it is looking for mifare. Now my question is, would that be a firmware issue, or something I could solve in it's arduino lib?
Works with my other tags that I have lying around, I believe they are all mifare.
-
G'day mate, that's interesting news - are you able to verify it working with a standard tag? Did they send you any in the kit?
The rings are an NTAG203 chip from NXP. They do conform to the appropriate standards, so once you're set up to read NFC they should work.
A lot of the ebay listings send out mifare style tags that don't actually conform to the standard.So I'm less inclined to think it's an antenna issue and am leaning more towards it being an issue with how it is reading the tags and how it's dealing with the information in them - it may be that it's set up for the mifare style cards and isn't getting what it expects from the NTAG203.
-
Are you able to see a raw output of what is being read through the serial monitor? That would be useful in helping figure out exactly which point you're getting to before it borks itself.
Adafruit has a reasonable tutorial which while being for different gear should be fairly re-usable as communication is via SPI:
http://learn.adafruit.com/adafruit-pn532-rfid-nfcThere's an NTAG203 info dumper here for PN532 boards:
https://gist.github.com/stonehippo/6326056 -
lol, cool. What code are you using to read the tags with?
Also that's a pain - if they're NTAG203 as well, try finding a sweet spot with the ring. You might need to orient it a certain way and possibly slowly move it through the field in order to trigger the read. It may also not be directly on the board, it might be a couple mm above it in a certain area. I encountered this with the iCarte when I pulled it apart (it uses the same kind of pcb antenna) - reading worked best slightly above the board. -
actually, just scanned my other tags with my phone, they are ntag203, same as ring :/ so it would appear it's not a problem with scanning ntag.
that is the tutorial i used when i was getting it setup the first time months ago :P
-
Ah yep, saw that. What are you actually using to read the code after the reader unit though?
-
the lib itead supplied
http://imall.iteadstudio.com/im130625002.htmllooks like a generic lib from adafruit
// PN532 library by adafruit/ladyada // MIT license /* authenticateBlock, readMemoryBlock, writeMemoryBlock contributed */ /* by Seeed Technology Inc (www.seeedstudio.com) */ /* Modified history: */ /* Nov 5,2012 modified by Frankie.Chu at Seeed. */ /* Add some program comments of some key functions; */ /* Modified the basic interface functions spiwrite() and spiread() */ /* to be write() and read(),and they will call the functions of */ /* class SPIClass but not to simulate timing of SPI; */ /* Rename all of the functions to be like the abAbAb; */ /* Modified the constructor of PN532 class; */
-
Ah yep, saw that. What are you actually using to read the code after the reader unit though?
what do you mean?just tried the spi lib straight from adafruit's github, same thing. works fine with my other tags but nothing on the ring.
I've put the ring in just about every conceivable position. If there was a sweetspot i feel i would have found it by now./e
turned on debugging in the lib, its not picking up anything from the ring, doesn't seem to be an issue with the lib as far as i can tell -
Ok, maybe I'm looking at the wrong reader unit here - the one I'm seeing is an all-in-one reader which outputs to another device via SPI. That device is an Arduino? I'm wondering what code you're running on that.
-
Yah, my pn532 is communicating with my uno via spi. I've just been testing with the example files in the lib rather than my lock code. Same setup as that video I posted, I've just removed the strike from the equation.
I enabled debugging in the lib which was spitting out the unadulterated spi stream. No data while holding the ring in various positions.
Reading: 0x0 0x0 0xFF 0x0 0xFF 0x0According to the app on my phone (NFC TagInfo) the chip in the tag that works is identical to the chips in the ring aside from the id.
Tom replied to my email and said they would look into getting some inlays sent to me, so hopefully I will be able to test with one of those as well soon.
What NFC modules have you ordered? I will start looking around and order some in the next few days so we cover a larger spectrum in our testing. Will be ordering various antenna's as well, I still have a nagging feeling that is the problem with mine./**************************************************************************/ /*! @brief Reads n bytes of data from the PN532 via SPI @param buff Pointer to the buffer where data will be written @param n Number of bytes to be read */ /**************************************************************************/ void Adafruit_PN532::readspidata(uint8_t* buff, uint8_t n) { digitalWrite(_ss, LOW); delay(2); spiwrite(PN532_SPI_DATAREAD); #ifdef PN532DEBUG Serial.print("Reading: "); #endif for (uint8_t i=0; i<n; i++) { delay(1); buff[i] = spiread(); #ifdef PN532DEBUG Serial.print(" 0x"); Serial.print(buff[i], HEX); #endif } #ifdef PN532DEBUG Serial.println(); #endif digitalWrite(_ss, HIGH); }
/**************************************************************************/ /*! @brief Low-level SPI read wrapper @returns The 8-bit value that was read from the SPI bus */ /**************************************************************************/ uint8_t Adafruit_PN532::spiread(void) { int8_t i, x; x = 0; digitalWrite(_clk, HIGH); for (i=0; i<8; i++) { if (digitalRead(_miso)) { x |= _BV(i); } digitalWrite(_clk, LOW); digitalWrite(_clk, HIGH); } return x; }
-
Ah ok, thanks for that - I'm still waiting for my modules to turn up so that I can form a more knowledgeable opinion on things. Probably should have ordered them earlier!
http://www.ebay.com.au/itm/321097986980
http://www.ebay.com.au/itm/221249331693
http://www.ebay.com.au/itm/161120806341
http://www.ebay.com.au/itm/151217926952
http://www.ebay.com.au/itm/321324810397A bit of a scattergun approach, but I'll end up using them all I'm sure.
-
Well, I got my small red unit after work today... and it is a pain to get working. The seller provided sketch refuses to compile and the adafruit one isn't set up properly for the unit. Sigh.
So, I'm playing around with getting that one working at all, let alone with the rings.