How $7 of NFC Tags + iPhone Help Me Easily Track Vitamin D and Water Consumption
By: Will J Murphy
Tags: Gadgets, Apple Health, iPhone, Nfc, Lifestyle

I knew that I should be drinking more water and taking a daily vitamin D pill, but was I? Usually. Maybe? I remembered to take a vitamin D pill most mornings, but sometimes I’m in a rush. You know how it is. Did I forget to take one this morning? Don’t know.

Keeping track of how much water I drink is even more of a chore. A friend gave me a water bottle, which was great, but I kept losing track. Did I drink two bottles today? One? Three?

NFC to the rescue!

NFC is the technology used with contactless payments, and iOS 14 Shortcuts lets you detect when your iPhone is near a NFC tag. You can buy 50 NFC tags off Amazon for about $7, so could I use those to track vitamins and water consumption?

How might that work? Each tag has an unique ID, and you can associate a tag with particular actions. Apple call it triggering an Automation. Don’t worry about the weird name.

Wouldn’t it be good if I could tap tags on the top of vitamin D and water bottles with my iPhone, and add records to Apple Health? How hard would it be?

It isn’t hard at all, because everything can be done with Shortcuts in a single step. I had to put my thinking cap on when it came to the water bottle though.

Oh, you need to spend $7 on NFC tags. They’re on Amazon. I’ll wait.

I’m now tracking vitamin D and know how much water I drink without having to think about it. You can too. I’ll walk you through the process.

What you’ll need

I assume that you have an iPhone 6 or later and NFC tags.

Your iPhone should be running iOS 14 or later, because that has the version of Shortcuts that detects NFC tags.

You don’t need to buy any apps.

Photo by author

What are NFC tags?

An NFC tag is a little chip embedded in plastic card. Something called inductance is used to sense the presence of a tag. That caused a problem with the water bottle, but I worked my way around that. See later.

Each tag has a small amount of memory (504 bytes in my case), which can be used to store useful information such as a contact or a WiFi password. You need an app to do that, but we just need to take advantage of each tag having a unique ID.

The gist of how to do it

Pick out a NFC tag.

Run the Shortcuts app on iOS14 or later.

Add a Personal Automation that triggers when the iPhone is close to our chosen NFC tag. (Not as tricky as it sounds.)

Label the Automation to show its purpose.

Select an action that will log data in Apple Health.

Did you get the tags?

Logging how much water you drink

Apple Shortcuts

Pick out one of your new trove of NFC tags. Run Shortcuts on your iPhone. Tap on the Automation icon.

Tap on the + sign on the top right, and choose “Create Personal Automation”.

Scroll down until you see NFC. Tap on that.

Adding an Automation (image by author)

Identifying the tag

The NFC detector on the iPhone seems to be at the top of the phone. Tap “Scan” and place the top of the iPhone on the tag. The iPhone will recognise it, and ask you to name it. Call it “Drink Water”. Tap “OK”.

Identifying a NFC tag (image by author)

Choosing the action

Tap “Next”, and you’ll be asked to choose an action on the next screen. Scroll down and choose “Log Health Sample” Tap on “Type”.

Choosing a Log Health Sample Action (screenshot by author)

Adding sample to Apple Health

Search for “Water”, and you’ll be asked to give permission for Shortcuts to access Health data. I gave it both read and write access.

Choose the value to use for the Water sample. My water bottle holds 500ml of water, so the sample size is 500ml.

Choose the current date and time, so that you know when the sample was made. Tap next.

Configuring the Health Sample (screenshots by author)

Ready to Go

Disable “Ask Before Running”, because you want it to happen automatically when you tap your chosen NFC tag. You’re done, so try it out.

Complete Automation Set-up (screenshot by author)

Attaching it to water bottle: once last challenge

Great, it works! I’ll stick the NFC tag to the top of the water bottle, and I’m set! Not so fast. The bottle top is made of metal, which stopped the iPhone detecting the NFC tag.

I guessed that it was something to do with the induction NFC uses to communicate with a NFC reader. What to do? Cardboard! I needed to shield the tag from the metal bottle top.

I tore off several pieces of card from old Amazon packaging. It took three layers of card to protect the NFC tag, but it worked. I cut the card to shape and wrote H2O on the tag. I glued the cardboard and the tags together, and it all works nicely.

Water bottle with NFC tag protected by card (image by author)

How to use it

This isn’t going to be a long section.

Fill up the bottle with water. (I like it chilled.)

Drink the water.

When the bottle is empty, tap your iPhone to the top of the bottle.

Repeat.

Run the Health app, tap on Browse and search for “Water”. Tap on it, and add it to your favourites. Every time you run the Health app,”Water” will be listed. Tap on it see your history.

Logging Vitamin D

This works in the same way. Pick out another NFC tag and create an Automation justs like you did for Water. Instead of searching for Water, search for vitamin D.

As before, set the value and date. Each of my tablets contain 1000IU of vitamin D, but IU is not one of the listed units. A quick Internet search revealed that 1000IU is equivalent to 25mcg, a unit that is listed.

I stuck the NFC tag on the bottle top, and since the bottle was plastic, not metal, it just worked.

Configuring vitamin D sample (screenshots by author)

How do you use it? Each morning I take a vitamin D tablet, and tap the tag with my iPhone. Couldn’t be easier.

Apple Health

Run the Health app on your iPhone to see everything you log. Use the “Browse” tab to find the Water and Vitamin D categories. Make them favourites, so that they appear on your summary screen. Now they’ll be easy to find when you launch the Health app.

What Apple could improve

The main limitation of Apple’s Shortcuts NFC implementation is that you have to create an Automation for every tag. It would have been much more useful if a Shortcut could read the tag identifier and then decide what to do at runtime. Maybe in iOS 15.

Friction-free tracking

Tracking your health has real benefits, but it’s a chore. The only way it’s going to work is if it requires no thought at all and it’s right there in front of you. It also helps if information is put somewhere useful.

NFC can deliver most of that. As long as you have your phone handy, you can quickly collect data, and Shortcuts ensures your health record is updated. You can use it with anything that you can stick a tag on, and I’ve shown you how to get around the problem of metal containers.

Let me know about what applications you some up with in the comments.