AC detection for garage door sensor

Hi all,

I’ve been trying for a while now to create a robust node for my garage door. Background: my garage door is essentially a large roller shutter, ran by a large tubular motor, which - in turn - is ran by a ROL-605-A controller (http://www.konelectronics.gr/download/ROL_SHUT-A(en).pdf.79b45c750d849bf5b9a3263debbe9805). So in the dump world, the door is operated using an RF remote control with just one button. You press once, the door starts to go up. If you press again before it reaches the top, you will stop the door. Press it again, it will start coming down. You get the point. The ROL-605-A controller, according to its (very nice) manual includes circuitry that stops the up/down relays when it senses that the motor has stopped moving (through its own mechanical end switches). And this works great indeed. I can hear the relays clicking as soon as the door reaches the up or down position.

I’ve built an ESP8266 node (Wemos D1 mini) that currently works to detect whether the door is at the top-most or lower-most position (using reed switches) and also simulates pressing the button to control the door. So essentially I know when the door is fully open or fully closed and I can control the door.

What if someone still uses the old RF remote though, to start opening the door and then stops it before it reaches the top? My sensor will tell me that the door is neither open nor closed and I have no way of knowing where exactly the door is, nor - most importantly - what will happen with the next press of the remote. In other words, was the door going up or down when it was stopped. I tried to solve this problem by getting an AC sensor (https://www.ebay.com/itm/240V-220V-AC-Mains-Sensor-opto-isolator-optoisolator-optocoupler-5V-3-3V-Arduino/272619019157?hash=item3f795c1b95:m:myE43YEiZUq1yUTpsK0I5CQ:rk:2:pf:0). I got the three channel one and hooked one channel to the wire that drives the motor up and the second channel to the wire that drives the motor down. I was sure that now everything about my stupid garage door would finally be smart. Alas! It seems that the AC sensor throws off the controller’s internal circuitry that detects when the door has reached the top/bottom and as a result, the controller’s relays were not being turned off as expected. My knowledge of electronics is limited, so I have no idea if there is some way to fix this.

Does anyone know why this happens or what I can do to fix it?

Or can anyone come up with some other way to detect the door’s position/direction of movement?

Sorry for the long post and thanks in advance for any hints

I have wondered this myself. Ideas:

More reed switches to keep better track of position?

A rotary encoder on the roller?

Some sort of camera detection?

Distance detector on the door?

I think you need to remember the last known position.
You could have a door closed flag and a door open flag
When the door closed switch changes from off to on, set the closed flag to true and open flag to false. Set flags in the opposite when the door open switch changes from off to on.
Then when you see either switch change from on to off, you can check the flags and see if the door had been open or closed last.

I’m a hardware type, so I don’ t actually know how to code this, but I’m sure others do.

Randy