Note
The NFC/RFID Bricklet is discontinued and is no longer sold. The NFC Bricklet is the recommended replacement.
Can read and write Mifare Classic and NFC Forum Type 1 and 2 RFID/NFC tags
Range is restricted to 10cm (3.94")
Operating frequency is 13.56 MHz
The NFC/ RFID Bricklet can be used to extend Bricks by the possibility to read and write NFC/RFID tags. To do this you only have to place a NFC or RFID tag in the proximity (up to 10cm) of the Bricklet.
Currently we support Mifare Classic as well as NFC Forum Type 1 and 2 tags.
Capability for tag emulation as well as NFC P2P communication may be added in the future firmware updates.
Property |
Value |
|---|---|
NFC IC |
PN532 |
Current Consumption |
115mA |
Supported tags |
Mifare Classic, NFC Forum Type 1, NFC Forum Type 2 |
Operating Frequency |
13.56 MHz |
Dimensions (W x D x H) |
50 x 85 x 5mm (1.97 x 3.35 x 0.2") |
Weight |
15g |
The Bricklet should work with every tag that is either compatible to Mifare Classic, NFC Forum Type 1 or NFC Forum Type 2. We explicitly tested the Bricklet with the following tags:
Mifare Classic:
FM11RF08
MF1S50
NFC Forum Type 1:
Jewel
Topaz 512 (TPZ-505-016)
NFC Forum Type 2:
NTAG203(F)
NTAG210
NTAG213
NTAG215
NTAG216
Mifare Ultralight (MF01CU1)
Every smart phone that is capable of NFC can read NFC Forum Type 1 and 2 tags.
Mifare Classic and NFC Forum Type 1 as well as NFC Forum Type 2 have different page sizes and a different memory structure. You have to keep track of this structure to not accidentally lock a tag.
Mifare Classic:
Page size 16 byte (1 page is read/written per call of RequestPage/WritePage).
4 pages build one sector.
Sector 0 (pages 0-3) should not be overwritten.
The last page in every sector controls the authentication keys for this sector (page 7, 11, 15, ..). Do not overwrite these pages if you don't know what you are doing.
Adafruit has a quite good description of the structure: Link
NFC Forum Type 1:
Page size 8 byte (2 pages are read/written per call of RequestPage/WritePage).
pages 0-2 are reserved for lock control. Do not overwrite these pages if you don't know what you are doing.
page 15 is reserved and can not be written.
NFC Forum Type 2:
Page size 4 byte (4 pages are read/written per call of RequestPage/WritePage).
Page 0-1 are read only and contains the tag ID
Page 3-4 and the last two pages (page number depends on the size of the tag) contain lock bits. Do not overwrite these pages if you don't know what you are doing.
The NFC Forum has specified the NFC Data Exchange Format (NDEF) to transfer messages from NFC tags to smart phones. NDEF Messages consist of one or more NDEF Records. Many of the predefined NDEF Records can be understood by any smart phone that is capable of NFC communication.
We implemented an example program that can write Text, URI and Mime Media Type Records to NFC Forum Type 1 and 2 tags.
The example is implemented in Python, but it can easily be used as a starting point if you want to write NDEF Messages with any programming language.
To test a NFC/RFID Bricklet you need to have Brick Daemon and Brick Viewer installed. Brick Daemon acts as a proxy between the USB interface of the Bricks and the API bindings. Brick Viewer connects to Brick Daemon. It helps to figure out basic information about the connected Bricks and Bricklets and allows to test them.
Connect the NFC/RFID Bricklet to a Brick with a Bricklet Cable.
If you connect the Brick to the PC over USB, you should see a new tab named "NFC/RFID Bricklet" in the Brick Viewer after a moment. Select this tab.
If everything went as expected you can now scan for tags and read/write pages.
After this test you can go on with writing your own application. See the Programming Interface section for the API of the NFC/RFID Bricklet and examples in different programming languages.
A laser-cut case for the NFC/RFID Bricklet was available, but is not sold any longer.
The assembly is easiest if you follow the following steps:
Put long screws through bottom plate,
put Bricklet on plate and fasten screws with spacers,
build up side plates,
plug side plates in bottom plate,
add top plate onto side plates and
add screws to top plate.
Below you can see an exploded assembly drawing of the NFC/RFID Bricklet case:
Hint: There is a protective film on both sides of the plates, you have to remove it before assembly.
See Programming Interface for a detailed description.
Language |
API |
Examples |
Installation |
|---|---|---|---|
C/C++ |
|||
C# |
|||
Delphi/Lazarus |
|||
Go |
|||
Java |
|||
JavaScript |
|||
LabVIEW |
|||
Mathematica |
|||
MATLAB/Octave |
|||
MQTT |
|||
openHAB |
|||
Perl |
|||
PHP |
|||
Python |
|||
Ruby |
|||
Rust |
|||
Shell |
|||
Visual Basic .NET |
|||
TCP/IP |
|||
Modbus |