This project uses ESPHome, a Wemos D1 Mini (ESP-8266), and a magnetic reed switch sensor to monitor the time your dog spends inside their kennel. The onboard LED will light up when the kennel door is open, and turn off when closed.
Features:- Monitor the kennel door’s open/closed state.
- Use the onboard LED to indicate door state (LED on when door is open, off when closed).
1. Wemos D1 Mini (ESP-8266):
- Microcontroller for running ESPHome and controlling the reed switch and LED.
2. Magnetic Reed Switch:
- Detects the kennel door's open/closed state. The switch closes when the magnet is near and opens when removed.- Normal Closed is beneficial because it defaults to a "closed" state, making it easier to detect faults, such as if the wire gets disconnected, as the sensor will register as "open."
3. 3D-Printed Enclosure:
- Protect your ESP-8266 with this Thingiverse Enclosure by JonnyB
ESPHome YAML ConfigurationThis YAML code sets up the kennel door monitoring using a reed switch sensor. It also controls the onboard LED of the Wemos D1 Mini to show when the door is open or closed.
Explanation of the Code:- Wi-Fi Configuration: The device connects to your Wi-Fi network, with a fallback AP mode if Wi-Fi is unavailable.
- Binary Sensor (Reed Switch): Connected to GPIO5, the reed switch detects whether the door is open or closed and logs it. The state change is delayed slightly to debounce the sensor readings.
- Onboard LED Control: The onboard LED (GPIO2) turns on when the door is open and turns off when closed.
To protect your ESP-8266, print this enclosure using the [Thingiverse Kennel Monitor Enclosure](https://www.thingiverse.com/thing:4932236). It keeps your device secure and allows wiring for the magnetic sensor.
This project enables you to track your dog's kennel door state and provides an easy-to-understand visual cue with the onboard LED. It’s easy to set up using ESPHome and a D1 Mini. The 3D-printed enclosure ensures everything is securely housed.
Feel free to expand this project with additional features, such as logging or integrating other sensors!
Comments
Please log in or sign up to comment.