Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determining the power requirements for a contactless smartcard in Java.

I am writing an application in Java that sends commands to a smartcard and parses responses over an NFC interface. This application can be used both on Android and on PC.

Using a USB contactless card reader through the PC I have no trouble connecting and communicating with any card I throw at it.

Android is another matter though. Using the application through a Nexus S produces less desirable results, depending on the card.

Some cards will connect and communicate with a 100% success rate. Most cards I have attempted to use have been very difficult to even make a connection, let alone communicate with it.

The NFC service on the Nexus S is attempting to connect with the cards. It makes a continuous low pulse sound, indicating that it cannot make a solid connection (as far as I can tell).

My current thought process is that the Nexus S has a lower powered NFC chip than the USB PC reader I'm using. From other articles I've read it seems as if different cards have different power requirements in order to use them.

How can I determine what power level is needed to power a card? Is it hidden somewhere in the ATR?

How can I determine what power level a particular NFC chip has? Is this documented somewhere?

like image 344
Brad Avatar asked Oct 07 '22 08:10

Brad


1 Answers

This kind of problem is typically caused by (a combination of) any of the following:

  1. Badly tuned antenna in the card
  2. Micro-controller card requiring much power
  3. Weak RF field generated by the NFC phone

This results in bad antenna coupling between phone and card, which results in bad or no communication. A desktop reader typically does not have this kind of problem as it generates a much more powerful field. NFC in a phone is quite low-power and the RF field it generates is often on the edge of what is still permissible by ISO 14443. The NFC chip in the Nexus S, the NXP PN544, generates a weak RF field. However, this is a function of both the NFC chip and the NFC antenna in the phone. In my experience, Type B cards often cause problems (rumor has it that they often require more power). Another example is electronic passports: the frequently have less optimal antennas.

Minimum power level required for a card: it is not in the ATR. ISO 14443 card do not have an ATR (they may have an EF.ATR file, but I have never seen any). The ATS (Answer To Select) response does not indicate required power levels. Cards have the possibility to indicate whether the power level is sufficient in the CID field of ISO 14443-4 S-Blocks (when present and supported by the card). I have never seen cards that do this, though.

To determine the power level of particular NFC chip combined with a particular antenna (and tuning circuit), you could use a spectrum analyzer to do the measurements. I measured several Android NFC phones (Galaxy Nexus, Nexus S, Galaxy S3, One X) that all contain a PN544. The results differ between phones, enough to make a difference in some cases (S3 generating the most power).

like image 164
NFC guy Avatar answered Oct 12 '22 12:10

NFC guy