I recently started thinking about a “smart” garage door controller.


I would like my “smart” garage to be able to:

  • Check if the garage door is either fully opened or closed
  • See if the car is in the garage
  • Open / close the garage door (using WiFi or Bluetooth)

With additional sensors and actuators it could also:

  • Record temperature and humidity
  • Detect (human) presence
  • Control lighting


An ESP32 (perhaps running ESPHome) seems ideally suited for this job.

  • ESP32 with WiFi and BlueTooth
    • WiFi used for OTA updates and MQTT sensor data publication
    • (optional) Bluetooth can be used for remote open/close
  • Power suppply
    • Option 1: USB with additional power brick
    • Option 2: Power (12V DC) from garage opener unit
  • Sensors
    • HC-SR04 Ultrasonic sensor, car presence detection
    • Magnetic (reed) switches, garage door open / closed detection
    • BME280, I2C temperature / humidity sensor
    • LD2410C, I2C mmWave radar human presence detection
  • Actuators
    • potential-free relays: open / close the garage door, control lighting, activate siren etc.

The sensor unit will be mounted on the garage ceiling, near / on the garage door opener unit. The ultrasonic sensor looks downward, presence of a car will reduce distance to the floor.

Board selection

Instead of using separate boards with a power supply, an ESP32 and the relays, I found a LilyGO T-Relay board that provides:

  • 12-24V DC power input
  • ESP32 with WiFi and Bluetooth
  • 4x relays with optocoupler isolation, each capable of switching 6A at 250V
  • I/O pins available via pin header, including 3v3 / GND for additional sensors

The board is very reasonably priced at around €15 - plus €6.50 for a LilyGO T-U2T USB to TTL adapter, needed to program the board.


Software and information for this board is available at github/Xinyuan-LilyGO. By default, the board comes with a simple sketch that switches each relay on and off when power is applied to the board. This is a nice starting point.


I’m experimenting with the board and sensors. Stay tuned for further development ;-)