Designing the Active Fitness Trail

Owyong Jian Wei
SCTD, GovTech
Published in
5 min readFeb 28, 2023

During my internship with GovTech Singapore, I took on a part-time project with the Sensors and Internet of Things (SIOT) division (now Smart City Tech Division, SCTD) from November to December 2022.

Active Fitness Trail Track

During this period, I was given the opportunity to work on the Active Fitness Trail track, which is part of a larger initiative called the Health District. The goal of Health District is to enhance the health and wellness of residents of different neighbourhoods. Following the same trajectory, the Active Fitness Trail aims to assess and group individuals, particularly elderly residents, based on their level of health and fitness. This is done by measuring gait speed, which is a more detailed examination of a person’s walking ability. Gait speed assessment is an important tool in assessing a person’s mobility, functional capacity, and overall health, and is often used in research and clinical practice. Through this effort, we hope to gain helpful insights and identify risk factors early, which can lead to appropriate interventions to improve health outcomes and quality of life in the long run.

Components in the Prototype

1. NFC Watch Strap

To kick-start my involvement, I began by researching the capabilities of NFC for data storage and identifying a way to align it with our project goals. One important design consideration at this stage was to ensure that the toolkit for encoding and decoding data into NFC was vendor-neutral. Therefore, I decided to use NFCPy given that its underlying implementation uses NFC Data Exchange Format (NDEF) which is a standard for encoding data onto NFC tags. The NFCPy library also provides an additional layer of abstraction by automatically converting raw hexadecimal string into NDEF.

However, I encountered a limitation with NFCPy, as it only supports UART device-to-device communication protocol. Due to a GPIO pin conflict with another RPi4 HAT, the NFC HAT had to switch to the SPI protocol, which is not compatible with NFCPy. After considering several workarounds, I decided to implement an algorithm to clean and extract pieces of raw hexadecimal string from the NFC tag and reconstruct it into NDEF before utilising ndeflib to interpret it.

2. NFC Checkpoint

The checkpoint is a combination of four key hardware components:

  • Raspberry Pi computer
  • Battery management system and additionally a solar panel to achieve self-sufficiency
  • 4G SIM card for internet connectivity
  • NFC HAT to read and write NFC tags

There are also two software services running, managed by systemd: NFC scanning service and device health service. The NFC scanning service decodes the identifier stored in the NFC tag and transmits data to the server. The device health service publishes battery percentage, charging status, and online status every 10 seconds.

Utilising systemd allows for automatic initialisation of services at system boot, automatic recovery in case of failure, and efficient management of system resources.

3. API Server and Database

API server was temporarily exposed to the internet without provisioning actual servers, by using ngrok to open access to the local machine’s port on which the server is running

Upon receiving requests from clients, the API triggers computation of Haversine distance and cumulative gait speed using check-in data within a specified time interval (e.g. within the day). The resulting data is then saved in a JSON-like format within the database’s collections.

Opportunities for Improvements

1. Experimenting with RFID

During prototype testing, the team identified that the speed and range of the NFC technology could be improved. In particular, the seamless “EZ-Link experience” that is familiar to many Singaporeans would likely be a point of comparison — due to the similarities present. One potential solution is to replace NFC with RFID technology, which uses radio waves similar to the EZ-Link system, instead of the magnetic fields used by NFC. RFID technology generally has a wider detection range and faster scanning capabilities than NFC, resulting in improved scanning speed and increased coverage of checkpoints.

2. Improving Form Factor

One benefit of using Raspberry Pi with HATs is that it allows for easy integration of components, which enables rapid prototyping. However, there may be challenges when it comes to the physical deployment of the device in an outdoor environment, as a bulky setup may be difficult to weatherproof and may not be user-friendly. A potential solution to this issue could be to create custom circuit boards with only the necessary components, which can also help to reduce costs by making the device highly specialised rather than using a general-purpose Raspberry Pi computer.

Takeaways

1. Knowledge Sharing with Visual Aids

One practice that I found particularly beneficial to adopt during my time with the team was their proactiveness in sharing information. Even as a newcomer, I was able to quickly gain an understanding of the different tracks and their progress after attending my first meeting. While knowledge sharing is a common practice among agile teams, it is not always executed effectively. My personal opinion on why the Health District team was so successful in this practice was because of their use of visual aids.

Somedays, it could be a polished pre-recorded demonstration while on other days it could be just a sketch. But visual aids are not always about presentation. Sometimes they could also be a way to start a conversation. And a simple sketch can often be a better way to openly discuss what may otherwise be difficult to present verbally.

As my short but fulfilling internship with SIOT (now SCTD) GovTech comes to a close, I am grateful for the opportunity to have worked on exciting projects in the field of Internet of Things. Though it was a shorter-than-usual internship, I was able to dive deep into the field and gained valuable experience in testing and integrating sensors — which required me to work on both hardware and software components simultaneously. I would like to express my gratitude to my mentor Ding Hao, Chin Hiong and the rest of the team for their guidance and mentorship throughout my time. Their support and expertise have been invaluable in my growth and development as a developer.

--

--