Driver for the Texas Instruments TMP00X sensor. More...
Driver for the Texas Instruments TMP00X sensor.
The TI TMP00X (Infrared Thermopile Contactless Temperature Sensor) measures the temperature of an object without need of direct contact with the object. After initialization the sensor can be set active for periodic measurements.
The conversion duration depends on oversample ratio. The oversample ratio can be determined by sensor initialization. The target object temperature can be calculated as follows:
Temperature of sensor's die (2 times right shifting and devide-by 32):
Difference Temperature in Kelvin:
Sensitivity of the thermopile sensor, with as calibration factor:
Sensor's voltage (the LSB size is ):
Offset voltage:
Seebeck coefficients of the thermopile:
Temperature of the target object:
Constants:
The calculation and constants are wrapped from TI TMP00X User's Guide SBOU107.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
Modules | |
TMP006/TMP007 Infrared Thermopile Sensor driver compile configuration | |
Files | |
file | tmp00x.h |
Interface definition for the TMP00X sensor driver. | |
file | tmp00x_params.h |
Default configuration for TMP00X (TMP006 and TMP007) devices. | |
file | tmp00x_regs.h |
Register definitions for TMP00X (TMP006 and TMP007) devices. | |
Data Structures | |
struct | tmp00x_params_t |
Parameters needed for device initialization. More... | |
struct | tmp00x_t |
Device descriptor for TMP00X sensors. More... | |
Macros | |
#define | BUS (dev->p.i2c) |
BUS. | |
#define | ADDR (dev->p.addr) |
ADDR. | |
Enumerations | |
enum | { TMP00X_OK, TMP00X_ERROR_BUS, TMP00X_ERROR_DEV, TMP00X_ERROR_CONF, TMP00X_ERROR } |
TMP00X specific return values. More... | |
Functions | |
int | tmp00x_init (tmp00x_t *dev, const tmp00x_params_t *params) |
Initialize the TMP00X sensor driver. More... | |
int | tmp00x_reset (const tmp00x_t *dev) |
Reset the TMP00X sensor, afterwards it should be reinitialized. More... | |
int | tmp00x_set_active (const tmp00x_t *dev) |
Set active mode, this enables periodic measurements. More... | |
int | tmp00x_set_standby (const tmp00x_t *dev) |
Set standby mode. More... | |
int | tmp00x_read (const tmp00x_t *dev, int16_t *rawv, int16_t *rawt, uint16_t *drdy) |
Read sensor's data. More... | |
void | tmp00x_convert (int16_t rawv, int16_t rawt, float *tamb, float *tobj) |
Convert raw sensor values to temperature. More... | |
int | tmp00x_read_temperature (const tmp00x_t *dev, int16_t *ta, int16_t *to) |
Convenience function to get ambient and object temperatures in [°C]. More... | |
Conversion rate and AVG sampling configuration | |
#define | TMP00X_CONFIG_CR_AS1 (0x00) |
Conversion Time 0.25s, AVG Samples: 1. | |
#define | TMP00X_CONFIG_CR_AS2 (0x01) |
Conversion Time 0.5s, AVG Samples: 2. | |
#define | TMP00X_CONFIG_CR_AS4 (0x02) |
Conversion Time 1s, AVG Samples: 4. | |
#define | TMP00X_CONFIG_CR_AS8 (0x03) |
Conversion Time 2s, AVG Samples: 8. | |
#define | TMP00X_CONFIG_CR_AS16 (0x04) |
Conversion Time 4s, AVG Samples: 16. | |
#define | TMP00X_CONFIG_CR_DEF TMP00X_CONFIG_CR_AS4 |
Default for Testing. | |
Constants for TMP00X calibration | |
#define | TMP00X_CCONST_S0 (6.4E-14) |
Calibration Factor. | |
#define | TMP00X_CCONST_A1 (1.75E-3) |
Constant . | |
#define | TMP00X_CCONST_A2 (-1.678E-5) |
Constant . | |
#define | TMP00X_CCONST_TREF (298.15) |
Constant . | |
#define | TMP00X_CCONST_B0 (-2.94E-5) |
Constant . | |
#define | TMP00X_CCONST_B1 (-5.7E-7) |
Constant . | |
#define | TMP00X_CCONST_B2 (4.63E-9) |
Constant . | |
#define | TMP00X_CCONST_C2 (13.4) |
Constant . | |
#define | TMP00X_CCONST_LSB_SIZE (156.25E-9) |
Sensor Voltage Register LSB Size. | |
anonymous enum |
void tmp00x_convert | ( | int16_t | rawv, |
int16_t | rawt, | ||
float * | tamb, | ||
float * | tobj | ||
) |
Convert raw sensor values to temperature.
[in] | rawv | object voltage value |
[in] | rawt | raw die temperature value |
[out] | tamb | converted ambient temperature |
[out] | tobj | converted object temperature |
int tmp00x_init | ( | tmp00x_t * | dev, |
const tmp00x_params_t * | params | ||
) |
Initialize the TMP00X sensor driver.
[out] | dev | device descriptor of sensor to initialize |
[in] | params | configuration parameters |
int tmp00x_read | ( | const tmp00x_t * | dev, |
int16_t * | rawv, | ||
int16_t * | rawt, | ||
uint16_t * | drdy | ||
) |
Read sensor's data.
[in] | dev | device descriptor of sensor |
[out] | rawv | object voltage value |
[out] | rawt | raw die temperature |
[out] | drdy | data ready, 0 if a conversion is in progress |
int tmp00x_read_temperature | ( | const tmp00x_t * | dev, |
int16_t * | ta, | ||
int16_t * | to | ||
) |
Convenience function to get ambient and object temperatures in [°C].
[in] | dev | device descriptor of sensor |
[out] | ta | converted ambient temperature |
[out] | to | converted object temperature |
int tmp00x_reset | ( | const tmp00x_t * | dev | ) |
Reset the TMP00X sensor, afterwards it should be reinitialized.
[out] | dev | device descriptor of sensor |
int tmp00x_set_active | ( | const tmp00x_t * | dev | ) |
Set active mode, this enables periodic measurements.
[in] | dev | device descriptor of sensor |
int tmp00x_set_standby | ( | const tmp00x_t * | dev | ) |
Set standby mode.
[in] | dev | device descriptor of sensor |