/Humble-Humidity-Sensor

A simple, portable humidity sensor

Primary LanguageRustOtherNOASSERTION

Humble Humidity Sensor

A simple humidity sensor using the Adafruit Feather RP2040, a 2.9" Waveshare e-Paper Module monochrome, and SHTC3 humidity sensor, written in Rust.

Hardware

All the hardware components in my particular build are enumerated here.

Programming will require a USB-C cable and a computer.

How it Works

The humidity sensor queries and displays the temperature and humidity every 20 minutes.

Getting Started

  1. Install rustup.

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Clone the repository.

    git clone https://github.com/jwillikers/humble-humidity-sensor.git
  3. Change to the project’s directory.

    cd humble-humidity-sensor
  4. Install the Rust toolchain for the RP2040.

    rustup target add thumbv6m-none-eabi
  5. Install flip-link

    cargo install flip-link
  6. To flash the microcontroller over USB-C, change the .cargo/config.toml file to use elf2uf2-rs as the runner.

    .cargo/config.toml
    runner = "elf2uf2-rs -d"
    
    # runner = "probe-run --chip RP2040"
  7. Install elf2uf2-rs.

    cargo install elf2uf2-rs
  8. While holding the BOOT button, attach the Adafruit Feather RP2040 to your computer using the USB-C port.

  9. Flash the board using Cargo’s run subcommand.

    cargo run

SWD

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.

  1. Attach the debugger to your computer.

  2. Attach the debugger to the Feather RP2040’s SWD header.

  3. To flash the microcontroller over SWD, make sure that the .cargo/config.toml file sets the runner to probe-run.

    .cargo/config.toml
    # runner = "elf2uf2-rs -d"
    
    runner = "probe-run --chip RP2040"
  4. Install probe-run.

    cargo install probe-run
  5. Flash the board using Cargo’s run subcommand.

    cargo run

Todo

  • 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.

References

Contributing

Contributions in the form of issues, feedback, and even pull requests are welcome. Make sure to adhere to the project’s Code of Conduct.

Open Source Software

This project is built on the hard work of countless open source contributors. Several of these projects are enumerated below.

Code of Conduct

Refer to the project’s Code of Conduct for details.

License

Licensed under either of

at your option.

© 2022 Jordan Williams

Authors