| Crates.io | hs3003 |
| lib.rs | hs3003 |
| version | 0.1.1 |
| created_at | 2026-01-14 04:43:26.539587+00 |
| updated_at | 2026-01-14 05:41:24.045315+00 |
| description | Platform-agnostic Rust driver for the Renesas HS3003 temperature and humidity sensor |
| homepage | |
| repository | https://github.com/melastmohican/hs3003-rs |
| max_upload_size | |
| id | 2042197 |
| size | 33,988 |
Platform-agnostic Rust driver for the Renesas HS3003 temperature and humidity sensor.
no_std compatibleembedded-hal traitsAdd this to your Cargo.toml:
[dependencies]
hs3003 = "0.1"
# use embedded_hal_mock::eh1::i2c::{Mock as I2cMock, Transaction as I2cTransaction};
# use embedded_hal_mock::eh1::delay::NoopDelay;
use hs3003::Hs3003;
# let expectations = [
# I2cTransaction::write(0x44, vec![0x00]),
# I2cTransaction::read(0x44, vec![0x1F, 0xFF, 0x66, 0x64]),
# ];
# let i2c = I2cMock::new(&expectations);
# let mut delay = NoopDelay::new();
// Create sensor instance with I2C interface
let mut sensor = Hs3003::new(i2c);
// Read temperature and humidity
let measurement = sensor.read(&mut delay)?;
# #[cfg(feature = "std")]
println!("Temperature: {:.2}°C", measurement.temperature);
# #[cfg(feature = "std")]
println!("Humidity: {:.2}%", measurement.humidity);
# let mut i2c = sensor.destroy();
# i2c.done();
# Ok::<(), hs3003::Error<embedded_hal::i2c::ErrorKind>>(())
A complete Raspberry Pi Pico 2 (RP2350) example is available at examples/rp235x/.
cd examples/rp235x
cargo build --target thumbv8m.main-none-eabihf
examples/rp235x/.cargo/config.toml (for example probe-rs):cd examples/rp235x
cargo run --target thumbv8m.main-none-eabihf
See examples/rp235x/.cargo/config.toml and examples/rp235x/build.rs for per-example target configuration and linker scripts.
A complete ESP32-C3 example application is provided in the repository at examples/esp32c3/.
cd examples/esp32c3
cargo build --target riscv32imc-unknown-none-elf
examples/esp32c3/.cargo/config.toml (for example, probe-rs, espflash or cargo run if your runner is set up):# from repository root or from the example directory
cd examples/esp32c3
cargo run --target riscv32imc-unknown-none-elf
See examples/esp32c3/.cargo/config.toml and examples/esp32c3/rust-toolchain.toml for per-example target and runner configuration.
The HS3003 is a digital temperature and humidity sensor with:
Licensed under either of:
at your option.
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.