{"id":18712753,"url":"https://github.com/apexskier/am2302","last_synced_at":"2025-07-27T15:11:47.851Z","repository":{"id":13859688,"uuid":"16557446","full_name":"apexskier/AM2302","owner":"apexskier","description":"Python module for the AM2302 temperature/humidity sensor on a Raspberry Pi.","archived":false,"fork":false,"pushed_at":"2017-01-06T17:03:14.000Z","size":220,"stargazers_count":11,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-18T20:04:24.102Z","etag":null,"topics":["am2302","humidity-sensor","iot","raspberry-pi","sensor","temperature-sensor"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apexskier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-05T20:35:36.000Z","updated_at":"2023-11-07T17:51:58.000Z","dependencies_parsed_at":"2022-08-24T20:01:42.746Z","dependency_job_id":null,"html_url":"https://github.com/apexskier/AM2302","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/apexskier/AM2302","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apexskier%2FAM2302","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apexskier%2FAM2302/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apexskier%2FAM2302/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apexskier%2FAM2302/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apexskier","download_url":"https://codeload.github.com/apexskier/AM2302/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apexskier%2FAM2302/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267376353,"owners_count":24077299,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["am2302","humidity-sensor","iot","raspberry-pi","sensor","temperature-sensor"],"created_at":"2024-11-07T12:43:39.932Z","updated_at":"2025-07-27T15:11:47.810Z","avatar_url":"https://github.com/apexskier.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python DHT-Raspberry Pi module\n\nThis module enables access to the [AM2302 wired digital temperature and\nhumidity sensor](https://www.adafruit.com/products/393) from a Raspberry Pi.\nIt's been adapted from [Adafruit's C\ncode](http://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/software-install).\n\nIt may work with both the DHT11 and DHT22 sensors as well, though this is\nuntested.\n\nGet it with `pip install am2302_rpi`. The [BCM2835 C\nLibrary](http://www.open.com.au/mikem/bcm2835/index.html) is required and the\nroot user must be used to access the GPIO pins.\n\n## am2302_ths\n\nBoth methods return floats, or None if the sensor can't be read. The sensor\ncan only be read once every few seconds.\n\n### get_temperature(pin)\n\nReads the current temperature from a sensor attached to the specified pin.\n\n### get_humidity(pin)\n\nReads the current humidity from a sensor attached to the specified pin.\n\n## am2302_rpi\n\nThis module provides a class *Sensor* which periodically polls the sensor\nto keep track of the current temperature without waiting for it.\n\nIt has the following methods available.\n\n### __init__(pin)\n\nCreate a new sensor object instance with `s = am2302_rpi.Sensor(4)`.\n\n### get()\n\nGet the last read temperature.\n\n### get_last_time()\n\nGet the time of the last successful read.\n\n### off()\n\nTurn the timer off by cancelling it's internal ticker. Make sure you call this\nbefore exiting.\n\n\n## TODO\n\nClean up the sensor object properly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapexskier%2Fam2302","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapexskier%2Fam2302","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapexskier%2Fam2302/lists"}