#temperature #sensor #driver #embedded-hal-driver #thermopile

no-std tmp006

Platform-agnostic Rust driver for the TMP006/TMP006B non-contact infrared (IR) thermopile temperature sensor

1 unstable release

Uses old Rust 2015

0.1.0 Dec 7, 2018

#331 in Hardware support

Download history 7/week @ 2021-02-25 6/week @ 2021-03-04 7/week @ 2021-03-11 7/week @ 2021-03-18 11/week @ 2021-03-25 23/week @ 2021-04-01 14/week @ 2021-04-08 11/week @ 2021-04-15 7/week @ 2021-04-22 7/week @ 2021-04-29 43/week @ 2021-05-06 1203/week @ 2021-05-13 38/week @ 2021-05-20 768/week @ 2021-05-27 826/week @ 2021-06-03 291/week @ 2021-06-10

72 downloads per month


249 lines

Rust TMP006/B Non-Contact Infrared (IR) Thermopile Temperature Sensor Driver

crates.io Docs Build Status Coverage Status Maintenance Intention

This is a platform agnostic Rust driver for the TMP006/TMP006B non-contact infrared (IR) thermopile temperature sensor, based on the embedded-hal traits.

This driver allows you to:

  • Enable/disable the device. See: enable().
  • Read the object temperature. See: read_object_temperature().
  • Read the object voltage and ambient temperature raw data. See: read_sensor_data().
  • Calculate the object temperature from the sensor raw data. See: calculate_object_temperature().
  • Set the ADC conversion rate. See: set_conversion_rate().
  • Enable/disable the DRDY pin. See: enable_drdy_pin().
  • Read whether data is ready to be read. See: is_data_ready().
  • Perform a software reset. See: reset().
  • Read the manufacturer ID. See: read_manufacturer_id().
  • Read the device ID. See: read_device_id().

Introductory blog post

The device

The TMP006 and TMP006B are the first in a series of temperature sensors that measure the temperature of an object without the need to make contact with the object. This sensor uses a thermopile to absorb the infrared energy emitted from the object being measured and uses the corresponding change in thermopile voltage to determine the object temperature.

Infrared sensor voltage range is specified from -40°C to +125°C to enable use in a wide range of applications. Low power consumption along with low operating voltage makes the device suitable for battery-powered applications. The low package height of the chip-scale format enables standard high- volume assembly methods, and can be useful where limited spacing to the object being measured is available.


Usage example

Please find additional examples in this repository: tmp006-examples

extern crate linux_embedded_hal as hal;
extern crate tmp006;

use hal::I2cdev;
use tmp006::{Tmp006, SlaveAddr};

fn main() {
    let dev = I2cdev::new("/dev/i2c-1").unwrap();
    let address = SlaveAddr::default();
    let mut sensor = Tmp006::new(dev, address);
    let calibration_factor = 6e-14;
    let temperature = sensor
    println!("Temperature: {}K", temperature);


Licensed under either of


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.