Apple Watch Sensing
Collect passive sensor data from an Apple Watch in a CARP Mobile Sensing study.
carp_aware_package adds an Apple Watch as a data source to a CARP Mobile Sensing (CAMS) study. The watch collects motion, heart rate, location, sound and more while the participant wears it, including when the phone app is closed, and hands the data to the phone a few times an hour.
The package wraps the AWARE watchOS sensing framework by Yuuki Nishiyama (The University of Tokyo).
iOS and watchOS only
The package supports iOS and watchOS only, and it needs a companion watchOS app inside your Flutter app's Xcode project. Without that app, the package has nothing to receive. You add it once, as described in The watch app.
Features
Buffered data transfer
The watch buffers data locally and transfers it every 15 minutes by default. Each record carries the timestamp set by the watch.
Background collection
The watch keeps collecting when it is out of range and when the phone app has been killed. iOS wakes your app in the background to receive the files.
Protocol configuration
Sampling rates and which sensors run are part of the study protocol. Deploying a new protocol from CARP Web Services reconfigures the watch.
No raw audio
Sound sensing produces a decibel value and a classification label. The recording is analyzed on the watch and discarded; no raw audio leaves the watch.
How it works
Architecture follows the full path from a sensor reading on the watch to a row in your data set.
Measure types
The package provides nine measure types in the dk.carp.watch.aware namespace:
| Measure type | Data class | Contents |
|---|---|---|
dk.carp.watch.aware.motion | AppleWatchMotion | Acceleration, attitude, gravity, rotation rate, user acceleration |
dk.carp.watch.aware.heartrate | AppleWatchHeartRate | Heart rate in BPM, read from HealthKit |
dk.carp.watch.aware.battery | AppleWatchBattery | Battery level and charging state of the watch |
dk.carp.watch.aware.location | AppleWatchLocation | Latitude, longitude, altitude, speed, course |
dk.carp.watch.aware.heading | AppleWatchHeading | Compass heading and geomagnetic field |
dk.carp.watch.aware.bluetooth | AppleWatchBluetooth | Nearby Bluetooth devices seen by the watch |
dk.carp.watch.aware.ambientnoise | AppleWatchAmbientNoise | Noise level in decibel |
dk.carp.watch.aware.audiolabel | AppleWatchAudioLabel | Sound classification labels (speech, laughter, …) |
dk.carp.watch.aware.device | AppleWatchDeviceInfo | Watch model, watchOS version, and the phone it is paired with |
Data types documents every field of every type.
Requirements
| Requirement | Value |
|---|---|
| Platforms | iOS and watchOS. Android is not supported. |
| iOS deployment target | 16.0 |
| watchOS deployment target | 8.0 |
| Flutter | 3.29 or newer (Swift Package Manager support) |
| Dart SDK | 3.8 or newer |
| Testing | A physical iPhone with a paired Apple Watch |
Test on real devices
The simulator cannot pair a watch to a phone in a way that makes WatchConnectivity file transfers work end to end, and heart rate needs real hardware.
Next steps
Installation
Add the dependency and prepare the iOS project.
Quickstart
Build a complete study protocol with an Apple Watch in it.
The watch app
Add the companion watchOS app. This step is required.
Configuration
Every setting on AppleWatchDevice, and what it costs.
Credits
The watchOS sensing framework wrapped by this package is com.awareframework.ios.sensor.applewatch by Yuuki Nishiyama (The University of Tokyo), available under the Apache License 2.0.
If this framework supports your research, please cite:
Y. Nishiyama and K. Sezaki, "Smartwatch-Based Sensing Framework for Continuous Data Collection: Design and Implementation", UbiComp/ISWC '23 Adjunct, pages 620–625, ACM, 2023.