UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

TMP006 Class

Module: tmp006

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

Methods

TMP006

(
  • bus
  • conv_rate
  • devAddr
)
Number

Instantiates an TMP006 object

Parameters:

  • bus Number

    Number of the used bus

  • conv_rate Number

    Conversation rate (allowed between 0 and 4)

  • devAddr Number

    Address of the used I2C device

Returns:

Number:

checkID

() Number

Check device_id of sensor

Returns:

Number:

0 on succes -1 on error

resetSensor

()

Performs a soft reset of the TMP006 device to ensure it is in a known state.

setActive

()

Set active mode, this enables periodic measurements.

setStandby

()

Set standby mode, this disables periodic measurements.

sampleData

() Number

Read out data of regs and call further function Also saves converted value to variable

Returns:

Number:

convert_data

(
  • rawv
  • rawt
  • tamb
  • tobj
)

Convert raw sensor values to temperature.

Parameters:

  • rawv Number

    Object voltage value

  • rawt Number

    Raw die temperature value

  • tamb Float *

    Converted ambient temperature

  • tobj Float *

    Converted object temperature

getTemperature

(
  • bSampleData
)
Number

Get the calculated object temperature [degC]

Parameters:

  • bSampleData Number

    Flag to read sensor

Returns:

Number:

The object temp in degC on success and -273.2 on 'conversation in progress'

getConfig

() Number

Get value of configuration reg

Returns:

Number: