Our daily use of NFC cards can be used to swipe the subway, in and out of the access control, but have you ever thought about that?
When we swipe an NFC-enabled IC card to enter the subway, how does the system know how much balance I have on the card?
This thin NFC card in the end what magic, in addition to swiping into the subway, you can also go to the bank to withdraw money, in and out of the neighborhood access control.
Today I was reading about some of the Internet of Things, and I realized that the technical principles in the middle of it all were this way
principle
Currently on our common NFC smart IC cards, we are actually running the JavaCard virtual machine, and NFC smart IC cards can run card applications written in the streamlined Java language (referred to as Applets).
The Applet of NFC smart IC card can not be started by itself, but must be selected by external terminals (such as POS machines, subway card terminals, etc.) by sending Select commands to the card, so that the Applet in the card can be selected and the Applet can be run.
So we implement a set of JavaCard applet based on Java API, how to run the applet on NFC.
1. Use a smart card reader to connect to the computer and make sure the reader can recognize the NFC smart card.
2. Select the card management application on the card (usually the Global Platform card management application) through the personalization tool.
3. Use the personalization tool to install the CAP file on the smart card. (Our Applet program is packaged as a CAP file)
At this point there is a small program running on this NFC card.
But then the question arises. Since there is a Java VM running on this NFC all the time, doesn't this NFC need to consume power?
How does this NFC applet work without power?
The answer is: there's really no need for an external power source, and usually NFC uses wireless inductive power.
NFC smart cards draw power from an NFC reader or NFC device by wireless induction. When an NFC card is close to the reader, the alternating magnetic field generated by the reader induces an electric current in the coils inside the card, a process known as electromagnetic induction. As a result, NFC cards do not require an internal battery; they get the power they need to operate in this way.
It's really too 6!