MacBook Pro Trackpad Transforms into a Digital Scale: Creator Leverages Force Touch Tech for Weight Measurement, Open- sourcing the Code.
A new application called TrackWeight has been unveiled by Canadian maker and blogger Krish Shah, offering an innovative way to measure weights using a MacBook's built-in hardware.
TrackWeight leverages the Force Touch trackpad on recent MacBooks to measure weight by detecting pressure, converting this force into grams. The app is designed for objects weighing from a few tens of grams up to about 3.5 kilograms, making it suitable for a wide range of everyday items.
The development of TrackWeight was not solely inspired by ideas but also relied on contributions from several sources, including the Open Multi-Touch Support library and prior work by Takuto Nakamura (@Kyome22). This library provides access to global multitouch events on macOS trackpads, as well as detailed touch data including position, pressure, angle, and density.
Combine was used for reactive data flow in the app, ensuring a smooth and responsive user interface. SwiftUI was employed for the user interface of the app, providing a modern and intuitive experience for users.
To perform as per its billing, finger contact with the Apple Force Touch trackpad must be maintained. This requirement can slightly influence weight readings, and the app works best with non-metallic objects. Weighing metallic items on a thin paper towel is suggested to isolate their effect and prevent potential misreadings.
It's important to note that TrackWeight is experimental and intended for educational purposes only. It should not be used for commercial or precision-critical contexts, nor for highly precise or critical weighing tasks, nor for very heavy items that might risk damage to the trackpad. The app is also not recommended for weighing items beyond single-digit kilo measurements.
Instructions for building and running the TrackWeight app are provided, and the code is available on GitHub under the open-source MIT License. However, it's worth mentioning that using TrackWeight with metallic objects may result in misreadings, and the app is not advertised for use in weighing luggage at the airport or for personal body weight measurements, as it may cause damage to the laptop.
In summary, TrackWeight provides a clever and surprisingly reliable way to weigh small to moderately heavy items using a MacBook’s built-in hardware. While it is limited by physics, hardware design, and safety considerations, it offers an intriguing and educational experience for MacBook users.
The ingenious TrackWeight application, developed by Krish Shah, utilizes the Force Touch trackpad on modern MacBooks to measure the weight of various everyday items, including gadgets and smartphones, by detecting pressure. This creative use of technology is made possible through contributions from libraries such as Open Multi-Touch Support and prior work by Takuto Nakamura.