Users Guide

Table Of Contents
Retrieving raw data from sensors
To query sensor devices, run the command.
$ cat /sys/bus/iio/devices/iio:device*/name
hts221 <-- device0, Humidity and temp.
lng2dm_accel <-- device1, G-sensor
lps22hb <-- device2, Pressure
To retrieve data from the humidity and temperature sensor, run the command.
$ cat in_humidityrelative_offset
$ cat in_humidityrelative_raw
$ cat in_humidityrelative_scale
$ cat in_temp_offset
$ cat in_temp_raw
$ cat in_temp_scale
To retrieve data from the motion sensor, run the command.
$ cat in_accel_scale_available
$ cat in_accel_*_scale
$ cat in_accel_*_raw
To retrieve data from the pressure sensor, run the command.
$ cat in_pressure_raw
$ cat in_pressure_scale
Converting raw data for use
Apply the formula in the table to convert the raw data collected into usable measurements.
Table 17. Convert relative humidity and temperature sensor raw data
Relative humidity and temperature sensor ST Micro HTS221
RH (in %) = (in_humidityrelative_raw + in_humidityrelative_offset) * in_humidityrelative_scale
Temperature (degC) = (in_temp_raw + in_temp_offset) * in_temp_scale
Table 18. Convert motion sensor raw data
Motion sensorAccelerometer ST Micro LNG2DMTR
accel_{x/y/z} (m/s^2) = in_accel_{x/y/z}_raw * in_accel_{x/y/z}_scale
Table 19. Convert pressure sensor raw data
Pressure sensor ST Micro LPS22HB
Pressure (hPa) = in_pressure_raw * in_pressure_scale * 10
Temperature (m degC) = in_temp_raw * in_temp_scale
Ignition Pin
The ignition pin can be used to wake the system from S3, S4, and S5 power states. The user can use the operating system
power management to configure S3, S4, and S5 power states and shutdown.
NOTE:
For more information about configuring the ignition pin (using the system.power-key-action command), see
https://docs.ubuntu.com/core/en/reference/core-configuration.
64 Setting up the operating system