upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
API for the TMP006 IR-Thermopile Sensor. More...
Description in web-link above: The TMP006 and TMP006B are fully integrated MEMs thermopile sensors that measure the temperature of an object without having to be in direct contact. The thermopile absorbs passive infrared energy from an object at wavelengths between 4 um to 16 um within the end-user defined field of view. The corresponding change in voltage across the thermopile is digitized and reported with the on-chip die thermal sensor measurement through an I2C- and SMBus-compatible interface. With this data, the target object temperature can be calculated by an external processor. The Infrared thermopile sensor is specified to operate from -40 to +125 [degC]. It is possible to measure an object temperature beyond the device operating range as long as the device itself does not exceed the operating temperature range (-40 to +125 [degC]).
Public Member Functions | |
TMP006 (int bus, uint8_t conv_rate=TMP006_CONFIG_CR_DEF, int devAddr=TMP006_I2C_ADDRESS) | |
int | checkID (void) |
void | resetSensor (void) |
void | setActive (void) |
void | setStandby (void) |
int | sampleData (void) |
void | convert_data (int16_t rawv, int16_t rawt, float *tamb, float *tobj) |
float | getTemperature (int bSampleData=0) |
uint16_t | getConfig (void) |
TMP006 | ( | int | bus, |
uint8_t | conv_rate = TMP006_CONFIG_CR_DEF , |
||
int | devAddr = TMP006_I2C_ADDRESS |
||
) |
Instantiates an TMP006 object
bus | Number of the used bus |
conv_rate | Conversation rate (allowed between 0 and 4) |
devAddr | Address of the used I2C device |
int checkID | ( | void | ) |
Check device_id of sensor
void resetSensor | ( | void | ) |
Performs a soft reset of the TMP006 device to ensure it is in a known state.
void setActive | ( | void | ) |
Set active mode, this enables periodic measurements.
void setStandby | ( | void | ) |
Set standby mode, this disables periodic measurements.
int sampleData | ( | void | ) |
Read out data of regs and call further function Also saves converted value to variable
void convert_data | ( | int16_t | rawv, |
int16_t | rawt, | ||
float * | tamb, | ||
float * | tobj | ||
) |
Convert raw sensor values to temperature.
rawv | Object voltage value |
rawt | Raw die temperature value |
tamb | Converted ambient temperature |
tobj | Converted object temperature |
float getTemperature | ( | int | bSampleData = 0 | ) |
Get the calculated object temperature [degC]
bSampleData | Flag to read sensor |
uint16_t getConfig | ( | void | ) |
Get value of configuration reg