ESP32-S3 garage door button
A relay that closes the contacts of your opener's wall button for half a second, as if you pressed it: you trigger it from a button away from the door, and the green LED tells you the pulse went out. The relay goes only across the wall button's two low-voltage wires; never on the motor's 230 V.
The program
Chip BASIC: every line is one instruction you can read and change. The compiler checks it at every release of the site.
10 IF BUTTON("A") THEN RELAY on : LED green, on : WAIT 500 : RELAY off : LED green, off
20 WAIT 100
30 GOTO 10What you should see: pressing the button turns the green LED and the relay on for half a second, then off; one pulse per press.
▶ Open it in the IDEIn the simulator you see the logic run right away, with no hardware. The simulator does not check the wires: you check those on the board, and the IDE's wiring check walks you through it.
The parts
The compiler finds the parts in the program. Each has its own page with a test program to run before you build the whole thing.
- LED (with resistors: 220 Ω, or 470 Ω on the UNO R4)The part's page: LEDs: red, yellow, green and blue lights
- Push buttonThe part's page: Push button
- 1-channel 5V relay module (for a pump, fan or low-voltage lamp; never the 230 V mains)The part's page: Relay
How to wire it to an ESP32-S3
- + green → ESP32-S3: GPIO1Through a 220 Ω resistor
- − → ESP32-S3: GNDCommon ground: this link is mandatory.
- Signal → ESP32-S3: GPIO6Internal pull-up: pressed reads as 1
- GND → ESP32-S3: GNDCommon ground: this link is mandatory.
- IN → ESP32-S3: GPIO42
- VCC → ESP32-S3: 5V
- GND → ESP32-S3: GNDCommon ground: this link is mandatory.
- COM · NO → your devicePower the device (pump, fan, lamp) from its own low-voltage supply (batteries or 5-12 V), never the 230 V mains
If it does not work
- The lights: the program runs but nothing happens
- The LED is the wrong way round, or the series resistor is missing. The long leg goes on the board pin's side, the short one towards GND, with the resistor in between (220 Ω, or 470 Ω on the UNO R4).
- The button: the program runs but nothing happens
- The button is turned: the two legs in use are already joined inside the button. Seat it across the breadboard's middle gap and use two legs opposite each other on the diagonal.
- The relay: the board restarts by itself
- The load or the relay's coil disturbs the board's power. Power the pump or lamp from its own supply, never from the board, and use an opto-isolated module.
- The relay: the program runs but nothing happens
- The module gets no 5 V, or the signal is on the wrong pin. VCC to 5 V, GND to GND, IN to the pin shown in the diagram.
What you can change
The pulse length is the WAIT 500 on line 10: some openers want one second. Before wiring the relay, check with a multimeter that the wall button is low voltage. Ask Chip to add a sensor that says whether the door is open.
Which boards it works on
- ESP32-S3 Freenove: yes
- Nordic nRF54LM20 DK: yes
- Arduino UNO R4 WiFi: yes