===== Zephyr Basic Data Logging ===== [[hacks:zephyrproject|Zephyr Project @ VHS]] ==== Objective ==== Log data from all sensors on the board to csv file. ==== Steps ==== - Setup Build Environment - Port sensor code to Zephyr - Write/modify code for data logging to file - Build code - Flash code to board - 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 === * Needs to be implemented * Datasheet: http://www.st.com/content/ccc/resource/technical/document/datasheet/group3/b2/1e/33/77/c6/92/47/6b/DM00279086/files/DM00279086.pdf/jcr:content/translations/en.DM00279086.pdf * VL53L0X Class for mbed OS: https://os.mbed.com/teams/ST/code/X_NUCLEO_53L0A1/docs/8d27ebb4e1eb/classVL53L0X.html * C++ for mbedOS: https://github.com/dbaba/vl53l0x-mbedos * ST Provided API: http://www.st.com/content/st_com/en/products/embedded-software/proximity-sensors-software/stsw-img005.html I2C * Read=01010011(53h) * Write=01010010(52h) ====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|