State Aware Garage Door

That too. Endless possibilities.

Many openers already have an optical interrupter on the motor shaft. You could either tap into the existing optical sensor or find room to install an independent one. With two properly-clocked sensors, aside from speed versus time, you’d be able to determine direction.

For @Grunt’s opener, he could fabricate an interrupter for the top of the shaft as long as there’s enough room in the dust cap for it and the sensors.

image

There’s one inside my dozen-year-old unit.
Nice thing about those wheels is you could add your own IR-beam pair next door to the factory ones, and not have to disturb the factory circuit at all.

If motor is DC (mostly they are 24V) then I still think that adding two small relays via diodes in reverse directions to motor contacts is by far the easiest solution. No tinkering, no dissasembling, no encoder programming… on relay for open, one for close.

I think you missed the point. The OP isn’t trying to control the open / close or get basic open / closed state feedback, they want position feedback. ie: exact percentage open /closed.

1 Like

If that’s the case, then my solution is not ok, sure. But, first post indicates only using reed relays, later he mentions using hall sensors… so from that i concluded that he only needs:

  • open
  • closed
  • opening
  • closing

That’s where my suggestion comes from.

True, but I think the idea has grown since then!

1 Like

I was thinking of an ESPHome/ESP8266/MPU6050 device to instantaneously calculate and report door tilt in number of degrees. Worst problem is actually delivering power to the Wemos D1 Mini ESPHome device, but this hack resolves that very nicely.

But you only need 5v. Have you seen a long enough 5 v retractable?

I have seen 5v retractable usb cables, so that might work.

Wouldn’t this do away with the need for a cable? RuuviTag Open Source BLE Sensor — ESPHome

Yes, the idea HAS grown. This is all very new to me so I have no idea what kind of sensors are available for use. I’ve been really surprised at the breadth of incredibly affordable sensor modules and the whole ecosystem around the ESP8266/32 and arduino boards. I’ve got all the things I think I’ll need for this; small project box, breadboard, rotary encoder, relay, and an ESP32 I’ve had sitting here.

I decided on the encoder route thinking it would give me a good balance between simplicity and accuracy. I was originally thinking it would give me 100 values, but only just realized that was a terrible assumption and I have no idea what the total number will be…I’m sure there’s a way to math the shit out of it.

The encoder requires very little force to rotate it, so I’m thinking I may be able to mount it to the plastic gear housing upside down and use something like hot glue to bind the encoder and spindle together.

I’m curious what you purchased for the rotary encoder. Can you post a link to the part?

Looking at the picture of your opener, I have some thoughts. This type of interrupter could be glued to the top of the motor pulley.

image

And these optical sensors might work if the interrupter can comfortably fit through the 5mm slot.

https://www.amazon.com/Optical-Endstop-Photoelectric-Control-Printer/dp/B07MFT8NWJ/ref=sr_1_56?dchild=1&keywords=R+REIFENG&qid=1630045499&sr=8-56

You’d have to make stable supports and properly align them (see http://thedenneys.org/pub/robot/encoders/ ).

But how will this give you directional data?

If it rotates “left” the sensor will see “light, no light, light, no light”, and when it rotates the other way it will be the same.
Or do I missunderstand what you are saying?

If you click Rob’s link you will see.

1 Like

You need TWO optical sensors for direction information. OR, some models indeed have only one, but they rely on end switches informatin for direction. The problem of those models is power failure when gates are “in between”. Usually in this case gates go very slow to hit end switch, so they know where they are.
But, overall better solution is to have two sensors.

1 Like

Here’s the code required for a quadrature (2-sensor) incremental optical encoder:

https://github.com/DavidAntliff/esp32-rotary-encoder-example
https://github.com/DavidAntliff/esp32-rotary-encoder

Surely a rotary encoder is easier, all that is done for you.

That is CERTAINLY a great combo sensor device, but just a wee bit pricey at 24,92€ if you buy three or more of them. And who really needs three or more?

I looked around for coiled/retractable USB power cords, but most are far too short to be useful.

Well I have 3 garage doors. But yes too expensive.

I saw a 3m retractable usb on aliexpress.

https://m.aliexpress.com/item/4000706680778.html

I think that these cables have some sort of “stop” function, so you’d have to remove that (if possible, since case is surely glued) or they will stuck when extended.

How about measuring time of travel? I’ve seen quite some electronics in my career with measuring time of travel and they were dong just fine. These devices many times had “bump to the end” as end stops, so they even didn’t have mechanical switches. Currently i have garage door opener which has “bump to the end” as stop switches (no mechanical ones). I didn’t explore too deeply if it has encoder, but after quick look i didn’t see one, so it’s possibly time measuring. Works perfectly.

So, end stops and time measuring. After all, you don’t need up to a millimeter precision… (or do you?)

Taiss Rotary Encoder Module

On the inside of the dust cap, there is a cylindrical step that fits into the hub of the spindle which gave me a perfect guide to drill a 1/4" hole through the cap for the encoder. After some fit checks and measuring, I’ve ordered some 3/8" rubber bushings that will go down into the spindle. From there, I will have to cut a 1/4" hole in the center for the rotary encoder to fit in. Finally, the stem on the encoder is too long, so I’ll need to hit up a local hardware store to grab a 1/2" spacer.

I’ll grab some pictures in a bit…didn’t think to do it while I was poking around.