NFC Usage on Seeed Studio XIAO nRF52840 (Sense)
The Seeed nRF52 Boards version 1.1.3 and Seeed nRF52 mbed-enabled Boards version 2.9.2 have been tested and approved.
Both the Seeed Studio XIAO nRF52840 and Seeed Studio XIAO nRF52840 Sense are equipped with an NFC (Near Field Communication) module. This wiki will help you get started with using NFC on these boards. Here we will demonstrate a basic example where we send a text string from the board to the phone after placing the phone on the NFC antenna.
Preparatory work
The NFC function will perform well when we use the "Seeed nRF52 mbed-enabled Boards Library".
For the board libraries installation, please refer to this tutorial to finish installation. If you have already installed, we can move on and process the project.
Hardware required
- 1 x Seeed Studio XIAO nRF52840 or Seeed Studio XIAO nRF52840 Sense
- 1 x NFC antenna
- 1 x USB Type-C cable
- 1 x Smartphone
Software required
Hardware connection
Solder the NFC antenna to the Seeed Studio XIAO nRF52840 (Sense) as follows:
Send text string with NFC
- Step 1. Open Arduino IDE and upload the following codes
#include <NFCT.h>
void setup() {
// set the NFC message as first parameter and the language code as second
NFC.setTXTmessage("Hello World!", "en");
// start the NFC module
NFC.start();
}
void loop() {
}
Here we simply send the text string "Hello World!"
- Step 2. Open "NFC TagInfo" mobile app and click Scan & Launch
- Step 3. Place the NFC antenna close to the phone and you will see the following output