Skip to the content
2 layers85.6 × 54 mmNfc tag, the printed circuit board in 3D

This project is an implementation of an NFC tag which is able to change the message. It communicates to a host device.

Size
85.6 × 54 mm
Copper layers
2
Thickness
1.6 mm
Parts
17
Nets
11
Pads
38
Tracks, vias
76, 2
Pours
44
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
3 Mar 2025
Updated
16 Apr 2025

Overview

Nfc tag is an open-source printed circuit board by Iceteavanill, from the Iceteavanill/NFC_message_switcher repository on GitHub. It is a 2-layer board of 85.6 × 54 mm with 17 parts on 11 nets, routed with 76 tracks and 2 vias.

It is built around the ATTINY402-SSN. Its parts include 3 capacitors, 2 resistors, 2 ICs and 1 connector. It belongs with the radio and wireless boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

1

README

README.md

NFC message switcher

This project is an implementation of an NFC tag which is able to change the message. It communicates to a host device. It was developed to be quickly assembled and easy to use but still be a bit more than a blinking light. It uses the reference implementation for the bare metal TWI driver. PCB render

Main principle of operation

The main device is the ST25DV04K. It can communicate via NFC and I2C. When an NFC capable device is held near the PCB, the ST25DV04K starts to receive power and starts communicating with the device. The Power that's transmitted is shared (energy harvesting mode) with a ATtiny402. When powered it starts communicating via I2C and writes to the user accessible memory. When the written data has been confirmed, it powers down.

Details

Power

Power provider is the energy harvesting mode of the ST25DV04K, the power source is a NFC capable device that is in proximity of the PCB. It is buffered via a 47μF capacitor. Because of that, it is essential to keep the power consumption of the ATtiny as low as possible. Consult the source code for more details.

Link arbitration

The ST25DV04K does only support I2C or NFC active at the same time. However, it has an open drain output that can be used to sense the current activity. Low, signals that the device is currently busy. The ATtiny then waits for the device to be available, by waiting in sleep. A hardware interrupt is not yet implemented.

Device configuration

The ST25DV04K needs some configuration for correct operation. The energy harvesting mode must be enabled/forced at startup. Also, the GPO mode must be set to RF_ACTIVITY_EN to enable better link arbitration. The configuration happens after the ATtiny has been programmed once.

Antenna

The antenna / coil design is based on a paper from Hubert Aebischer. The ST25DV04K has an internal tuning capacitor which should be assumed to be 29pF. Based on that, the inductance should be 4.75μH.

Formfactor

The PCB dimensions are the same as a credit card. It is however quite a bit thicker.

Building your own

All required files to recreate this project can be found here.

Sourcing

The following parts are needed to recreate this Project (as well as the PCB):

ReferenceValueQtyDigikey number
C1, C30.1uF21276-1000-1-ND
C247uF11276-3063-2-ND
R1, R24k72MMA-4.7KACT-ND
U1ATtiny4021ATTINY402-SSNRCT-ND
U2ST25DV04K1497-17123-1-ND

Assembly

There are no special requirements for the assembly of the PCB's. If you are used to soldering SMD components it shouldn0t be a problem.

Software

You can use the provided released hex file, however it is recommended to customize the software to your own taste.

There are multiple options to customize the software

[!WARNING]
I tried making the process of using the software as easy as possible, however it may not be very easy/beginner-friendly in places.

Overview

Customizing the software always requires a rebuild of the firmware of the Attiny. The XC8 compiler from microchip is recommended. The following flags were used and are recommended:

Flagscommands
Global-gdwarf-3 -mconst-data-in-progmem -mno-const-data-in-config-mapped-progmem
compiler-funsigned-char -funsigned-bitfields -Wall -O2 -fno-common
linker"libm" -Wl,--gc-sections

A makefile is already prepared with all the required flags. If you install a later version you might have to alter the paths a little.

For customization, only a header file has to be altered (nfc_messages.h).
There are multiple ways of accomplishing that:

  • editing the header directly (not recommended)
  • using the python script
  • using the gui (recommended)

Editing the header directly

Editing the header directly is not recommended because the required data must be in the NDEF format. Manually generating that is very tedious. If you have special needs however, like encoding special data types, you have to do it this way because anything else has not been implemented.

Using the pyton script

The dataGenerator.py python script can be used to quickly generate custom messages. It requires the NDEFLib python library. Edit the message_as_text_list list with your messages and then run the script:

py
message_as_text_list = ["Test 1",
                        "Test 2 a bit longer",
                        "Test 3 even looooooooooooooooooooooooooonger",
                        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
                        "spotify:track:4cOdK2wGLETKBW3PvgPWqT"
]

Using the gui

A gui has been made to quickly program multiple NFC tags. It requires WXpython and uses the previously mentioned script and the message_as_text_list. For uploading, it relies on the MPLAB IPE programming software and its command line interface.

