#infrared #thermometer #temperature #sensor #embedded-hal-driver

no-std mlx9061x

Platform-agnostic Rust driver for the MLX90614 and MLX90615 non-contact infrared thermometers

2 unstable releases

0.2.0 May 22, 2021
0.1.0 Jul 29, 2020

#458 in Embedded development

Download history 9/week @ 2021-02-23 9/week @ 2021-03-02 9/week @ 2021-03-09 9/week @ 2021-03-16 12/week @ 2021-03-23 27/week @ 2021-03-30 10/week @ 2021-04-06 19/week @ 2021-04-13 11/week @ 2021-04-20 10/week @ 2021-04-27 46/week @ 2021-05-04 718/week @ 2021-05-11 543/week @ 2021-05-18 656/week @ 2021-05-25 880/week @ 2021-06-01 329/week @ 2021-06-08

467 downloads per month

MIT/Apache

26KB
338 lines

Rust MLX90614/MLX90615 Non-contact Infrared Thermometer Driver

crates.io Docs Build Status Coverage Status

This is a platform agnostic Rust driver for the MLX90614/MLX90615 infrared thermometers using the embedded-hal traits.

This driver allows you to:

  • Read the last object temperature measurement. See: object1_temperature().
  • Read the last ambient temperature measurement. See: ambient_temperature().
  • Read the last raw IR measurement. See: raw_ir_channel1().
  • Get/Set the emissivity. See: set_emissivity().
  • Get the device ID. See: device_id().
  • Set the device address. See: set_address().
  • Put the device to sleep. See: sleep().
  • Wake the device from sleep. See: wake_mlx90614().

The MLX90614/MLX90615 are a infrared thermometers for non-contact temperature measurements. Both the IR sensitive thermopile detector chip and the signal conditioning ASSP are integrated in the same TO-39/TO-46 can. Thanks to its low noise amplifier, 17-bit/16-bit ADC and powerful DSP unit, a high accuracy and resolution of the thermometer is achieved.

Depending on the MLX90614 model they feature a single-zone or dual-zone thermopile.

The chips feature an 10-bit PWM and SMBus interface.

The readout resolution is 0.01°C (MLX90614) / 0.02°C (MLX90615).

This driver uses the SMBus interface.

Documentation:

Usage

To use this driver, import this crate and an embedded_hal implementation, then instantiate the appropriate device.

Please find additional examples using hardware in this repository: driver-examples

use linux_embedded_hal::I2cdev;
use mlx9061x::{Mlx9061x, SlaveAddr};

fn main() {
    let dev = I2cdev::new("/dev/i2c-1").unwrap();
    let addr = SlaveAddr::default();
    let mut sensor = Mlx9061x::new_mlx90614(dev, addr, 5).unwrap();
    loop {
        let obj_temp = sensor.object1_temperature().unwrap();
        println!("Object temperature: {:.2}ºC", obj_temp);
    }
}

Support

For questions, issues, feature requests, and other changes, please file an issue in the github project.

License

Licensed under either of

at your option.

Contributing

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.

Dependencies

~115KB