Finished with the case designs and have everything installed. Just need to work on the Home Assistant side now to get it to display properly and test.
Finished with the case designs and have everything installed. Just need to work on the Home Assistant side now to get it to display properly and test.
My door controller also has upper and lower limit sensors and I’m trying to figure out how to tap in to them. Could you provide more detail on your relay buffer board circuitry please? Are you essentially using relays to drop down from 15v to 3.3v?
I’m away from home so will add the info you want want I can access the files.
Gaz
Thanks Gaz. Safe travels.
I did the same thing. The logic board in the opener runs on 5v (but sadly, not enough power to also run the ESP, so I had to use a supplementary PS), and has a ground contact that travels between two logic-level contacts that are on threaded rods. So I can tell with certainty that the door is either fully open or fully closed, but can’t sense speed or direction when it’s in-between.
Thankfully, that last use-case is only a problem if the ESP reboots while the door is traveling, which so far has not occurred. But as soon as the door reaches one end, the ESP reports its state.
I have a similar setup - two sensors at the stop ends with the controller ground wired to COM and 5v connected to NO and nothing connected to NC. This enables the controller to determine when the stops are reached by pulling to ground. Since I’m using an esp32 which can’t cope with 5v, I thought I’d connect a pull up pin to the NC contact on each switch. This works, the esp32 can detect the switch states changing, but this sometimes causes the controller not to see the switch activation so the motor keeps running - obviously isn’t good! I’m using a separate PSU for the esp32 and connected its ground output to that of the controller. I thought that this approach would avoid interfering with the controller circuits completely, but obviously this isn’t the case and I have no idea why!
Here is my circuit diagrams of the buffer board and the ESP node, I went this way as there was no easy access to the existing controller board to make any meaningful measurements.
The idea was to isolate the existing controller from the ESP node, only the grounds are connected. So the original remotes still work as before.
Gaz
Thanks very much, @gaz99. And sorry for the very late reply.
So, basically you’re hooking up the existing limit switches to drive relays (complete with diodes) to span the voltage difference between your devices. I’ve (finally) just tested this and it looks like it will work so I’ll proceed with something similar.
Originally, I had hoped to avoid the relays altogether - the limit switch is a three way switch which drives the door controller to (the common) ground when activated. I thought I could use the other side of the switch to independently drive my esp32 to ground (when not activated). This works (the esp sees the switch change state), but for some reason it causes the door controller to occasionally not see the switch activate, causing the door motor to keep running which is obviously not good! If anyone has any ideas as to why this is the case I’d really appreciate the input - if nothing else to help me understand basic electronics!
After getting it working with relays I did try using opto couplers but I was get some strange results with missed triggers and false triggers so I went back to relays.
I also had to provide separate power to the ESP as the original controller could not supply enough current for the ESP connected, every so often the power would sag and the ESP would reboot.
The main issue is that the original controller can’t be accessed when the door is in operation so I had no way to do any investigation and the relays worked so I left it at that.
I may do a PCB at some stage to replace the rats nest of wires and modules.
Gaz
I used to have Nexx Garage but I wanted to control the light toggle as well. also instead of a relay I used two PC817 optocouplers one for to open signal and another for the light toggle. Did go for the reed switch route for the open and close sensors, cheap and had the sensors. All Working for over a year without issues. Now building another for my sister’s house( this one has one position sensor)
Still pending is a sensor to capture the light state.
I have a double garage sectional door with rotational springs to counter the door weight. I installed a rotary encoder at the end of the spring shaft.
The rotary encoder outputs A and B are connected to GPIO 2 and GPIO 3 of a ESP8266-01.
My door counts 144 steps from closed to full open. Note: it is “self calibrating” because is stops counting at 0 - closed. Depending on your setup you may want to swop A & B to change count direction.
the ESPHOME code is simple:
substitutions:
device_name: garage_door
esphome:
name: garage-door-encoder
friendly_name: Garage door encoder
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
- platform: esphome
password: "<automatically generated on compile>"
wifi:
ssid: mySSID
password: myPassword
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Garage-Door-Encoder"
password: "myPassword"
web_server:
port: 80
captive_portal:
sensor:
- platform: rotary_encoder
name: ${device_name} open
pin_b:
number: 3
mode: INPUT
pin_a:
number: 2
mode: INPUT
max_value: 150
min_value: 0
resolution: 1
Thank you for sharing. This is giving me ideas!
Would you be able to share a picture of how you attached the sensor to the door? That’s where I get stuck figuring out how to do this.
My approach was very straightforward in the end.
The two end stop contacts are three way switches and the garage door mechanism only uses the normally open contact (5V) and the common contact (ground). This way it can detect when the door is fully open or closed and shut off the motor when contact is made.
I used the other, normally closed contact and ground on each switch, so I didn’t have to touch any of the existing wiring. Hooked up to an esp32 via esphome and inverting the pins in the config, I can also detect when the door is open or closed and use this to drive a cover. A simply relay attached to another pin on the esp32 allows me to trigger the motor mechanism when the cover is activated.
This solution is totally non-invasive, and is electrically isolated from the garage door mechanism - just a common ground. It is used multiple times every day and has worked flawlessly for the past two years.