Accelerometer (lamp.accelerometer)
Records device acceleration in three axes. Units are g (multiples of gravitational acceleration, where 1 g ā 9.81 m/s²). At rest with the screen facing up, the z-axis reads approximately -1.0 g. The coordinate plane is relative to the device.
Configurationā
- SensorSpec:
lamp.accelerometer - Sampling: Discrete (default 5 Hz ā 5 samples per second)
- Platform: iOS, Android
- Permissions: Motion & Fitness required
Configure sampling rate via the API.
API settings fields
| Setting | API Field | Type | Default | Max |
|---|---|---|---|---|
| Sampling Rate | frequency | number (Hz) | 5 | 5 |
Quality Factorsā
- Motion & Fitness permissions must be granted.
- Battery optimization can restrict background sensor access.
- Higher sampling rates produce more granular data but consume more battery.
Usageā
Accelerometer data is collected continuously in the background. No participant action is required.
note
On Android, accelerometer data may be delivered inside a DeviceMotion-style structure with a motion sub-object. Cortex normalizes this automatically. The data format described here is the canonical iOS format.
Dataā
Fieldsā
| Field | Type | Unit | Description |
|---|---|---|---|
x | float | g | Acceleration on x-axis (left to right across the screen) |
y | float | g | Acceleration on y-axis (bottom to top of the screen) |
z | float | g | Acceleration on z-axis (out from the screen toward the user) |
Exampleā
{
"timestamp": 1649859212042,
"sensor": "lamp.accelerometer",
"data": {
"x": 0.19378,
"y": 1.28474,
"z": -0.19385
}
}
Cortex Featuresā
accelerometer (raw) ā acc_jerk (primary) ā inactive_duration (secondary)
View in Portal | Python SDK | API Reference