NFC Performance: It’s All In The Antenna

NFC tags are a frequent target for experimentation, whether simply by using an app on a mobile phone to interrogate or write to tags, by incorporating them in projects by means of an off-the-shelf module, or by designing a project using them from scratch. Yet they’re not always easy to get right, and can often give disappointing results. This article will attempt to demystify what is probably the most likely avenue for an NFC project to have poor performance, the pickup coil antenna in the reader itself.

A selection of the NFC tags on my desk
A selection of the NFC tags on my desk

The tags contain chips that are energised through the RF field that provides enough power for them to start up, at which point they can communicate with a host computer for whatever their purpose is.

“NFC” stands for “Near Field Communication”, in which data can be exchanged between physically proximate devices without their being physically connected.  Both reader and tag achieve this through an antenna, which takes the form of a flat coil and a capacitor that together make a resonant tuned circuit. The reader sends out pulses of RF which is maintained once an answer is received from a card, and thus communication can be established until the card is out of the reader’s range. Continue reading “NFC Performance: It’s All In The Antenna”

Hacked Punch-Out Controlled With Actual Punches

In a slightly safer departure away from jetpack roller-skating and flinging around bolts of lightning, [Ian Charnas] has been hacking retro video games. After a lot of hard work [Ian] has managed to add pose estimation to control the character in the NES boxing game “Punch-Out.” Surely he can’t get hurt doing that? No, but since it wasn’t fair to hurt the poor suffering characters, without taking any damage himself, he added electric-shock feedback to give the game a bit more, ahem, punch. See, you can get hurt playing video games!

By starting with Google MoveNet, which is a pre-baked skeletal tracking model which can run in a browser using TensorFlowJS, he defined some simple heuristics for the various boxing moves usually performed with the game controller. Next, he needed to get the game. Being a all-round good guy, [Ian] bought an original copy of the game cartridge to obtain the license, then using the USB CopyNES from RetroUSB, dumped out the game binary for the next step.

Emulation of the NES hardware was chosen, taken care of by FCEUX, in order to run the game and the posture model on the same machine. This simplified the control of the game, since it would be somewhat more work to have it run on the original NES. By using emscripten, FCEUX was cross-compiled to WebAssembly, and so both the game and control side are both in the land of JavaScript. To be honest, after playing the game a little, [Ian] found it far too fast to be playable with posture control, as opposed to much faster button pressing, so some game hacking was required. Emulation made this much easier.

It took [Ian] around two months of disassembling the game binary, and figuring out the game logic around the characters in order to slow them down enough to make it playable, but he did manage it. You can be the judge, since he bought a bunch more cartridges to unlock more license copies, you can play it too. Just don’t add the electric-shock part, nobody needs to be administered electric shock therapy from a two inch high bright orange Mike Tyson!

Continue reading “Hacked Punch-Out Controlled With Actual Punches”

3D Printed Absolute Encoder Is Absolutely Wonderful

When you need to record the angle of something rotating, whether it’s a knob or a joint in a robotic arm, absolute rotary encoders are almost always the way to go. They’re cheap, they’re readily available, and it turns out you can make a pretty fantastic one out of a magnetic sensor, a zip tie, and a skateboard bearing.

When [Scott Bezek] got his hands on a AS5600 magnet sensor breakout board, that’s just what he did. The sensor itself is an IC situated in the middle of the board, which in Scott’s design sits on a 3D-printed carrier. A bearing mount sits atop it, which holds — you guessed it — a bearing. Specifically a standard 608 skateboard bearing, which is snapped into the mount and held securely by a zip tie cinched around the mount’s tabs. The final part is a 3D-printed knob with a tiny magnet embedded within, perpendicular to the axis of rotation. The knob slides into the bearing and the AS5600 reads the orientation of the magnet.

Of course, if you just wanted a rotary knob you could have just purchased an encoder and been done with it, but this method has its advantages. Maybe you can’t fit a commercially-available encoder in your design. Maybe you need the super-smooth rotation provided by the bearing. Or maybe you’re actually building that robotic arm — custom magnetic encoders like this one are extremely common in actuator design, and while the more industrial versions (usually) have fewer zip ties, [Scott]’s design would fit right in.

Continue reading “3D Printed Absolute Encoder Is Absolutely Wonderful”