4 releases

0.2.1 May 19, 2022
0.2.0 Apr 22, 2022
0.1.1 Apr 20, 2022
0.1.0 Apr 20, 2022

#797 in Embedded development

Download history 5/week @ 2024-02-26 67/week @ 2024-04-01

67 downloads per month

MIT/Apache

16KB
263 lines

MICS-VZ-89TE Driver

This driver can be used to read CO2 and VOC measurements of the MICS-VZ-89TE sensor.

Build Status License Crates.io Documentation

Example usage

Example shows how to read CO2 and VOC from sensor.

let mut delay = ...; // delay struct from board
let i2c = ...; // I2C bus to use

let mut device = MicsVz89Te::new(i2c);
let measurements = device.read_measurements(&mut delay).unwrap();

let co2 = measurements.co2;
let voc = measurements.voc;

let i2c = device.release(); // destruct driver to use bus with other drivers

lib.rs:

Driver for MICS-VZ-89TE sensor

This driver can be used to read CO2 and voc measurements of the MICS-VZ-89TE sensor. CO2 is measured in ppm in range from 400 to 2000. VOC is measured in ppb in range from 0 to 1000. At startup the sensor needs around 15 minutes to deliver a valid CO2 value, as noted in the datasheet.

To use this driver, the I2C bus has to be set to a max baudrate of 100_000.

Feature flags

  • std: Enables error handling with std::error::Error.
  • time: Enables compatibility with time::Date on struct RevisionDate.
  • unproven: Enables ppm calibration and r0 value retrieving. (Correct functionality couldn't be verified.)

Example Usage

let mut delay = ...; // delay struct from board
let i2c = ...; // I2C bus to use

let mut device = MicsVz89Te::new(i2c);
let measurements = device.read_measurements(&mut delay).unwrap();

let co2 = measurements.co2;
let voc = measurements.voc;

let i2c = device.release(); // destruct driver to use bus with other drivers

Dependencies

~240KB