{"id":19892307,"url":"https://github.com/peff74/esp_aht20_bmp280","last_synced_at":"2025-06-12T22:37:09.450Z","repository":{"id":216680244,"uuid":"741902447","full_name":"peff74/ESP_AHT20_BMP280","owner":"peff74","description":"ESP32/ESP8266 arduino script for an AHT20 + BMP280 only with Wire.h","archived":false,"fork":false,"pushed_at":"2025-06-10T23:08:54.000Z","size":40103,"stargazers_count":24,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T00:20:42.098Z","etag":null,"topics":["aht20","arduino","beginner-friendly","bmp280","esp32","esp8266","humidity","i2c","iot","non-blocking","pressure","sensor","temperature","weather"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peff74.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"zenodo":null}},"created_at":"2024-01-11T10:52:41.000Z","updated_at":"2025-05-19T01:01:17.000Z","dependencies_parsed_at":"2024-07-20T01:31:43.163Z","dependency_job_id":"2f149794-80fa-4abe-8e03-54a06895e6e6","html_url":"https://github.com/peff74/ESP_AHT20_BMP280","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"8cdd03c0e947f6918e61fb8b466be2e678ff26b9"},"previous_names":["peff74/esp_aht20_bmp280"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peff74/ESP_AHT20_BMP280","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peff74%2FESP_AHT20_BMP280","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peff74%2FESP_AHT20_BMP280/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peff74%2FESP_AHT20_BMP280/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peff74%2FESP_AHT20_BMP280/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peff74","download_url":"https://codeload.github.com/peff74/ESP_AHT20_BMP280/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peff74%2FESP_AHT20_BMP280/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259542246,"owners_count":22873786,"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":["aht20","arduino","beginner-friendly","bmp280","esp32","esp8266","humidity","i2c","iot","non-blocking","pressure","sensor","temperature","weather"],"created_at":"2024-11-12T18:22:59.726Z","updated_at":"2025-06-12T22:37:09.418Z","avatar_url":"https://github.com/peff74.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# AHT20 / BMP280 sensor script for Arduino\n\n - This is an AHT20 / BMP280 temperature/pressure/humidity sensor script\n   for Arduino.\n -  AHT20 + BMP280 chips are sold for less than a dollar\n   on Ali.\n  - This script only uses the Wire.h library, nothing else.\n  - Works with ESP8266, ESP32 and similar\n\n\n\n![AHT20_BMP280 logo](https://github.com/peff74/ESP_AHT20_BMP280/blob/main/AHT20_BMP280.jpg)\n\n\n## Arduino script features\n\n -   Read temperature / humidity from AHT20\n -    Read temperature / pressure from BMP280\n - No long loop times when reading the AHT20\n - Non blocking\n - Simple and clearly written\n - So that even beginners (like me) can understand how it works \n \n## How does it work \n**AHT20**\n\nThe ATH20 can be reached via the address 0x38\nSo every query must begin with:\n\n    Wire.beginTransmission(0x38);\n\nTo initiate the AHT20, 0xBE must be sent.\n*void AHT20_begin()*\n\n \n    Wire.write(0xBE);\n\nTo start the measurement 0xAC,  0x33, 0x00 must be sent.\n*void startMeasurementAHT20()*\n\n    Wire.write(0xAC);  \n    Wire.write(0x33);  \n    Wire.write(0x00);\n    \nNow you have to wait until the data is available.\nARAIR specifies a waiting time of 80ms. At the same time, the “Busy indication” bit must be monitored; if this is “0”, the measurement is finished.\n*void checkbusyAHT20()*\n\n    if (sensor_started \u0026\u0026 sensor_busy \u0026\u0026 ((millis() - measurementDelayAHT20 \u003e= 80))) {\n        Wire.requestFrom(0x38, 1);\n        .\n        .\n        .\n        \nThe 8 bytes of data can now be called up.\n*void getDataAHT20()*\n\n    Wire.requestFrom(0x38, 7);\n\n\n\n  The bytes read in can now be processed as shown below\n\n    +------------------+\n    | Byte 0: 00011000 |\n    | Byte 1: 10010011 |\n    | Byte 2: 10101100 |\n    | Byte 3: 10010101 |\n    | Byte 4: 00101010 |\n    | Byte 5: 11000101 |\n    | Byte 6: 10110011 |\n    +------------------+\n    \n        \n    +----------------------------+----------------------------+\n    | Humidity (raw)             | Temperature (raw)          |\n    +----------------------------+----------------------------+\n    | 10010011   10101100   1001 | 0101   00101010   11000101 |\n    |   (B1)       (B2)     (B3) | (B3)     (B4)       (B5)   |\n    +----------------------------+----------------------------+\n    \n    +----------------------------------+\n    |          Berechnung Humi         |\n    |  10010011101011001001 = 604873   |\n    |  604873 / 1048576 * 100 = 57.69  |\n    +----------------------------------+\n    \n    +-------------------------------------------+\n    |          Berechnung Temp                  |\n    |       01010010101011000101 = 338629       |\n    |  338629 / 1048576 * 200.0 - 50.0 = 14.59  |\n    +-------------------------------------------+\n    \n    \n    Humidity: 57.69%. Temperature: 14.59\n\n\n[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fpeff74%2FESP_AHT20_BMP280\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=hits\u0026edge_flat=false)](https://hits.seeyoufarm.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeff74%2Fesp_aht20_bmp280","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeff74%2Fesp_aht20_bmp280","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeff74%2Fesp_aht20_bmp280/lists"}