// HACKER NEWS — CYBERSECURITY
NFC Energy-Harvesting PCB Business Card with an MCU
Like most business cards, mine doesn’t have a battery. When it’s tapped against a phone, though, 21 LEDs start an animation, powered just by NFC.
This project started about three months ago as an easy way to learn KiCad before jumping into more complex designs. “Easy” didn’t last long. This final product taught me more about every aspect of the PCB process than I could have expected, and the result turned out way better than I imagined. The full repo is here.
I’ve seen all sorts of business cards done on PCBs. Most that I’ve seen use the silkscreen and maybe exposed copper to include contact details and a QR code. These are really cool–but they’re more about graphic design than electrical engineering. Others include more complicated features like displays, batteries, and inputs–super cool, but expensive and thick.
I wanted to make something simple and cheap enough to be able to give to people. Eventually, I stumbled upon NFC business cards. This concept was perfect: no battery required, some basic RF engineering, and a cheap BOM. Once I started looking into specific NFC chips, I realized a few even have the ability to harvest NFC energy for other components–most notably, the NXP NTAG I2C Plus and the STMicro ST25DV-KC.
I should explain how NFC works: Your phone continuously emits a small magnetic field. An NFC card picks up on that field, making your phone act like a tiny wireless charger. The card never actually transmits a message back to your phone. Instead, it changes how much energy it absorbs from the field, and your phone detects those power dips and converts them to binary data. Most NFC tags use this harvested energy only to run their internal circuitry, but some NFC chips are able to take excess DC voltage and route it out to external hardware. This business card uses that last feature.
The theory didn’t seem too complicated. I quickly made a schematic in KiCad. The ATtiny412 microchip was an easy choice with its compact size, sufficient GPIOs, and very low power requirements.
The LEDs are connected using a technique called Charlieplexing, exploiting the unidirectional current flow inherent to diodes. That Wikipedia article is a great guide to it, but the key is that tri-state logic can be used to have a few GPIOs control many LEDs. Specifically, the formula is: y = x⋅(x-1) where y represents the number of LEDs that can be independently controlled, and x represents the number of GPIOs. The primary downside is that only one LED can be lit at a time, but that can be mitigated by using PWM and spreading duty cycles across multiple LEDs. For this first draft, I used 4 GPIOs (GPIO_A through GPIO_D) to control 12 LEDs.
While I initially chose an ATtiny412 MCU, I realized it was suboptimal for a few reasons. It only has 5 GPIOs and comes only in through-hole/leaded-pin packages, not QFN, making it sit taller off the PCB.
Because I was away from college this summer, I didn’t have a way to assemble PCBs, so I needed to have JLCPCB assemble them for me. Also, if I planned on giving these to people, I didn’t want any lead in them, and I don’t have access to a lead-free electronics workspace even back at college. JLCPCB supports full RoHS compliance, so it was an easy choice.
Since I was getting it professionally assembled anyway, I might as well go with a much smaller QFN package, which the ATtiny412 does not come in. After some research, I found the ATtiny816. It’s similar to the ATtiny412 but with 17 GPIOs and a much thinner 3 mm × 3 mm package. Now, I could dedicate six GPIOs to LEDs, enabling me to have 20 Charlieplexed LEDs and a simple indicator LED that goes from a GPIO to GND. I also switched to the NXP NTAG I2C Plus NFC chip because it supports a closer-range, higher-powered NFC standard.