{"id":18459554,"url":"https://github.com/larry-wong/tiny_sensor","last_synced_at":"2025-04-08T06:31:47.910Z","repository":{"id":174327733,"uuid":"652073022","full_name":"larry-wong/tiny_sensor","owner":"larry-wong","description":"基于 ESP32-S3 的温湿度 / 光照 / 人体存在传感器和红外发射器。","archived":false,"fork":false,"pushed_at":"2024-01-16T03:32:10.000Z","size":658,"stargazers_count":25,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T07:12:27.292Z","etag":null,"topics":["environment-sensor","environment-sensors","esp32","esp32-s3","esphome","gy-302","homeassistant","ir","kicad"],"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/larry-wong.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-11T02:05:54.000Z","updated_at":"2025-01-13T03:36:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"f764e21b-4d09-4557-9303-224277c32609","html_url":"https://github.com/larry-wong/tiny_sensor","commit_stats":null,"previous_names":["larry-wong/tiny_sensor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larry-wong%2Ftiny_sensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larry-wong%2Ftiny_sensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larry-wong%2Ftiny_sensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larry-wong%2Ftiny_sensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/larry-wong","download_url":"https://codeload.github.com/larry-wong/tiny_sensor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247792029,"owners_count":20996876,"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":["environment-sensor","environment-sensors","esp32","esp32-s3","esphome","gy-302","homeassistant","ir","kicad"],"created_at":"2024-11-06T08:23:37.230Z","updated_at":"2025-04-08T06:31:47.219Z","avatar_url":"https://github.com/larry-wong.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"基于 ESP32 的家庭智能传感器，搭配 [Home Assistant](https://www.home-assistant.io/) 项目实现家自动化。\n\n小巧的身材上集成温湿度 / 光照度 / 人体存在传感器和红外发射管。\n\n\u003cimg src=\"pic/pic.jpeg\" width=\"300\"/\u003e\n\n## 硬件设计\n* 主控选用 ESP32-S3-WROOM-1\n* 温湿度传感器选用 HDC1080\n* 光照度传感器选用 GY-302 模块\n* 人体存在传感器选用 LD2410B 模块\n* 红外发射选用 3mm 发射管\n* 状态灯选用贴片发光二极管\n* 采用 typec 口供电 / 烧写程序，针脚对应关系：\n\n    | typec | esp32 | 备注 |\n    |---|---|---|\n    | GND (A1, A12, B1, B12) | GND | 接地 |\n    | VBUS (A4, A9, B4, B9) | | 5V |\n    | CC1 (A5), CC2 (B5) | GPIO0 | 烧写固件时需接地 |\n    | D+ (A6, B6) | GPIO43 | TX |\n    | D- (A7, B7) | GPIO44 | RX |\n\n## 电路设计\n原理图及 PCB 使用 kicad 绘制，项目文件见 circut 目录（依赖 [ESPRESSIF 官方库](https://github.com/espressif/kicad-libraries)）。\n\n* 所有贴片元件均采用 0805 封装尺寸\n* 焊接时可多留一些红外管引脚，以调整发射方向\n* 不需要的传感器可留空\n* 由于不同颜色发光二极管的压降不同，在 R3 为 100 欧姆时 D2 采用红色发光二极管效果较好，采用黄色发光二极管时亮度较低。若要使用其他颜色发光二极管可自行计算 R3 阻值。\n\n## 固件设计\n固件使用 [ESPHome](https://esphome.io/) 搭建，配置文件见 esphome 目录。\n\n* 暴露以下传感器至 Home Assistant:\n    * 一个温度传感器\n    * 一个湿度传感器\n    * 一个光照度传感器\n    * 一个人体存在二元传感器\n    * 一个人体存在距离传感器\n    * 一个可开关的 LED 灯（复用状态灯）\n* 项目中对红外管的使用比较客制化，使用自定义的 MQTT 消息驱动。建议改用 [Remote Transmitter](https://esphome.io/components/remote_transmitter.html) 或自行修改。\n\n## 应用参考\n接入 Home Assistant 后，可使用暴露出的传感器实现一些家庭自动化，例如：\n* 使用人体存在传感器配合光照度传感器控制灯\n* 甚至可配合人体存在距离传感器大致确定人体位置后控制不同的灯\n* 使用人体存在传感器配合温度传感器控制空调制冷 / 加热 / 关闭\n* 使用湿度传感器控制加湿器\n* 使用 LED 指示报警信息（电量低，扫地机集尘盒满等）\n* 使用红外管控制空调 / 电视 / 浴霸等传统电器\n* ……\n\n## 捐赠\n如果此项目对你有帮助，可扫描下方二维码请我喝杯咖啡 :)\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"donate/wechat.png\" width=\"200\" title=\"使用微信扫一扫\" /\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"donate/alipay.png\" width=\"200\" title=\"使用支付宝扫一扫\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarry-wong%2Ftiny_sensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flarry-wong%2Ftiny_sensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarry-wong%2Ftiny_sensor/lists"}