{"id":18929166,"url":"https://github.com/jwillikers/humidity-sensor-circuitpython","last_synced_at":"2025-04-15T15:30:52.030Z","repository":{"id":104838679,"uuid":"371095276","full_name":"jwillikers/humidity-sensor-circuitpython","owner":"jwillikers","description":"A portable humidity sensor using an RP2040 Feather and eInk display","archived":false,"fork":false,"pushed_at":"2025-03-17T14:15:09.000Z","size":96205,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T21:52:13.151Z","etag":null,"topics":["adafruit","adafruit-feather","circuitpython","eink","embedded","htu31d","humidity","humidity-sensor","python","rp2040"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwillikers.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.adoc","code_of_conduct":"CODE_OF_CONDUCT.adoc","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-26T16:09:06.000Z","updated_at":"2025-03-17T14:15:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8f3504b-e700-44cd-8466-a98335854a1a","html_url":"https://github.com/jwillikers/humidity-sensor-circuitpython","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillikers%2Fhumidity-sensor-circuitpython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillikers%2Fhumidity-sensor-circuitpython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillikers%2Fhumidity-sensor-circuitpython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillikers%2Fhumidity-sensor-circuitpython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwillikers","download_url":"https://codeload.github.com/jwillikers/humidity-sensor-circuitpython/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249097786,"owners_count":21212352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adafruit","adafruit-feather","circuitpython","eink","embedded","htu31d","humidity","humidity-sensor","python","rp2040"],"created_at":"2024-11-08T11:30:37.506Z","updated_at":"2025-04-15T15:30:48.874Z","avatar_url":"https://github.com/jwillikers.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Humidity Sensor CircuitPython\nJordan Williams \u003cjordan@jwillikers.com\u003e\n:experimental:\n:icons: font\nifdef::env-github[]\n:tip-caption: :bulb:\n:note-caption: :information_source:\n:important-caption: :heavy_exclamation_mark:\n:caution-caption: :fire:\n:warning-caption: :warning:\nendif::[]\n:Adafruit-CircuitPython-framebuf: https://github.com/adafruit/Adafruit_CircuitPython_framebuf[Adafruit CircuitPython framebuf]\n:Adafruit-Feather-RP2040: https://learn.adafruit.com/adafruit-feather-rp2040-pico[Adafruit Feather RP2040]\n:Asciidoctor_: https://asciidoctor.org/[Asciidoctor]\n:CircuitPython: https://circuitpython.org/[CircuitPython]\n:just: https://github.com/casey/just[just]\n:pip-tools: https://github.com/jazzband/pip-tools[pip-tools]\n:pipkin: https://github.com/aivarannamaa/pipkin[pipkin]\n:pre-commit: https://pre-commit.com/[pre-commit]\n:Python: https://www.python.org/[Python]\n\nimage:https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white[pre-commit, link=https://github.com/pre-commit/pre-commit]\nimage:https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json[Ruff, link=https://github.com/astral-sh/ruff]\n\nA simple humidity sensor using the {Adafruit-Feather-RP2040}, monochrome eInk Display FeatherWing, and HTU31D humidity sensor, written in {CircuitPython}.\n\nifdef::env-github[]\n++++\n\u003cp align=\"center\"\u003e\n  \u003cimg  alt=\"Humidity Sensor\" src=\"pics/Humidity Sensor Top.jpg?raw=true\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg  alt=\"Humidity Sensor Demo\" src=\"pics/Humidity Sensor Demo.gif?raw=true\"/\u003e\n\u003c/p\u003e\n++++\nendif::[]\n\nifndef::env-github[]\nimage::pics/Humidity Sensor Top.jpg[Humidity Sensor, align=center]\nimage::pics/Humidity Sensor Demo.gif[Humidity Sensor Demo, align=center]\nendif::[]\n\n== Hardware\n\nThe hardware components comprising the humidity sensory are listed below.\n\n.Humidity Sensor Components\n* https://www.adafruit.com/product/4195[Adafruit 2.13\" Monochrome eInk / ePaper Display FeatherWing - 250x122 Monochrome with SSD1680]\n* https://www.adafruit.com/product/4884[Adafruit RP2040 Feather]\n* https://www.adafruit.com/product/1570[Lithium Ion Polymer Battery - 3.7v 100mAh]\n* https://www.adafruit.com/product/4832[HTU31D Humidity Sensor]\n* https://www.adafruit.com/product/2830[Stacking Headers for Feather - 12-pin and 16-pin female headers]\n* https://www.adafruit.com/product/4399[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long]\n\nProgramming will require a USB-C cable and a computer.\n\n== How it Works\n\nThe humidity sensor samples the relative humidity and temperature once every second.\nAfter five minutes, it finds the median of these values and updates the readings shown on the display.\nA median is simple and accounts for outliers, making the displayed readings more consistent than one-off samples.\nWhen the humidity sensor starts up, it immediately displays the value of a single reading from sensor.\nThis avoids undue delays for users.\n\n== Shortcomings\n\nEfficiency::\nThe battery life is abysmal.\nThe 105 mAh battery fails to sustain this power-hungry machine for more than several hours.\nI'm hoping to get closer to a week's worth of life out of a single battery life.\nImprovements to energy efficiency include the following.\n+\n.Power Optimizations\n- [ ] Lower the clock speed.\n- [ ] Store sensor readings with Direct Memory Access, aka _DMA_, to avoid waking the microcontroller as frequently.\nUnfortunately, I don't believe this functionality is available in CircuitPython at this time.\n- [ ] Put the RP2040 into deep sleep, waking only to refresh the screen.\nIf values must be stored in non-volatile memory, consider using an FRAM breakout instead of the onboard EEPROM.\n- [ ] Increase the interval between updates of the screen.\n- [ ] Cut the line to the LED on the humidity sensor breakout.\n\nDeployment::\nThe required libraries are deployed with {pipkin}.\nThe required font bitmap used by this project is from the {Adafruit-CircuitPython-framebuf} example.\nSimply install the `code.py` file and `font/font5x8.bin` to the board's root directory.\n\n== Getting Started\n\nThe instructions here setup the software for the Feather RP2040.\nIt is assumed that you are on and familiar with Linux and using CircuitPython on microcontrollers.\n\n[TIP]\n====\nTo access the serial connection to the Feather RP2040 without requiring superuser privileges, add your user to the `dialout` group.\n\n[,sh]\n----\nsudo usermod --append --groups dialout $USER\n----\n\nNow restart for the change to take effect.\n====\n\n. Install {just} by following the instructions in the https://github.com/casey/just?tab=readme-ov-file#installation[installation section].\n\n. Clone this project's repository.\n+\n[,sh]\n----\ngit clone https://github.com/jwillikers/humidity-sensor-circuitpython.git\n----\n\n. Change to the project's root directory.\n+\n[,sh]\n----\ncd humidity-sensor-circuitpython\n----\n\n. Install {just} by following the instructions in the https://github.com/casey/just?tab=readme-ov-file#installation[installation section].\n\n. Hold down the button marked _bootsel_ on the Feather RP2040 while plugging it in to your computer with a USB-C cable.\n\n. To download and install CircuitPython, run `just install-circuitpython`.\n+\n[,sh]\n----\njust install-circuitpython\n----\n\n. Now copy over the U2F bootloader to the RP2040.\n+\n[,sh]\n----\ncp ~/Downloads/adafruit-circuitpython-adafruit_feather_rp2040-en_US-7.2.5.uf2 /run/media/$USER/RPI-RP2\n----\n\n. Wait for the file to finish copying, after which the Feather RP2040's onboard storage should automatically be mounted.\nThis is mounted at `/run/media/jordan/CIRCUITPY` on my machine.\n\n. Run `just init` to initialize the venv.\n+\n[,sh]\n----\njust init\n----\n\n. Mount the Feather RP2040 if needed.\n+\n[,sh]\n----\nudisksctl mount --block-device /dev/sda1\n----\n\n. Run `just install` to install everything to the Feather.\n+\n[,sh]\n----\njust install\n----\n\n== Development\n\nIt's recommended to use the provided {pre-commit} checks when developing.\n\n. Run `just init-dev` to initialize the virtual environment for development.\nThis will install all of the necessary dependencies and the {pre-commit} hooks.\n+\n[,sh]\n----\njust init-dev\n----\n\n. To update dependencies, run `just update`.\n+\n[,sh]\n----\njust update\n----\n\n. Use `just --list` to list other available tasks.\n+\n[,sh]\n----\njust --list\n----\n\n== Documentation\n\n.CircuitPython Documentation\n* https://circuitpython.readthedocs.io/en/latest/shared-bindings/alarm/index.html[alarm]\n* https://circuitpython.readthedocs.io/projects/epd/en/latest/[epd]\n* https://circuitpython.readthedocs.io/projects/framebuf/en/latest/[framebuf]\n* https://circuitpython.readthedocs.io/projects/htu31d/en/latest/[htu31d]\n* https://circuitpython.readthedocs.io/en/latest/shared-bindings/neopixel_write/index.html[neopixel_write]\n\n== Contributing\n\nContributions in the form of issues, feedback, and even pull requests are welcome.\nMake sure to adhere to the project's link:CODE_OF_CONDUCT.adoc[Code of Conduct].\n\n== Open Source Software\n\nThis project is built on the hard work of countless open source contributors.\nSeveral of these projects are enumerated below.\n\n* {Asciidoctor_}\n* {CircuitPython}\n* {pip-tools}\n* {pipkin}\n* {pre-commit}\n* {Python}\n\n== Code of Conduct\n\nRefer to the project's link:CODE_OF_CONDUCT.adoc[Code of Conduct] for details.\n\n== License\n\nThe font bitmap, link:font/font5x8.bin[font/font5x8.bin], is © 2021 ladyada for Adafruit Industries and licensed under the MIT license.\n\nThis repository is licensed under the https://www.gnu.org/licenses/gpl-3.0.html[GPLv3], a copy of which is provided link:LICENSE.adoc[here].\n\n© 2021-2024 Jordan Williams\n\n== Authors\n\nmailto:{email}[{author}]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwillikers%2Fhumidity-sensor-circuitpython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwillikers%2Fhumidity-sensor-circuitpython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwillikers%2Fhumidity-sensor-circuitpython/lists"}