upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

API for the TMP006 IR-Thermopile Sensor. More...

Detailed Description

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]).

std::cout << "Initializing test-application..." << std::endl;
// please make sure that you have the right i2c address for your device
// the correct range of addresses is 0x40 - 0x47
// Instantiate an TMP006 instance on bus 1
upm::TMP006 mySensor(1, TMP006_CONFIG_CR_DEF, TMP006_I2C_ADDRESS);
// you can also get basic tmp007 functionality by initializing it as follows
// upm::TMP006 mySensor(1, TMP006_CONFIG_CR_DEF, TMP007_I2C_ADDRESS);
// activate periodic measurements
mySensor.setActive();
// update and print available values every second
while (run) {
// Print out temperature value in *C
std::cout << "Temperature: " << mySensor.getTemperature(true) << " *C" << std::endl;
upm_delay(1);
}
std::cout << "Exiting test-application..." << std::endl;

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)
 

Constructor & Destructor Documentation

TMP006 ( int  bus,
uint8_t  conv_rate = TMP006_CONFIG_CR_DEF,
int  devAddr = TMP006_I2C_ADDRESS 
)

Instantiates an TMP006 object

Parameters
busNumber of the used bus
conv_rateConversation rate (allowed between 0 and 4)
devAddrAddress of the used I2C device

Here is the call graph for this function:

Member Function Documentation

int checkID ( void  )

Check device_id of sensor

Returns
0 on succes -1 on error

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

void convert_data ( int16_t  rawv,
int16_t  rawt,
float *  tamb,
float *  tobj 
)

Convert raw sensor values to temperature.

Parameters
rawvObject voltage value
rawtRaw die temperature value
tambConverted ambient temperature
tobjConverted object temperature

Here is the caller graph for this function:

float getTemperature ( int  bSampleData = 0)

Get the calculated object temperature [degC]

Parameters
bSampleDataFlag to read sensor
Returns
The object temp in degC on success and -273.2 on 'conversation in progress'

Here is the call graph for this function:

uint16_t getConfig ( void  )

Get value of configuration reg


The documentation for this class was generated from the following files: