A simple humidity sensor using the Adafruit Feather RP2040, a 2.9" Waveshare e-Paper Module monochrome, and SHTC3 humidity sensor, written in Rust.
All the hardware components in my particular build are enumerated here.
Programming will require a USB-C cable and a computer.
The humidity sensor queries and displays the temperature and humidity every 20 minutes.
-
Install rustup.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Clone the repository.
git clone https://github.com/jwillikers/humble-humidity-sensor.git
-
Change to the project’s directory.
cd humble-humidity-sensor
-
Install the Rust toolchain for the RP2040.
rustup target add thumbv6m-none-eabi
-
Install flip-link
cargo install flip-link
-
To flash the microcontroller over USB-C, change the
.cargo/config.toml
file to useelf2uf2-rs
as the runner..cargo/config.tomlrunner = "elf2uf2-rs -d" # runner = "probe-run --chip RP2040"
-
Install elf2uf2-rs.
cargo install elf2uf2-rs
-
While holding the
BOOT
button, attach the Adafruit Feather RP2040 to your computer using the USB-C port. -
Flash the board using Cargo’s
run
subcommand.cargo run
An SWD connection is more convenient for flashing and debugging the microcontroller. It doesn’t require fiddling with the tiny buttons on the dev-board constantly. If you’ve soldered an SWD debug header to the Feather RP2040, it’s pretty accessible. The hs-probe debugger from the probe-rs project works great.
-
Attach the debugger to your computer.
-
Attach the debugger to the Feather RP2040’s SWD header.
-
To flash the microcontroller over SWD, make sure that the
.cargo/config.toml
file sets the runner toprobe-run
..cargo/config.toml# runner = "elf2uf2-rs -d" runner = "probe-run --chip RP2040"
-
Install probe-run.
cargo install probe-run
-
Flash the board using Cargo’s
run
subcommand.cargo run
-
Reduce power consumption by putting XOSC into dormant mode and waking via ROSC.
-
Use partial refresh to only update the necessary portion of the screen for new measurements.
-
Add more pizzazz to the display.
-
Profile power consumption and battery life.
-
Add GitHub CI actions.
-
Add pre-commit hooks?
-
Include pictures in README.
Contributions in the form of issues, feedback, and even pull requests are welcome. Make sure to adhere to the project’s Code of Conduct.
This project is built on the hard work of countless open source contributors. Several of these projects are enumerated below.
Refer to the project’s Code of Conduct for details.
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.
© 2022 Jordan Williams