Document verified SR505/mini PIR wiring on GPIO22 at 3.3V.
README/meta/pins note small module + 3.3V works; refresh firmware package. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
15
README.md
15
README.md
@@ -7,14 +7,17 @@ GPIO22 读人体红外(PIR)模块 OUT:每次检测到运动开始,屏幕
|
||||
| 项目 | 说明 |
|
||||
|------|------|
|
||||
| 板子 | CYD ESP32-2432S028R |
|
||||
| 模块 | 三脚人体红外感应(VCC / GND / OUT),如 HC-SR501 / HC-SR505 / AM312 等 |
|
||||
| 模块 | 三脚小型人体红外(卖家常写 mini SR501,实际多为 **HC-SR505**) |
|
||||
| 供电 | **3.3V**(本工程已实测可用) |
|
||||
| 输出 | **GPIO22** |
|
||||
|
||||
> 大圆头带电位器的是 HC-SR501,接线相同;大模块更稳妥用 5V。本仓库默认按小模块 + 3.3V 写。
|
||||
|
||||
### 接线
|
||||
|
||||
| 模块 | CYD |
|
||||
|------|-----|
|
||||
| VCC | 优先 **5V**(HC-SR501 等大模块);仅明确标 3.3V 的小模块用 **3.3V** |
|
||||
| VCC | **3.3V** |
|
||||
| GND | **GND** |
|
||||
| OUT / S / DO | **GPIO22** |
|
||||
|
||||
@@ -24,13 +27,13 @@ GPIO22 读人体红外(PIR)模块 OUT:每次检测到运动开始,屏幕
|
||||
|
||||
- `MOTION` / `IDLE`:当前是否感应到人
|
||||
- `hold` + 进度条:本次连续有人时长(约 0~5s 满格)
|
||||
- `OUT HIGH/LOW` 与 `act=`:原始电平与有效电平 —— **挥手时 OUT 应变,不变就是供电/接线问题**
|
||||
- `OUT HIGH/LOW` 与 `act=`:原始电平与有效电平 —— 挥手时 OUT 应变 HIGH
|
||||
|
||||
注意:
|
||||
|
||||
- 多数 PIR 上电后需 **约 30~60 秒** 预热才稳定
|
||||
- 确认 OUT 接到 **GPIO22**(不是 21 背光),共地
|
||||
- 模块有灵敏度/延时电位器时,灵敏度先拧到最大
|
||||
- 上电后约 **30~60 秒** 预热,此前可能无反应或乱跳
|
||||
- OUT 接 **GPIO22**(勿接 21 背光),必须共地
|
||||
- 小模块一般无灵敏度旋钮;检测距离大约 3m 量级
|
||||
|
||||
## 操作
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
目录:[`cyd/`](cyd/)
|
||||
|
||||
板子:**CYD ESP32-2432S028R**(ILI9341)
|
||||
功能:人体红外 PIR(GPIO22)计数 + SoftSPI 触控 + LVGL(同 tftest / btntest)
|
||||
功能:小型人体红外 SR505/mini SR501(GPIO22、3.3V)计数 + SoftSPI 触控 + LVGL
|
||||
|
||||
## 刷写
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
name: CYD Human IR / PIR (cyd)
|
||||
git: a7854de
|
||||
git: 6226f0d
|
||||
date: 2026-10-23
|
||||
board: ESP32-2432S028R (ILI9341)
|
||||
features: SoftSPI touch, LVGL, PIR OUT on GPIO22 motion count+1
|
||||
features: SoftSPI touch, LVGL, SR505/mini PIR OUT GPIO22 @3.3V motion count+1
|
||||
flash_size: 4MB
|
||||
offsets:
|
||||
0x1000 bootloader.bin
|
||||
@@ -12,5 +12,5 @@ offsets:
|
||||
sha256:
|
||||
bootloader.bin 3D234A7471F67B013686DABD4DEE7C1FA915C9928463616A94BC9297ACF1ABF8
|
||||
boot_app0.bin F94C5D786A7A8FAB06AC5D10E33BF37711A6697636DC037559EA19CC410A17F0
|
||||
firmware.bin CA8FBB88050BC2284EFDDBF3ECC711A6539D4F3829994017812A30C0E2E6B057
|
||||
firmware.bin A870E56D4391E361A9FF6F73AA522D6ED2826937AE2565B50A9F5AA9D36D37CA
|
||||
partitions.bin 148B959CBFF1C38AA8E1D5C0BA9D612C54997B945E56A63F41223EEF650653A1
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"boardId": "esp32-2432s028",
|
||||
"name": "CYD Human IR",
|
||||
"summary": "PIR human infrared module on GPIO22: each motion start increments count",
|
||||
"description": "SoftSPI touch + LVGL. VCC/GND/OUT->GPIO22. Auto polarity. Motion edge +1, hold bar, touch Reset clears.",
|
||||
"tags": ["pir", "human-infrared", "gpio22", "touch", "lvgl", "counter"]
|
||||
"summary": "Small PIR (SR505/mini SR501) on GPIO22 @ 3.3V: motion-start count +1",
|
||||
"description": "SoftSPI touch + LVGL. VCC 3.3V / GND / OUT->GPIO22. Float INPUT, idle LOW active HIGH. Motion edge +1, hold bar, Reset clears.",
|
||||
"tags": ["pir", "sr505", "human-infrared", "gpio22", "3.3v", "touch", "lvgl", "counter"]
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ $lines = @(
|
||||
"git: $git",
|
||||
"date: $date",
|
||||
"board: ESP32-2432S028R (ILI9341)",
|
||||
"features: SoftSPI touch, LVGL, PIR OUT on GPIO22 motion count+1",
|
||||
"features: SoftSPI touch, LVGL, SR505/mini PIR OUT GPIO22 @3.3V motion count+1",
|
||||
"flash_size: 4MB",
|
||||
"offsets:",
|
||||
" 0x1000 bootloader.bin",
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define CYD_TOUCH_CLK 25
|
||||
#define CYD_TOUCH_CS 33
|
||||
|
||||
// 人体红外感应模块 OUT → GPIO22(VCC→3.3V 或 5V 视模块,GND→GND)
|
||||
// 小型人体红外(SR505 / mini SR501)OUT → GPIO22;VCC→3.3V,GND→GND
|
||||
#define PIR_PIN 22
|
||||
|
||||
#define SCREEN_WIDTH 240
|
||||
|
||||
@@ -71,7 +71,7 @@ void pir_init() {
|
||||
g_idle_level == HIGH ? "HIGH" : "LOW",
|
||||
g_active_level == HIGH ? "HIGH" : "LOW", high_n);
|
||||
Serial.println(
|
||||
"PIR tip: many modules need 5V VCC; warm-up ~30s; watch OUT on screen");
|
||||
"PIR tip: SR505/mini@3.3V OK; warm-up ~30s; OUT HIGH on motion");
|
||||
}
|
||||
|
||||
bool pir_poll_detect() {
|
||||
|
||||
Reference in New Issue
Block a user