HomeKit gate controller for Centurion (Centsys) D5 Evo gate motor
This project implements a HomeKit-compatible gate controller using an ESP32 microcontroller and the HomeSpan library, specifically designed for Centurion (Centsys) D5-Evo gate motors. It enables remote control and status monitoring of the gate with Apple HomeKit.
- ✅ HomeKit Integration: Seamless control via the Apple Home app using the HomeSpan library.
- ✅ Gate Control: Open and close the gate with a relay trigger.
- ✅ Status Detection: Real-time detection of gate states (open, closed, opening, closing).
- ✅ Gate Status Detects when gate opens/closes from a different source (e.g. remote control, intercom, keypad).
The system uses an ESP32 microcontroller to manage a relay and monitor the gate's operational state:
- Relay Control: The relay pin (GPIO 35) triggers the gate motor.
- Status Monitoring: The status pin (GPIO 39) monitors the gate's operation based on pulse patterns sent by the gate controller.
- Flashing Patterns: The gate signals its state using pulse patterns, where the duration of HIGH and LOW signals indicates whether the gate is opening or closing.
- Logic Level Conversion: A logic level converter is used to shift the gate's 5V status signal to a 3.3V input suitable for the ESP32.
The DEV_GATE.h
class implements:
update()
– Triggered by HomeKit to open/close the gate.loop()
– Continuously monitors the gate's state based on the input pin.
- ESP32 microcontroller
- Relay module (for gate control)
- Logic level converter (5V to 3.3V signal conversion on status pin)
+----------------------+
| ESP32 |
|----------------------|
| GND ----------------|-----> **Relay GND, Gate GND, LLC GND**
| 3.3V ----------------|-----> LLC LV
| 5V ------------------|-----> LLC HV, Relay VCC
| GPIO 35 -------------|-----> Relay IN
| GPIO 39 <------------|----- LLC LV OUT
+----------------------+
+------------------------+
| RELAY MODULE |
|------------------------|
| IN <---- GPIO 35 |
| NO -----> Gate TRIG |
| COM -----> GND |
| VCC <---- 5V |
| GND <---- GND |
+------------------------+
+---------------------------+
| LOGIC LEVEL CONVERTER |
|---------------------------|
| HV <---- 5V |
| LV <---- 3.3V |
| GND <---- GND |
| HV IN <---- Gate SIG (5V) |
| LV OUT ----> GPIO 39 |
+---------------------------+
+-------------------------+
| GATE MOTOR |
|-------------------------|
| GND -----> ESP32 GND |
| TRIG <----- Relay NO |
| SIG -----> LLC HV IN |
+-------------------------+
- HomeSpan Library
- Arduino IDE (for programming the ESP32)
- Wi-Fi: Set credentials in
main.ino
. - HomeKit Pin: Default pairing pin is
06533259
. - Pins: Adjust
statusPin
andrelayPin
if necessary.
- Install the HomeSpan library in Arduino IDE.
- Download and open both
main.ino
andDEV_GATE.h
in an IDE. - Configure Wi-Fi credentials, HomeKit pairing code in
main.ino
. - Upload the files to your ESP32.
- Pair the device with HomeKit using the code.
- Obstruction Detection: Currently not implemented.
This project is open-source under the MIT License.
Contributions are welcome! Feel free to submit pull requests or open issues for improvements and bug fixes.