Programming steps:

  1. Step:

Enter your desired message(s) in the table at the top. Links to websites videos or Spotify songs are also allowed.

picture of the table

  1. Step:

If your main device is an iPhone check the iPhone compatability mode. IPhones are unable to read text from a NFC device, and the text messages have to be encoded as a website.

  1. Step:

Some default messages are added to the list automatically. If you don't want that, you can disable that with the checkbox Remove predefined texts. The message_as_text_list from dataGenerator.py is used as a source.

  1. Step:

Connect your programmer to the tag and press program device. The build and upload steps are automatically executed.

Building and uploading

In all options but the gui you have to manually build and then upload the firmware. You can use the make upload command with the option PROGTOOL= to select the programmer that you have on hand. See the documentation of the IPE programmer option to know which flag you have to use.

Batch programming

Many devices in a row can be programmed with the programming jig:

programming jig

It was designed in Onshape. I used pogopins that I had on hand. You probably want to customize it to your current stock. You find the Onshape document here.

Rating GUI

Because this PCB was designed as a competition PCB, a rating gui has been made using streamlit. You can import a CSV of contestants and rate each one for time, quality and some other points. It is meant to be customized to your particular use case.

Caveat

It must be noted that the current design has a (obvious) flaw. The ATtiny is in the middle of the coil and probably quite affected by the activity of it. When combined with the nonideal power delivery method, this can significantly impair functionality at times (The I2C content that is written gets verified but I2C has no error correcting method). Some more analysis in that regard is not yet made.

Parts

17
QtyValueFootprintReferences
20.1uFCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC1, C3
24k7Resistor_SMD:R_MiniMELF_MMA-0204R1, R2
2LOGOLOGOG***, G***
147uFCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC2
1ATtiny402Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU1
1Antenna_Loopfootprint_lib:nfc antenna_optimizedAE1
1NCJumper:SolderJumper-2_P1.3mm_Bridged2Bar_RoundedPad1.0x1.5mmJP1
1ST25DV04KPackage_SO:SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.29x3mmU2
1VccTestPoint:TestPoint_Pad_D1.5mmTP4
1debug/progfootprint_lib:debug_padsJ1
1gndTestPoint:TestPoint_Pad_D1.5mmTP5
1gpoTestPoint:TestPoint_Pad_D1.5mmTP3
1sclTestPoint:TestPoint_Pad_D1.5mmTP1
1sdaTestPoint:TestPoint_Pad_D1.5mmTP2

Similar boards

  • 2 layers75.8 × 19.2 mm3S coinCellChargeController, the printed circuit board in 3D

    3S coinCellChargeController

    PocketConcepts/Pocket_PSU

    A variable current & voltage PSU with 3S lipo charging, balancing, and protection circuit using PPS.

    78 parts36
  • 2 layers72 × 47.5 mmPCB avr dx unbricker, the printed circuit board in 3D

    PCB avr dx unbricker

    k-takata/PCB_avr_dx_unbricker

    UPDI High Voltage programmer for AVR Dx/Ex series

    40 parts4
  • 2 layers85 × 53 mmCccamp23 nametag, the printed circuit board in 3D

    Cccamp23 nametag

    HazeCore/Nametag_Hardware

    This is the hardware for out Nametag Badge for Chaos Communication Camp 2023. You can find more information about the Project at https://hazeco.re/cccamp-nametag/.

    34 parts3
  • 2 layers7.4 × 7.3 mmDCC Dekoder Attiny402 1, the printed circuit board in 3D

    DCC Dekoder Attiny402 1

    markusgruen/DccFunctionDecoder

    Open source, Arduino-based DCC function decoder

    17 parts3GPL-3.0
  • 2 layers69.9 × 12.1 mmPeepsy pro, the printed circuit board in 3D

    Peepsy pro

    mirdej/peepsy

    simple continuity tester

    13 parts3GPL-3.0
  • 2 layers100 × 98.6 mmPCB Christmas Tree, the printed circuit board in 3D

    PCB Christmas Tree

    KNEAGHUST/PCB_Christmas_Tree_AGH

    PCB Christmas tree designed for the AGH University of Krakow

    45 parts2MIT
  • 2 layers100 × 90 mmPaneled, the printed circuit board in 3D

    Paneled

    McbeEringi/pcb-stuff

    286 parts2MIT

Questions

How big is the Nfc tag PCB?

It measures 85.6 × 54 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Nfc tag use?

17 parts, built around the ATTINY402-SSN. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Nfc tag KiCad files?

From the Iceteavanill/NFC_message_switcher repository on GitHub, at the commit this page was made from: the board is hardware/pcb/nfc_tag.kicad_pcb and its schematic hardware/pcb/nfc_tag.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Nfc tag design in my own project?

Its repository states no licence, so its author keeps all rights: ask Iceteavanill before reusing the design.