Sensor Types
All event streams in the LAMP API are catalogued by a timestamp and specific "blueprints" (schema) of what kind of data they hold. For example, a sensor event that occurred 20 minutes ago would carry that instant's timestamp, along with a link to what kind of sensor it was, and that sensor's measurement as a payload of data. The kinds of activities and sensors available are declared below, along with the blueprint you can expect their events' data to follow.
Active sensor events are produced on a rolling basis in the background via interactions by a Participant. They are transferred to the Platform Server automatically by using the Activity API written in JavaScript. A list of existing Sensors is provided below with name and description; a live server instance must be consulted for data schema information (see GET /sensor_spec). Implementations for these hardware sensors are provided in the GitHub repository.
All permission requests must be accepted on both iOS and Android mobile apps, regardless of whether the appropriate Sensor
is activated. (i.e. Call & Text
access must be approved by the user even if lamp.sms
and lamp.calls
is not added for the study or clinic.)
Sensor Sampling Rates
Different sensors collect and report data at different frequencies. The data sampling rate of most sensors falls into one of three broad categories:
- Continuous: All data is collected and uploaded with a timestamp equal to the moment it occurred.
- Discrete: Not all data is collected and uploaded to the server. The available data is sampled every n seconds as defined by a
frequency
parameter. - Interval: The available data over the course of n minutes is compiled into a report describing the events in that span. There will be a single data point every n minutes.
For applicable sensors, the frequency parameter is customizable. To change the frequency, see: docs.lamp.digital/start_here/updating_frequency
For some sensors, the data that is returned is different for iOS versus Android phones. This is documented below.
Name | SensorSpec | Sampling Type | Requires watch / other device |
---|---|---|---|
Analytics | lamp.analytics | Continuous | |
Location | lamp.gps | Discrete | |
Accelerometer | lamp.accelerometer | Discrete | |
Device Motion | lamp.device_motion | Discrete | |
Screen | lamp.device_state | Continuous | |
Pedometer | lamp.steps | Interval | |
Bluetooth & WiFi | lamp.nearby_device | Discrete | |
Calls & Texts | lamp.telephony | Continuous | |
Sleep | lamp.sleep | Continuous | Y |
Workouts | lamp.segment | Continuous | Y |
Activity Recognition | lamp.activity_recognition | Continuous | Y |
Nutrition | lamp.nutrition | Continuous | Y |
Blood Glucose | lamp.blood_glucose | Continuous | Y |
Oxygen Saturation | lamp.oxygen_saturation | Continuous | Y |
Body Temperature | lamp.body_temperature | Continuous | Y |
Blood Pressure | lamp.blood_pressure | Continuous | Y |
Heart Rate | lamp.heart_rate | Continuous | Y |
Heart Rate Variability | lamp.heartratevariability_sdnn | Continuous | Y |
Respiratory Rate | lamp.respiratory_rate | Continuous | Y |
Deprecated sensors:
Name | SensorSpec | Replaced by | Requires watch / other device |
---|---|---|---|
Device Motion | lamp.gyroscope | lamp.device_motion | |
lamp.magnetometer | lamp.device_motion | ||
Location | lamp.distance | ||
Pedometer | lamp.flights | ||
Screen | lamp.screen_state | lamp.device_state | |
Calls & Texts | lamp.calls | lamp.telephony | |
lamp.sms | |||
Bluetooth & WiFi | lamp.bluetooth | ||
lamp.wifi | lamp.nearby_device | ||
Weight | lamp.weight | ||
Height | lamp.height |
Analytics
SensorSpec: lamp.analytics