{"id":15164239,"url":"https://github.com/azholtikov/zh_aht","last_synced_at":"2026-02-18T09:01:49.978Z","repository":{"id":249392256,"uuid":"824064277","full_name":"aZholtikov/zh_aht","owner":"aZholtikov","description":"ESP32 ESP-IDF and ESP8266 RTOS SDK component for AHT10/AHT15/AHT20/AHT21/AHT25/AHT30 humidity \u0026 temperature sensor.","archived":false,"fork":false,"pushed_at":"2024-07-21T06:17:27.000Z","size":8016,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-31T02:22:02.028Z","etag":null,"topics":["aht10","aht15","aht20","aht21","aht25","aht30","component","esp-idf","esp32","esp8266","i2c","rtos-sdk"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aZholtikov.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}},"created_at":"2024-07-04T09:40:01.000Z","updated_at":"2024-12-01T12:14:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"3532fbdf-6ed8-4cff-a409-52d49e573284","html_url":"https://github.com/aZholtikov/zh_aht","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"eb84f82b89b0cbc408d34d0826ac10ecfc2702f5"},"previous_names":["azholtikov/zh_aht"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/aZholtikov/zh_aht","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aZholtikov%2Fzh_aht","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aZholtikov%2Fzh_aht/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aZholtikov%2Fzh_aht/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aZholtikov%2Fzh_aht/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aZholtikov","download_url":"https://codeload.github.com/aZholtikov/zh_aht/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aZholtikov%2Fzh_aht/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29574065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aht10","aht15","aht20","aht21","aht25","aht30","component","esp-idf","esp32","esp8266","i2c","rtos-sdk"],"created_at":"2024-09-27T03:02:29.953Z","updated_at":"2026-02-18T09:01:49.936Z","avatar_url":"https://github.com/aZholtikov.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32 ESP-IDF and ESP8266 RTOS SDK component for AHT10/AHT15/AHT20/AHT21/AHT25/AHT30 humidity \u0026 temperature sensor\n\n## Tested on\n\n1. ESP8266 RTOS_SDK v3.4\n2. ESP32 ESP-IDF v5.2\n\n## Features\n\n1. Autodetect sensor type.\n\n## Using\n\nIn an existing project, run the following command to install the component:\n\n```text\ncd ../your_project/components\ngit clone https://github.com/aZholtikov/zh_aht.git\n```\n\nIn the application, add the component:\n\n```c\n#include \"zh_aht.h\"\n```\n\n## Example\n\nReading the sensor:\n\n```c\n#include \"zh_aht.h\"\n\n#define I2C_PORT (I2C_NUM_MAX - 1)\n\nvoid app_main(void)\n{\n    esp_log_level_set(\"zh_aht\", ESP_LOG_NONE);\n#ifdef CONFIG_IDF_TARGET_ESP8266\n    i2c_config_t i2c_config = {\n        .mode = I2C_MODE_MASTER,\n        .sda_io_num = GPIO_NUM_4, // In accordance with used chip.\n        .sda_pullup_en = GPIO_PULLUP_ENABLE,\n        .scl_io_num = GPIO_NUM_5, // In accordance with used chip.\n        .scl_pullup_en = GPIO_PULLUP_ENABLE,\n    };\n    i2c_driver_install(I2C_PORT, i2c_config.mode);\n    i2c_param_config(I2C_PORT, \u0026i2c_config);\n#else\n    i2c_master_bus_config_t i2c_bus_config = {\n        .clk_source = I2C_CLK_SRC_DEFAULT,\n        .i2c_port = I2C_PORT,\n        .scl_io_num = GPIO_NUM_22, // In accordance with used chip.\n        .sda_io_num = GPIO_NUM_21, // In accordance with used chip.\n        .glitch_ignore_cnt = 7,\n        .flags.enable_internal_pullup = true,\n    };\n    i2c_master_bus_handle_t i2c_bus_handle;\n    i2c_new_master_bus(\u0026i2c_bus_config, \u0026i2c_bus_handle);\n#endif\n    zh_aht_init_config_t aht_init_config = ZH_AHT_INIT_CONFIG_DEFAULT();\n#ifdef CONFIG_IDF_TARGET_ESP8266\n    aht_init_config.i2c_port = I2C_PORT;\n#else\n    aht_init_config.i2c_handle = i2c_bus_handle;\n#endif\n    zh_aht_init(\u0026aht_init_config);\n    float humidity = 0.0;\n    float temperature = 0.0;\n    for (;;)\n    {\n        zh_aht_read(\u0026humidity, \u0026temperature);\n        printf(\"Humidity %0.2f\\n\", humidity);\n        printf(\"Temperature %0.2f\\n\", temperature);\n        vTaskDelay(5000 / portTICK_PERIOD_MS);\n    }\n}\n```\n\nAny [feedback](mailto:github@azholtikov.ru) will be gladly accepted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazholtikov%2Fzh_aht","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazholtikov%2Fzh_aht","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazholtikov%2Fzh_aht/lists"}