User Tools

Site Tools


hacks:boards:rtos:zephyr:datalogging

Zephyr Basic Data Logging

Objective

Log data from all sensors on the board to csv file.

Steps

  1. Setup Build Environment
  2. Port sensor code to Zephyr
  3. Write/modify code for data logging to file
  4. Build code
  5. Flash code to board
  6. Test

Notes

HTS221: Capacitive digital sensor for relative humidity and temperature

  • Temperature (SENSOR_CHAN_TEMP, C)
  • Humidity (SENSOR_CHAN_HUMIDITY, mili-percent)

I2C

  • Read=10111111 (BFh)
  • Write=10111110 (BEh)

LIS3MDL: High-performance 3-axis magnetometer

  • Magnetometer (SENSOR_CHAN_MAGN_X, SENSOR_CHAN_MAGN_Y, SENSOR_CHAN_MAGN_Z, SENSOR_CHAN_MAGN_XYZ)

I2C

  • Read= 00111101 (3Dh)
  • Write=00111100 (3Ch)

LSM6DSL: 3D accelerometer and 3D gyroscope

  • accelerometer (SENSOR_CHAN_ACCEL_X, SENSOR_CHAN_ACCEL_Y, SENSOR_CHAN_ACCEL_Z, SENSOR_CHAN_ACCEL_XYZ)
  • gyroscope (SENSOR_CHAN_GYRO_X, SENSOR_CHAN_GYRO_Y, SENSOR_CHAN_GYRO_Z, SENSOR_CHAN_GYRO_XYZ)
  • temperature (SENSOR_CHAN_TEMP - C)

I2C

  • Read= 11010101 (D5h)
  • Write=11010100 (D4h)

LPS22HB: 260-1260 hPa absolute digital output barometer

  • pressure(SENSOR_CHAN_PRESS - kPA)
  • temperature(SENSOR_CHAN_TEMP - C)

I2C

  • Read= 10111011 (BBh)
  • Write=10111010 (BAh)

VL53L0X: Time-of-Flight and gesture-detection sensor

I2C

Table 3. I2C addresses for each module

Modules Description SAD[6:0] + R/W I2C write address I2C read address
HTS221 Capacitive digital sensor for relative humidity and temperature 1011111x 0xBE 0xBF
LIS3MDL 3-axis magnetometer 0011110x 0x3C 0x3D
LPS22HB MEMS nano pressure sensor 1011101x 0xBA 0xBB
LSM6DSL 3D accelerometer and 3D gyroscope 1101010x 0xD4 0xD5
VL53L0X Time-of-Flight ranging and gesture detection sensor 0101001x 0x52 0x53
M24SR64-Y Dynamic NFC/RFID tag IC 1010110x 0xAC 0xAD
STSAFE-A100 - 0100000x 0x40 0x41
hacks/boards/rtos/zephyr/datalogging.txt · Last modified: 2017/10/24 20:13 by jdmc

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki