Expand description
Microchip Technology Inc.’s MCP9808 digital temperature sensor converts temperatures between -20°C and +100°C to a digital word with ±0.25°C/±0.5°C (typical/maximum) accuracy.
The MCP9808 comes with user-programmable registers that provide flexibility for temperature sensing applications. The registers allow user-selectable settings such as Shutdown or Low-Power modes and the specification of temperature Alert window limits and critical output limits.
When the temperature changes beyond the specified boundary limits, the MCP9808 outputs an Alert signal. The user has the option of setting the Alert output signal polarity as an active-low or active-high comparator output for thermostat operation, or as a temperature Alert interrupt output for microprocessor-based systems. The Alert output can also be configured as a critical temperature output only.
This sensor has an industry standard 400 kHz, 2-wire, SMBus/I2C compatible serial interface, allowing up to eight or sixteen sensors to be controlled with a single serial bus. These features make the MCP9808 ideal for sophisticated, multi-zone, temperature-monitoring applications.
§Usage (sync)
use embedded_devices::devices::microchip::mcp9808::{MCP9808Sync, address::Address, registers::AmbientTemperature};
use embedded_devices::sensor::OneshotSensorSync;
use uom::si::thermodynamic_temperature::degree_celsius;
// Create and initialize the device
let mut mcp9808 = MCP9808Sync::new_i2c(delay, i2c, Address::Default);
mcp9808.init().unwrap();
// Read the current temperature in °C
let temp = mcp9808.measure()?
.temperature.get::<degree_celsius>();
println!("Current temperature: {:?}°C", temp);§Usage (async)
use embedded_devices::devices::microchip::mcp9808::{MCP9808Async, address::Address, registers::AmbientTemperature};
use embedded_devices::sensor::OneshotSensorAsync;
use uom::si::thermodynamic_temperature::degree_celsius;
// Create and initialize the device
let mut mcp9808 = MCP9808Async::new_i2c(delay, i2c, Address::Default);
mcp9808.init().await.unwrap();
// Read the current temperature in °C
let temp = mcp9808.measure().await?
.temperature.get::<degree_celsius>();
println!("Current temperature: {:?}°C", temp);Modules§
Structs§
- MCP9808
Async - Microchip Technology Inc.’s MCP9808 digital temperature sensor converts temperatures between -20°C and +100°C to a digital word with ±0.25°C/±0.5°C (typical/maximum) accuracy.
- MCP9808
Sync - Microchip Technology Inc.’s MCP9808 digital temperature sensor converts temperatures between -20°C and +100°C to a digital word with ±0.25°C/±0.5°C (typical/maximum) accuracy.
- Measurement
- Measurement data