PCB Business Card With NFC | Make Yours With NFC, QR Code, and Project Layouts
by markwuelectronics in Circuits > Electronics
1833 Views, 9 Favorites, 0 Comments
PCB Business Card With NFC | Make Yours With NFC, QR Code, and Project Layouts
Open and edit this design in your browser: flux.ai/markwuflux/pcb-business-card-v2
My greatest accomplishment from this project was getting William Osman and my friend to roast me for not completing it in time. All jokes aside, if you're looking for a hands-on project to impress, this is the one. We'll be going over the entire hardware design, build, and test process. Stay tuned for the testing because we'll be testing with a VNA! (those things with the scary Smith Charts). There's a lot to cover so I chose to only dive deep into what you really need to know to engineer an NFC coil and the "gotchas" along the way.
First, I want to motivate the form of this project with my experience at College career fairs. Recruiters barely scan your resume so I would bring my portfolio on my phone and a bunch of bare PCBs as props. This worked well with the technical recruiters because it serves as a visceral talking point for your experience and gives them something to relate back to their company needs; I remember one of them was very interested in a buck converter layout and tunnel visioned our conversation to that part of my design. However, for the non-technical recruiters, it would've been nice to give them something to bring back to the engineers, something that doesn't get lost in a stack of A4 resumes.
Once you get past the bells and whistles (NFC and QR Codes,) you get to what's unique about this business card. It's a physical reference to your best work. And you get 2 sides of real estate to fill up! The key feature that makes this so easy to maintain for the annual career fair is Flux's module feature. The upshot of modularizing your designs is that you can reuse them across projects without hassle; here, it took me 15 seconds to drag in all my best layout work and turn it into something tangible.
I intended this design to work as a template for anyone! So feel free to clone this project in flux by clicking on the menu on the top left -> Fork Project. Then you can just change the QR code and drag your own modules onto the PCB and you'll have a design ready to go in a few minutes. But keep on reading if you want to learn how to make one from scratch yourself!
Supplies
Just an FYI, you can order this board fully assembled from this project's sponsor, PCBWay, without requiring any tools!
Tools You Will Need (if self-assembling):
- Some Reflow Solution:
- hot plate
- old toaster oven
- hot air gun
- soldering iron (if measuring)
- Solder Paste
- Solder (if measuring)
- Fine tip tweezers
- An Android phone with NFC! (or you can experiment with programming over I2C)
- NanoVNA with SMA connectors
BoM:
You can substitute all the parts except for the NFC IC if you prefer a different distributor; just make sure the packaging is the same (everything is 0603 except for the tuning cap which is 0402). I browsed DigiKey for the highest stock components so they should be around for a while. Find my BoM here: digikey.com/short/zzfqr88v
Cost:
The BoM I listed above is for a quantity of 100 cards. The BoM cost comes out to $1.48 each. The PCBs are roughly $1 each at that quantity too.
You might not need this many, maybe you need just one. You can typically get the PCBs for $5 (if it's simple) and the BoM cost around $2 then.
Choosing an NFC Integrated Circuit
There’s lot’s of options on the market and you can go with anything you find. I went with the same family of NFC ICs that this instructables used because that creator proved you can program it with a phone (and I didn’t want to create a hardware programming jig). If you were interested in automating the programming with a jig, a lot of these ICs support programming over I2C; I would recommend looking for microcontroller libraries and checking if they support NDEF formatting of those ICs.
In future revisions, I would like to experiment with something cheaper or something a lot smaller. Potentially even bare die silicon NFC ICs.
The Engineering Mindset
A lot of tutorials dive into the E&M theory, so I'll gloss over it here with an illustration. All you need to know is the emitter is an antenna which provides power to the IC with a sinusoidal 13.56MHz signal and it also communicates with the IC at that frequency; how it does that is black magic until you dive into designing NFC emitters. The antenna/receiver model is pretty straightforward at a high level but that information is nearly impossible to use to predict how your circuit will behave.
The connect here is that our tag is a passive resonant circuit and we maximize it's effectiveness if it resonates at the frequency used by the emitter. If you look at the model below, this is the approximation of the entire circuit. From my experience building the circuit, the elements highlighted in red are the ones that have the largest impact on the circuit and are all we need to focus on. Let me break down each of these components.
CIC: It's important to note that the NFC IC comes with 50pF of internal parallel capacitance; we'll need to use this fact later on.
Ca: This is the parallel capacitance we're going to add to our antenna as a tuning element.
La: This is the inductance of our coil. This value varies slightly with frequency, but we only care what it is at the resonant frequency.
For our passive resonant circuit, the most important metric we care about is the resonant frequency and that you have a lot of gain at that frequency. You might also consider the Q of your resonant circuit, but as long as it’s not super duper high, then we don’t need to worry about it. (If it’s very high, then your circuit will be very sensitive and it will be hard to tune it to resonate at the target frequency. It’s not a problem with this application and the resistive parasitics which affect the Q.)
Our goal is to get our circuit to look like the blue bell curve and get the peak right over 13.56MHz on the X-axis according to the NFC standard. (Sorry about the scale, I couldn't adjust it in this VNA software.)
On the Y-axis we have the magnitude of our complex impedance (Z - blue) as well as our admittance (Y - red) and on the X-axis, it’s the frequency of an imaginary perfect sinusoid. In a nutshell, the VNA is sweeping AC sources across a frequency range and measuring what the complex impedance is. At perfect resonance, there should be no current flowing in or out of your circuit, because energy is shuffling between your inductor and capacitor, and the opposite when you are not at resonance. What this translates into is our impedance appearing very high at resonance (because there is little current flow) and our admittance being very low (admittance is just the inverse of impedance).
TLDR: All we care about is seeing an impedance magnitude spike at 13.56MHz!
Modeling Our Resonant Circuit
Now that we know what our target is, we need to know how to reach it with the tools we have at our disposal. Luckily for us, NFC chip manufacturers like NXP provide tons of application information. They even included an excel sheet calculator! I don’t recommend using it because it’s a little too complicated and hard to understand what the parameters mean or do. However, I attached two very helpful documents that I consulted regularly to orient myself on the design space; I recommend starting with the NFC Webinar for the high level introduction and checking out the Application Note for specifics. They are both attached to this step.
After reading through them, I found out that there’s only 2 tools you need here. A coil inductance calculator and a LC resonant frequency calculator. Luckily for us, the resonant circuit can be accurately predicted by a simple LC model, with only two input parameters, and it spits out the only parameter we care about: the resonant frequency. (In reality, we have an RLC resonant circuit and the parasitic resistances affects the Q, but like I mentioned earlier, we don't need to be precise here.)
Designing the Coil and Resonant Circuit
Designing the coil is a bit of a trial and error process. This is the hard part because there's a lot of variables (antenna size, minimum trace width, minimum trace spacing, number of turns, internal capacitance), only some of which are constrained, and we have to arrive at a perfect solution. If you are using this NFC chip, you want your target inductance to be somewhere around 2.5uH ± 1uH; in theory, you could just adjust the parallel capacitance to whatever you'd like, but targeting 2.5uH-ish gets you close.
Well we have to start somewhere, so I would recommend first setting the "Antenna Length" and "Antenna Width" to whatever size you had in mind for your application. This length/width is the outside length/width of your antenna so you also have to make room for the internal turns of the coil.
Next, let's set the "Conductor Width" as small as you can go. It's kind of an arbitrary constraint but it maximizes how much area we have inside the coil to put our QR code. I'm being conservative and saying 0.3mm which nearly any manufacturer is capable of.
Finally, I play around with the last two knobs: "Conductor Spacing" and "Number of Turns" until I get into that 2.5uH range. I ended up with 2.41uH @13.56MHz. Now, let's just do a sanity check with our LC resonance calculator. Our only constraint here is that we can't go below 50pF of capacitance because that's the internal capacitance of our NFC IC. So let's put in 50pF for our capacitance and 2.41uH as our inductance. This gets us a resonant frequency of 14.5MHz.
Remember from before, we are putting a parallel capacitor "Ca" so we can increase our capacitance. After trial and error-ing, I got pretty close to 13.56MHz with a resonance of 13.57MHz using a 7pF parallel capacitor (see LC calculator screenshot above). There will be parasitics especially with these low capacitances, so we just have to run with our closest value and tune it in the real world.
Creating the Coil in Flux
Now that we have our coil parameters, we can start creating our coil. Here is the PCB coil I designed; feel free to use it as a reference. Notice that we are in Schematic view right now. When dealing with layout, click on the tab labelled "PCB" on the top middle of the app.
In flux, to create a new part, just click New Project and drag in a terminal.
The schematic is simple! It's just two terminals and a short between them. Remember, at DC an inductor is just a short, but its physical properties give it complex impedance with AC signals.
Before we move onto layout, one thing to note is that most parts in flux don't need traces which is why you will see a "Footprint" node in the object tree when in PCB view. The part we're creating is literally made of traces which is kind of an edge case. To fix this, click the three dots on the Root node, hover over add, and add a Layout node. Now you can select the Footprint node and right click it to delete it. (You may need to drag in one more terminal and delete it to see them show up in the PCB.)
Your object tree should look like the screenshot above. Then to start a trace segment, just click on one of the terminals, click anywhere vertically to set the trace, then press "ESC" to exit routing mode. Now you can select this trace and start manipulating it with layout rules on the right hand side panel.
This part requires a bit of mathematical planning to get the geometry right. In flux, we can specify start and end positions of our traces so we just need to know the location of the blue trace segments in all these 4 corners.
Fortunately, we have all the constraints. Let's work our way from the outside in: for this coil, we have an antenna width of 40mm, so let's position our leftmost trace at [0 -20] and our rightmost trace at [0 20] (flux uses spaces as delimiters and understands 2D and 3D vectors this way). At this point, we can also set the "Trace Width" rule using the "Conductor Width" constraint we got from the ST NFC coil calculator.
Now, we just need to set the "Shape Start" and "Shape End" rules; this effectively defines the length of our trace. If we set the trace length to 40mm, then we wouldn't have any space to add elbows and we'll end up with 90 degree corners. Assuming that our shortest bend will be 0.5mm, we can easily derive the equation from this drawing. Our known variables are n - number of turns, w - conductor width, and g - conductor spacing.
We want to know the length of the yellow line which is the amount we need to subtract from the antenna length. After all this geometry, we get:
For our application, n = 5, w = 0.3mm, and g = 0.41mm. When solving for the yellow line, we get approximately 2.02mm.
I'm going to round this to a nice even number 2mm because it will only shrink our 0.5mm constraint ever so slightly. Now we know our trace length for the outermost trace is 20mm-2mm which is 18mm which gives us all the parameters we need for the outer trace "Shape Start" and "Shape End" coordinates.
I then create all the horizontal and vertical trace segments using the trace width and spacing parameters from the design calculator.
Then I connect the traces together with 45 degree elbows by clicking on the routing touchpoints that show up when you hover over them. Finally, I create vias at similar positions in the terminals to simulate similar impedance changes and close the coil on the bottom layer shown by the blue trace.
Just publish your part in the flux menu on the top left, and you'll be able to access it in the part library in a parent project. If you need a quick guide on how to use flux, check out this video. If you want to dive deeper, check out this multi-part series.
Creating Our Primary PCB
The video tutorial above demonstrates how to add a QR code in Flux. The kicker here is that my QR code links to this very project which can be viewed on mobile. This might be the most meta business card in the world!
As for the modules, this is the easiest step! This would be all the modular work you've done in the past. In my experience, the most common use cases for modules are power converter layouts and MCU boilerplate. Just drag and drop them in from the part library in the schematic editor. Positioning them on the PCB editor should be pretty straightforward.
Ok now that we're pretty much done with the cosmetic work, let's move onto the primary NFC circuit. Note that I am using net labels "LA" and "LB" to connect the coil to the NFC IC. That's pretty much it! The capacitor, resistor and LED are just if you want visual indicator of the NFC IC generating power.
The layout is straightforward too. Try to keep the pads of the tuning capacitor (C15 here) inline with the terminals of your coil. Then try keeping the traces short and symmetrical. Honestly, keeping it symmetrical probably doesn't have a large signal integrity effect at these low frequencies, but it just feels right, you know? As for the LEDs and capacitors, as long as you have traces going there, you can put it wherever you want so get creative!
When you're done placing your part and adding silkscreen assets (you can upload svgs to flux), then it should look super cool, like this:
If you want to become an expert on the layout tools available in flux, check out this Getting Started With Flux Layout Video.
Creating Our Measurement PCB
We just created our primary PCB, our crown jewel, so we don't want to ruin its look with a big through-hole SMA connector. Neither do we want to struggle with probing the darn thing by soldering wires to it. So let's make our lives easier and create an identical board with the exact same circuit and slap an SMA connector onto it. Find the project here.
To create this board, I just cloned our primary project, resized the board, and deleted all the cosmetic modules. This way it's exactly 1:1 to the original design. The only change was adding the SMA connector (and a 4 pin connector in case I wanted to program the NFC IC). Also it's very important to include the NFC IC on this measurement board because it adds 50pF of parallel capacitance to our resonant circuit. To probe our resonant circuit, I recommend adding two short traces to the vias we added to our inductor. Although unnecessary, it ensures that the impedance changes at the measurement point are symmetrical.
Quick Aside on PCB Ordering Options
Now we're ready to order the PCBs! Here, we need a stencil and by far, the best manufacturer to get a PCB/Stencil for self assembly is PCBWay! You can request them to cut the stencil outline to the same shape as your PCB so you can align them without creating an alignment jig with your extra PCBs. All you have to do is add a message in your stencil order that says "Please cut the stencil down to board outline."
Here are the manufacturing options I opted into for my good looking black and gold PCB. I highly recommend getting a 1.0mm or thinner board to keep it sleek. And if you don't care about the gold look, I recommend getting at least "HASL lead free" because you and your recruiter will be directly touching the surface finish.
Assembly, Reflow, and Shameless Plug
As you can tell, I believe a picture says a thousand words and a video, even more. Check out one of my TikToks from 0:35 and on to get a glimpse into how I assemble my boards at home. It's the exact same process here!
I went through two revisions for this project (mostly tuning the NFC coil). Here's the unassembled vs assembled pictures for all the boards.
Measuring the Resonant Frequency
Now that we have our measurement board, let's plug it in! After calibrating your VNA (to the SMA cable), just plug in your SMA cable to the SMA connector on the measurement board. Our target frequency is 13.56MHz and I set the frequency range from 2MHz to 50MHz to get a bit more context.
In the VNA_QT, to find exactly what frequency the peak occurs at, I would drag the frequency slider at the bottom right until the impedance magnitude shown in blue would peak; you might have also noticed, at resonance, there is minimal reactance as shown by the point on the smith chart that lies on the horizontal axis (horizontal axis of smith charts is purely resistive). Here we're seeing 999 Ohms at 10.18MHz because I had 106pF of total parallel capacitance from misinterpreting the NXP coil calculator excel sheet. Sorry the screenshot quality is so low, but as another self plug, I measured this on twitch.
Tuning Resonance
On my twitch stream, after removing the 56pF parallel capacitor, my resonant circuit is now a 2.41uH inductor and a 50pF parallel capacitance (from the NFC IC). I measured resonance to be at 14MHz which is not too far off from 13.56MHz and it definitely improved the responsiveness of the business card compared to when its resonance was 10MHz.
Honestly, this is where I stopped because my business card was able to work nicely enough for a demo. But if you wanted to modify your resonance, I would purchase a couple extra 0402 capacitors a few pF higher and lower from your original calculation. In my situation, adding 6-9pF of capacitance to total 56-59pF of capacitance would lower my resonance from 14MHz to around 13.56MHz. Again, it doesn't have to be perfect to work in a demo which is why I decided not to populate it at the time being, but I would play around with more values in the future if I ordered another revision.
As you can see in this microscope shot, the tuning capacitor is removed so I am relying only on the 50pF from the NFC IC. Luckily for me, 14MHz was close enough to the 13.56MHz target!
How to Program the NFC IC
Warning: I've only had success programming the NT3H2111 using an Android device; I tried this process with an iPhone but got writing errors. Specifically, I used a Pixel 4; I suspect there might be some writing permission discrepancies between phone NFC chipsets so I'm not even sure this will work on any Android device.
With that out of the way, you're probably aware of NFC tag writer apps.
The only app you need is NFC TagWriter by NXP. Before we can write to the tag, we must partition it as "NDEF" because they come blank from the factory.
Then click "Erase and Fromat as NDEF" and type 492 bytes when it asks you for how large you want the partition to be. (I can't remember how I found this number, maybe it can be a lot larger).
Once this is complete, you can add all sorts of datasets to the tag. This part is pretty self explanatory. Although I mentioned you only need the NXP Tagwriter, I find that NFC Tools is a much more pleasant experience when writing datasets. For career fairs and events, I'll just put my flux.ai/markwuflux link as the only dataset, but for more professional networking settings, I add a contact card dataset instead. Doing so allows your new acquaintance to add all your contact info without awkwardly passing around each others' phones.
Conclusion
We covered a lot of topics in this Instructables! I wanted to go in depth on the main engineering points that stuck out to me; I hope I effectively conveyed what resonance means, how to engineer for it in a circuit, how to use tools to measure it, how to build a PCB trace coil in flux, and how to program the NFC IC used in this tutorial. If there are points you'd like me to elaborate on, please give me feedback; I would love to know you, the audience, better!
Build stuff, have fun, and crush it out there networking with others! (I'm also "others" so network with me too :P. Follow me on flux.ai/markwuflux or email me at mark@flux.ai.)