# Wi-Fi Coop Door

可通过网页手动或按光照、时间自动控制的 ESP32 鸡舍门。

WiFi-enabled automated chicken coop door controller built on the ESP32. This project features a custom web interface, allowing you to control the door manually or set it to run automatically using either an environmental light sensor (photoresistor) or NTP-synchronized clock times.

可通过网页手动或按光照、时间自动控制的 ESP32 鸡舍门。

- id: sage-grouse-wifi-esp32-coop-door
- author: Sage-Grouse
- repository: https://github.com/Sage-Grouse/WiFi_ESP32_Coop_Door
- license: MIT
- shape: matrix
- scenes: home, art
- boards: ESP32
- browser_playable: no
- preview: Project screenshots
- html: https://esp32gallery.com/projects/sage-grouse-wifi-esp32-coop-door/
- html_zh: https://esp32gallery.com/zh/projects/sage-grouse-wifi-esp32-coop-door/
- json: https://esp32gallery.com/data/catalog/projects/sage-grouse-wifi-esp32-coop-door.json

## Hardware

ESP32-class board. Verify the exact board revision, display, power source and wiring in the upstream build guide.

ESP32 类开发板；请在上游构建文档中核对具体板型、屏幕、供电与接线。

## English

```
A 28BYJ-48 stepper with its ULN2003 board slides a coop door open at dawn, from an LDR threshold or an NTP-synced hour, and closes it at dusk; the whole thing runs on a DOIT ESP32 DEVKIT V1. A browser page at coop.local shows live status, toggles the light or time trigger, sets the threshold and the motor revolutions, and saves to flash. An edge-trigger state machine waits for a 30-second sustained shift before switching cycles, so passing headlights do not flap the door, and the position survives a power cut because it is written to Preferences. Power comes from 12 V through an MP1584EN buck to 5 V, and the ESP32 core has to be 2.0.17, since 3.0.0 and later may break libraries. Only the built-in libraries are used. The web page is LAN-only, not reachable from the farm.
```

## 中文

```
28BYJ-48 步进电机配 ULN2003 驱动板，天亮了把鸡舍门拉开，天黑了再关上；触发可以是光敏电阻的阈值，也可以是 NTP 对过时的时间点，主控是一块 DOIT ESP32 DEVKIT V1。浏览器打开 coop.local 就能看状态、切换光控或定时、改阈值和电机圈数，设置写进 flash。用的是边沿触发状态机，要环境持续变化 30 秒才切周期，路过的车灯不会让门来回抖，门的位置也随时写进 Preferences，断电后能恢复原位。供电是 12V 经 MP1584EN 降到 5V，ESP32 core 必须用 2.0.17，3.0.0 以后可能和库不兼容。只用内置库。网页只限局域网，离家连不上。
```
