hs3003
Platform-agnostic Rust driver for the Renesas HS3003 temperature and humidity sensor.
Features
no_stdcompatible- Platform-agnostic using
embedded-haltraits - Simple, ergonomic API
- Supports temperature range: -40°C to +125°C
- Supports humidity range: 0% to 100% RH
- I2C interface
Usage
Add this to your Cargo.toml:
[]
= "0.1"
Example
# use ;
# use NoopDelay;
use Hs3003;
# let expectations = ;
# let i2c = new;
# let mut delay = new;
// Create sensor instance with I2C interface
let mut sensor = new;
// Read temperature and humidity
let measurement = sensor.read?;
#
println!;
#
println!;
# let mut i2c = sensor.destroy;
# i2c.done;
# Ok::
Platform-Specific Examples
Raspberry Pi Pico (RP2350/RP2040)
A complete Raspberry Pi Pico 2 (RP2350) example is available at examples/rp235x/.
- Build the example for the RP2350 (Cortex-M33) target:
- Run or flash the example using the runner configured in
examples/rp235x/.cargo/config.toml(for exampleprobe-rs):
See examples/rp235x/.cargo/config.toml and examples/rp235x/build.rs for per-example target configuration and linker scripts.
ESP32-C3
A complete ESP32-C3 example application is provided in the repository at examples/esp32c3/.
- Build the example for the ESP32-C3 (RISC‑V) target:
- Run or flash the example to hardware using the runner configured in
examples/esp32c3/.cargo/config.toml(for example,probe-rs,espflashorcargo runif your runner is set up):
# from repository root or from the example directory
See examples/esp32c3/.cargo/config.toml and examples/esp32c3/rust-toolchain.toml for per-example target and runner configuration.
Sensor Information
The HS3003 is a digital temperature and humidity sensor with:
- High accuracy: ±2% RH, ±0.2°C
- Low power consumption
- I2C interface (fixed address 0x44)
- 14-bit resolution for both temperature and humidity
- Fast response time
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
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.