html{overflow-x:hidden;max-width:100vw} .{{async}}:not([data-{{type}}="outgoing"]) + .{{async}}:not([data-{{type}}="outgoing"]){display:none} [data-{{status}}]{background-color:transparent;transition:background-color .2s ease} [data-{{status}}]{position:relative;overflow:hidden;border-radius:3px;z-index:0} .{{cross}}{transition:box-shadow .2s ease;position:absolute;top:-0px;right:0;width:34px;height:34px;background:#000000;display:block;cursor:pointer;z-index:99;border:none;padding:0;min-width:0;min-height:0} .{{cross}}:hover{box-shadow:0 0 0 50px rgba(0,0,0,.2) inset} .{{cross}}:after, .{{cross}}:before{transition:transform .3s ease;content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;width:calc(34px / 2);height:3px;background:#ffffff;transform-origin:center;transform:rotate(45deg);margin:auto} .{{cross}}:before{transform:rotate(-45deg)} .{{cross}}:hover:after{transform:rotate(225deg)} .{{cross}}:hover:before{transform:rotate(135deg)} .{{timer}}{position:absolute;top:-0px;right:0;padding:0 15px;color:#ffffff;background:#000000;line-height:34px;height:34px;text-align:center;font-size:14px;z-index:99} [data-{{type}}="outgoing"].center .{{timer}},[data-{{type}}="outgoing"].center .{{cross}}{top:0!important} .{{timer}} span{font-size:16px;font-weight:600} [data-{{type}}="outgoing"]{transition:transform 300ms ease,opacity 300ms ease,min-width 0s;transition-delay:0s,0s,.3s;position:fixed;min-width:250px!important;z-index:9999;opacity:0;background:#ffffff;pointer-events:none;will-change:transform;overflow:visible;max-width:100vw} [data-{{type}}="outgoing"] *{max-width:none} [data-{{type}}="outgoing"].left-top [id*="yandex_rtb_"], [data-{{type}}="outgoing"].right-top [id*="yandex_rtb_"], [data-{{type}}="outgoing"].left-center [id*="yandex_rtb_"], [data-{{type}}="outgoing"].right-center [id*="yandex_rtb_"], [data-{{type}}="outgoing"].left-bottom [id*="yandex_rtb_"], [data-{{type}}="outgoing"].right-bottom [id*="yandex_rtb_"]{max-width:336px;min-width:160px} [data-{{type}}="outgoing"]:after,[data-{{type}}="outgoing"]:before{display:none} [data-{{type}}="outgoing"].{{show}}{opacity:1;pointer-events:all;min-width:0!important} [data-{{type}}="outgoing"].center{position:fixed;top:50%;left:50%;height:auto;z-index:2000;opacity:0;transform:translateX(-50%) translateY(-50%) scale(.6)} [data-{{type}}="outgoing"].center.{{show}}{transform:translateX(-50%) translateY(-50%) scale(1);opacity:1} [data-{{type}}="outgoing"].left-top{top:0;left:0;transform:translateX(-100%)} [data-{{type}}="outgoing"].top-center{top:0;left:50%;transform:translateX(-50%) translateY(-100%)} [data-{{type}}="outgoing"].right-top{top:0;right:0;transform:translateX(100%)} [data-{{type}}="outgoing"].left-center{top:50%;left:0;transform:translateX(-100%) translateY(-50%)} [data-{{type}}="outgoing"].right-center{top:50%;right:0;transform:translateX(100%) translateY(-50%)} [data-{{type}}="outgoing"].left-bottom{bottom:0;left:0;transform:translateX(-100%)} [data-{{type}}="outgoing"].bottom-center{bottom:0;left:50%;transform:translateX(-50%) translateY(100%)} [data-{{type}}="outgoing"].right-bottom{bottom:0;right:0;transform:translateX(100%)} [data-{{type}}="outgoing"].{{show}}.left-center, [data-{{type}}="outgoing"].{{show}}.right-center{transform:translateX(0) translateY(-50%)} [data-{{type}}="outgoing"].{{show}}.top-center, [data-{{type}}="outgoing"].{{show}}.bottom-center{transform:translateX(-50%) translateY(0)} [data-{{type}}="outgoing"].{{show}}.left-top, [data-{{type}}="outgoing"].{{show}}.right-top, [data-{{type}}="outgoing"].{{show}}.left-bottom, [data-{{type}}="outgoing"].{{show}}.right-bottom{transform:translateX(0)} .{{overlay}}{position:fixed;width:100%;height:100%;pointer-events:none;top:0;left:0;z-index:1000;opacity:0;background:#0000008a;transition:all 300ms ease;-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px)} [data-{{type}}="outgoing"].center.{{show}} ~ .{{overlay}}{opacity:1;pointer-events:all} .{{fixed}}{position:fixed;z-index:50} .{{stop}}{position:relative;z-index:50} .{{preroll}}{position:relative;overflow:hidden;display:block} .{{preroll}}:has(iframe){padding-bottom:56.25%;height:0} .{{preroll}} iframe{display:block;width:100%;height:100%;position:absolute} .{{preroll}}_flex{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.65);opacity:0;transition:opacity .35s ease;z-index:2} .{{preroll}}_flex.{{show}}{opacity:1} .{{preroll}}_flex.{{hide}}{pointer-events:none;z-index:-1} .{{preroll}}_item{position:relative;max-width:calc(100% - 68px);max-height:100%;z-index:-1;pointer-events:none;cursor:default} .{{preroll}}_flex.{{show}} .{{preroll}}_item{z-index:3;pointer-events:all} .{{preroll}}_flex .{{timer}}, .{{preroll}}_flex .{{cross}}{top:10px!important;right:10px!important} .{{preroll}}_hover{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;z-index:2} .{{preroll}}_flex:not(.{{show}}) .{{preroll}}_hover{cursor:pointer} .{{hoverroll}}{position:relative;overflow:hidden;display:block} .{{hoverroll}}_item{position:absolute;bottom:0;left:50%;margin:auto;transform:translateY(100%) translateX(-50%);transition:all 300ms ease;z-index:1000;max-height:100%} .{{preroll}}_item [id*="yandex_rtb_"], .{{hoverroll}}_item [id*="yandex_rtb_"]{min-width:160px} .{{hoverroll}}:hover .{{hoverroll}}_item:not(.{{hide}}){transform:translateY(0) translateX(-50%)} .{{slider}}{display:grid} .{{slider}} > *{grid-area:1/1;margin:auto;opacity:0;transform:translateX(200px);transition:all 420ms ease;pointer-events:none;width:100%;z-index:0} .{{slider}} > *.{{hide}}{transform:translateX(-100px)!important;opacity:0!important;z-index:0!important} .{{slider}} > *.{{show}}{transform:translateX(0);pointer-events:all;opacity:1;z-index:1} .{{slider}} .{{timeline}}{width:100%;height:2px;background:#f6f5ff;position:relative} .{{slider}} .{{timeline}}:after{content:'';position:absolute;background:#d5ceff;height:100%;transition:all 300ms ease;width:0} .{{slider}} > *.{{show}} .{{timeline}}:after{animation:timeline var(--duration) ease} .{{slider}} > *:hover .{{timeline}}:after{animation:timeline-hover} @keyframes timeline-hover{} @keyframes timeline{0% {width:0}100% {width:100%}}

NFC eeprom

Smartphone as payment method

NFC is ISO 14443 compliant and integrates many contactless cards, including bank cards that support MasterCard PayPass or VISA PayWave. The plastic card contains a microprocessor with an OS and a payment application for interacting with the data of a specific client. As soon as the card is inserted into or swiped across the terminal, it receives power to run the operating system. In the case of contactless cards, power, as we have already said, is obtained using the electromagnetic field of the reader.

With the advent of contactless cards, in fact, not necessarily a card can act as a payment instrument, but a smartphone, watch, key fob, and so on – it’s not the form that matters, but the presence of the necessary set of functions. Indeed, in smartphones with NFC support, as well as in plastic cards, there is a microprocessor. From Android 4.

To manage contactless applications remotely, smartphone manufacturers and service providers connect to TSM, a service that provides access to secure data on NFC-enabled terminals. It remotely controls the Secure Element chips in smartphones, while the smartphone itself is a kind of modem operating through a secure communication channel.

When making purchases over 1,000 rubles, you may be asked to enter a PIN code or sign a receipt – everything depends on the bank.

Connection and setup

The RFID/NFC scanner connects via the I²C/TWI protocol and uses the IRQ interrupt pin. To assemble the module, three three-wire loops are used.

When connected to Arduino or Iskra JS, it is convenient to use Troyka Shield.

NFC Tags

This is another common way to use NFC on a smartphone. NFC tags have become very popular in shopping and advertising areas: they are embedded in posters, billboards, placed on goods in stores. Usually these are small stickers, the cost of which does not exceed 50 rubles. The costs are minimal, but what an effect! From getting more details about a concert or merchandise to a link to a trailer for a new movie.

NFC eeprom

You can create your own NFC tags, upgrade them, and then use them in your daily life. As a rule, third-party software like NFC TagWriter is used for this. The application is quite simple and allows you to write many types of data to the tag – from a contact and a phone number to a web browser bookmark.

In fact, NFC tags are a real gift when it comes to automation. For example, you can stick a tag on your laptop and use the Trigger app to set the hotspot to turn on by selecting “Wireless & LAN” as the action. The simpler solution is to write the Wi-Fi password on the tag, stick it on the router, and then whenever guests ask for the password, send them to the NFC tag. Or else: set a mark near the bed and make it so that when touched on the smartphone, airplane mode is turned on (again using Trigger).

It will also be useful for motorists – they wrote down the algorithm for starting the navigator on the label, pasted it on the holder for the smartphone, and every time you install the device in this place, the navigator will start automatically.

And there are still very, very many such examples of the use of NFC tags. Often, the emergence of new cases is not limited by technology at all, but by the user’s imagination.

Work examples

Let’s look at a few examples of how an NFC scanner works.

To use the scanner with Arduino, use the Adafruit PN532 library.
nfc.ino#include {amp}lt;Wire.h{amp}gt;#include {amp}lt;SPI.h{amp}gt;// RFID/NFC library#include {amp}lt;Adafruit_PN532 .h{amp}gt;

// interrupt pin#define PN532_IRQ 9 // create an object to work with the scanner and pass two parameters to it // the first is the interrupt pin number // the second is the number 100 // from Adafruit there was a software reset of the shield // in the RFID/NFC 13 scanner .56 MHz (Troyka-module) this pin is not used // therefore, we transfer a number greater than any Arduino pin

void setup(void){
Serial.begin(9600);//initialize RFID/NFC scanner
nfc.begin();int versiondata = nfc.getFirmwareVersion();if(!versiondata){
Serial.print(“Didn’t find RFID/NFC reader”);while(1){}}

Serial.println(“Found RFID/NFC reader”);// configure the module
nfc. SAMConfig();
Serial.println(“Waiting for a card.”);}

void loop(void){uint8_t success;// buffer for storing card ID uint8_t uid[8];// card buffer size uint8_t uidLength;// listen for new labels
success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, uid,{amp}amp;uidLength);// if the card is found if(success){// output the received data to the console
Serial.println(“Found a card”);
Serial.print(“ID Length: “);
Serial.print(uidLength, DEC);
Serial.print(“ID Value: “);
nfc. PrintHex(uid, uidLength);
Open the Serial port and apply cards one by one to the reader. The ID Value line displays a unique card number.

Read and output the card ID to the Serial port. To use the RFID/NFC scanner with Iskra JS, use the @amperka/nfc library. It provides simple operation with the module and hides all the subtleties of the data exchange protocol between the scanner and the control board.

 // configure I2C1 for the module to work 
 I2C1.  setup  (  {  sda  :   SDA  ,   scl  :   SCL  ,   bitrate  :  400000  }  )  ; 

 // connect the module to I2C1 and interrupt pin  var   nfc   =   require  (  '@amperka/nfc'  ) . connect  (  {  i2c  :   I2C1  ,   irqPin  :   P9  }  )  ; 

 // activate the module 
 nfc.  wakeUp  (  function  (  error  )  {  if  (  error  )  { 
     print  (  'NFC wake up error'  ,   error  )  ;  }  else  { 
     print  (  'NFC wake up OK'  )  ;  // listen for new labels 
     nfc.  listen  (  )  ;  }  }  )  ; 

nfc.  on  (  'tag'  ,  function  (  error  ,   data  )  {  if  (  error  )  { 
     print  (  'tag read error'  )  ;  }  else  {  // print the received data to the console 
     print  (  data  )  ;  } 

   // listen for a new label every second 
   setTimeout  (  function  (  )  { 
     nfc.  listen  (  )  ;  }  ,  1000  )  ;  }  )  ; 

After downloading the code, we will attach the cards to the scanner one by one. The unique card number is displayed in the uid line

Opening all doors

Someone implements this at home, but mostly the use of NFC for user identification and control is typical for enterprises and organizations. Turnstiles and locks are configured in such a way that with the help of a label, which is a pass, they decide whether to give its owner permission to enter or not.

With NFC, all doors really open in a smartphone — if not literally, then figuratively for sure. In fact, the user receives a universal tool that, despite the speed limits, finds its application in a variety of situations. Here we are faced with another problem – the degree of prevalence of technology among service providers. The only thing that an ordinary user can do in this case is to use NFC as often as possible to show its relevance.

NFC remote

Let’s try to control three LEDs using an RFID / NFC scanner, each LED will have its own card. When a known card is presented, the LED will switch. For the convenience of monitoring the work, we will send the name of the read card to the Serial port.

Connection diagram

NFC eeprom

Let’s add three Piranha LEDs to the previously assembled circuit.

Instead of conclusion

Perhaps the best part about NFC is that the technology is available to a wide range of users. More and more manufacturers do not leave their smartphones without NFC, so it is available in devices like

(for $321.99 with code Mi5SGBS until 31.12) and

, and in flagships like

. The diversity is also pleasing

NFC eeprom

What about Apple and its iPhone 7, you ask? Alas, the manufacturer limits the operation of the NFC chip in its smartphone, and it can only be used for the Apple Pay payment system. In the fall, however, it launched in Russia, so at least some plus.

How do you use NFC in your daily life? Share your experience with us in the comments.

RFID/NFC technology

RFID and NFC are two closely related wireless communication technologies that are used around the world for access control, cargo tracking, security systems and contactless payments. N FC is an extension of RFID technology.

Leave a Reply

Your email address will not be published. Required fields are marked *