Guide for Artik530 710 with Tizen 4.0/Sensor

From Tizen Wiki
Jump to: navigation, search

Sensor devices are used in most mobile devices to enhance user experience. Tizen 4.0 supports a framework which manages hardware and virtual sensors on the platform and provides convenient API to the application. Refer to the architecture of sensor framework and porting guide for adding new hardware sensors in detail on this

Overview

The following list of sensors is supported by default on Tizen 4.0. so you can check the operation for using existed sensor or adding new sensor before.

Sensor Functions Model I2C address
Accelerometer LSM9DS0(BerryGPS-IMU) 0x1E
Magnetometer LSM9DS0(BerryGPS-IMU) 0x1E
Gyroscope LSM9DS0(BerryGPS-IMU) 0x6A
Pressure BMP280 (BerryGPS-IMU) 0x77
Temperature BST-BMP280-DS001-11 0x76
HRM LED IR MAX30100 0x57
HRM LED RED MAX30100 0x57
Proximity vcnl4010 0x13
Light TSL2561 0x29 or 0x39 or 0x49

Environment

Sensor Connection

Sensor module have to be connected by power and i2c signal from target platform board as the following diagram.

SensorForTizen40.jpg
                           Sensor Connection Diagram

Install plugin & test program

Package For
peripheral-bus-0.1.0-9.1.armv7l.rpm command
external-sensor-plugins-artik7-0.0.2-0.armv7l.rpm Artik710
external-sensor-plugins-artik5-0.0.2-0.armv7l.rpm Artik530
external-sensor-plugin-rpi3-0.0.2-0.armv7l.rpm Raspberry PI3

Connection Check

you can check connected sensors in the contents of log message using Dlogutil after boot as the following examples.

root:~> dlogutil SENSOR
I/SENSOR  ( 2156): sensor_manager.cpp: show(390) > ========== Loaded sensor information ==========
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #1[http://samsung.com/sensor/healthinfo/pedometer/sa 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://samsung.com/sensor/healthinfo/pedometer/samsung_pr
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = samsung_pedometer
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #2[http://tizen.org/sensor/general/accelerometer/acc 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/accelerometer/acceleromer
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = LSM9DS0
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #3[http://tizen.org/sensor/general/auto_rotation/tiz 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/auto_rotation/tizen_defat
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = tizen_default
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #4[http://tizen.org/sensor/general/geomagnetic_rotat 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/geomagnetic_rotation_vect
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = tizen_default
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #5[http://tizen.org/sensor/general/gravity/tizen_low 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/gravity/tizen_lowpass
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = tizen_lowpass
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #6[http://tizen.org/sensor/general/light/light]: 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/light/light
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = TSL2651
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #7[http://tizen.org/sensor/general/linear_accelerati 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/linear_acceleration/tizet
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = tizen_default
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #8[http://tizen.org/sensor/general/magnetic/magnetom 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/magnetic/magnetometer
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = LSM9DS0
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #9[http://tizen.org/sensor/general/pressure/pressure 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/pressure/pressure
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = BMP280
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #10[http://tizen.org/sensor/general/proximity/proxim 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/proximity/proximity
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = VCNL4010
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #11[http://tizen.org/sensor/general/temperature/temp 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/general/temperature/temperature
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = BMP280
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #12[http://tizen.org/sensor/healthinfo/heart_rate_mo 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/healthinfo/heart_rate_monitor.ler
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = MAX30100
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(394) > Sensor #13[http://tizen.org/sensor/healthinfo/heart_rate_mo 
I/SENSOR  ( 2156): sensor_info.cpp: show(275) > URI = http://tizen.org/sensor/healthinfo/heart_rate_monitor.led
I/SENSOR  ( 2156): sensor_info.cpp: show(276) > Model = MAX30100
...............
I/SENSOR  ( 2156): sensor_manager.cpp: show(397) > ===============================================

Sensor Operations

Run the following command to check the value of connected sensor. in case of ARTIK710,

$ ./external-sensor-plugins-artik7-test ./libexternal-sensor-plugins-artik7.so

or in case of ARTIK530 or Raspberry PI3, run the following command instead of above command.

$ ./external-sensor-plugins-artik5-test ./libexternal-sensor-plugins-artik5.so
$ ./external-sensor-plugins-rpi3-test ./libexternal-sensor-plugins-rpi3.so

Then, scroll the measured values on terminal.

VCNL4010:SENSOR PROXIMITY:+2371.00000
TSL2651:SENSOR LIGHT:+55.00000
LSM9DS0:SENSOR GYROSCOPE:+96.53000 +137.13000 +178.00999
BMP280:SENSOR TEMPERATURE:+33.91000
MAX30100:SENSOR HRM LED RED:+51199.00000
LSM9DS0:SENSOR ACCELEROMETER:+0.09692 +0.00022 -0.01237
LSM9DS0:SENSOR GEOMAGNETIC:-258.92001 -107.33600 -246.03200
..........