Long story short my garage door motor has buttons that never do the same thing depending if the door is moving or not and which direction.
I have found 4 plugs on the motor which seems to me to be GND, BTN, PWR, BTNclose. (They are not labeled, well they are actually numbered 20 21 22 23 but I couldn’t find any documentation for my tubauto procom 10-3)
I find consistent 5V between GND and BTN or GND and BTNclose and if I put a wire between GND and either BTN it makes the door move, the logic again is “complicated” and depends on things like the garage door being already moving.
I have bought this ESP8266 https://a.aliexpress.com/_mLG67uL
I believe that I will be able to power it between GND and PWR as my multimeter reads 22.81V there.
Now to get the status moving or not, I am wondering if I could get fast consistent and precise reading of the GNT to PWR voltage as I have seen with my multimeter that it instantly drops to 22.78 instead of 22.81 when the motor is moving.
I will already be adding 2 reed switches to this board to detect if the door is fully opened or closed, I was wondering if I can use the ADC of the esp to read precisely the PWR voltage…
If yes I would gladly take some help as to how as I suspect simply soldering the ADC pin to the 22V of the power will probably fry the board…
That is a pretty high voltage. You will need a decent DC: DC converter for that.
I don’t think reading the supply voltage to tell if the motor is running is a good idea. The difference you measured is 30mV at about a 30V range (30000mV) so you need (likely much) better than 0.1% resolution (and repeatability and possibly accuracy). That is way more than most ADCs can do.
You can add a vibration sensor to the door or motor housing, which might work.
That board is 5v in, so as @toxic0berliner notes, it will need that dropping to 5v (I’m not sure what the 0-70v marked input is for in that board?) 24vdc is a common voltage for household automation, so your 22v is close enough to be that. Or if you’ve got mains nearby, then a simple USB adapter is fine to get 5v from.
That board doesn’t have a micro-usb connector, which makes things a lot easier for it’s first programming with esphome (once you’ve done it once, future updates can be done over wifi). It might need a bit of soldering to get it connected to your programming computer. I’ve only used separate-chip ESPs with a usb connection so can’t advise on that.
For sensing movement;
You’ve mentioned reed switches (I love these - simple, reliable, cheap) and that sounds great for close/open sensing, but perhaps one more could be used for positional sensing as well? A series of small magnets glued to the door which pass under a single magnetic reed switch mid-way could trigger multiple open/closed events and should be fairly reliable indicator of movement. (Any event from this sensor within NNN ms = door is moving)
Manual can be found, but it’s in french (google translate it).
Buttons on garage doors are usually open-stop-close-stop in function.
Regarding movement sensing: monitor motor output, that’s only decent way. Of course you’ll have to monitor both pins (via diode, for example), since voltage is either in one or in other direction (for opening or closing) , and you’ll also need to lower voltage: since voltage can varies (if motor has slowdown) it’s best to do with resistor and 3.3V zener diode.
There are examples of garage door monitoring on this forum, one of them is THIS ONE. It uses shelly uni.
I use the Shelly Uni Plus to monitor my garage doors too. 2 switch inputs to monitor where the door is. Output 1 drives a relay (mechanical) to my door operator push button momentary switch (wired in parallel, so it can function either way).
The logic is if door fully closed :
1st push starts door to open, another push stops the door if not fully opened, another push reverses and closes the door. The opposite happens if the door is fully opened.
Since there is a power plug for the opener. I use a regulated 5 VDC power brick for the Shellys
Keep it simple, do not over think or engineer it.
Thanks for the many answers.
I did miss that this board indeed has no USB but I own a little USB dongle I already used to flash openmqttgateway I think it’s also going to work for this and later flashes will be over wifi.
I already used a few esp32, just never “designed” the circuit or sensors myself.
I believe the reed switches will be “easy” if I understand I Soler one end to GND the other to a gpio and select the proper number in the yaml config.
This is mostly to be quick as if I read specs correctly I should be able to read the voltage quite precisely and many times per second so an accurate moving/immobile state can then be derived easily.
I am unsure how I would go about connecting anything to the motor itself, maybe my other alternative was again some reed switches… I do own a 3d printer and was thinking of building a small wheel that I could clip over the rotating shaft that holds the counterweight for the door, it spins 6.5 times to open or close the door, of I put 4 little magnets on this wheel and a single reed sensor static, it should register 26 open/close per opening, lasting 20 seconds so a bit more than 1 event per second, hopefully this could also give me reliable detection of the moving state…
I don’t understand how you manage to use such simple systems, my door does the same : from closed the button does open stop close, but my remotes are not perfect and the delay from press to door opening is really variable… so I want the ability to mash the open button as many times as I like and to do so I need to “ignore” remote events when the door is already opening and maybe not ignore them as my wife is sometimes pressing a different remote at the same time as me and she’ll inadvertently stop the door. Yeah this esp system I build must cohabitate with the existing remote my wife uses…
The wheel of magnets spinning in front of a reed switch seems the simplest for me but will need testing to ensure I can communicate that fast with home assistant or handle the moving status with a lambda function locally on the esp, and I also need to check I can make the wheel small enough with enough magnets to be viable on my door (not helpful if the sensor isn’t triggered down between 2 magnets if they’re too close to each other)
So thinking about this voltage sensor as a backup solution or one that would require less hardware tinkering just a bit of soldering…
Will draw a picture of what I think I can do for review as you all seem really nice probably can critique or enhance my understanding
Do you see something obviously wrong here ?
Should my reed switch be connected to +3.3V instead of GND on the other side ?
I checked here https://www.ti.com/lit/ds/symlink/ina219.pdf seeing that A1 and A2 being GND the thing would get an address of 1000000, hope it’s indeed ok 0xF4240
But I’m not sure at all what VCC is actually for, I seem to read that it should be 3 to 5V so I linked it to some random 3.3 on the board… Vin- and Vin+ at the bottom of the INA219 really confuse me, I left them unplugged, probably wrong…
Still not sure it’ll be able to read something significant in term of voltage…
If my reed switch experiment is as simple as above I might even do something like this with my “wheel of magnets” :
Later I will even think about counting the time the door is moving or the number of pulses depending of what’s best between voltage sensing and wheel of magnets, I could then estimate the corrent progress of open/close and report a cover position, but that is icing on the cake, I do no need my door anywhere else than fully opened or fully closed…
I see the guy in your example simply shoved another cable in it’s motor, I’ll try to identify this on my motor too, I’ll try to check with my multimeter first, I can shove my multimeter in there, do you think I should measure between this and any “ground” on the board ? As I see it that’s what the shelly is doing, so I might try it, hope I won’t fry anything
I’m curious what it’ll read, if my understanding is correct I could either buy the shelly uni, or I could build myself a voltage divider to get the motor voltage (probably 24V) down to 1V and use the ADC onboard my current ESP-12F.
Both, I aim to control my garage door property from HA which entails that the controlin thing here esphome will have to know if the door is moving or not.
But in my example I left out the relay part as it seemed trivial to me and I’m mainly asking help in sensing the movement.
I am thinking about the example I was given and will be looking for a way to find and test the 2 pins that actually control the motor with my multimeter, and will be looking for a solution to sense that voltage, maybe an octocupler with the ADC port, the guy in the example used a Shelly that property already has some kind of voltage divider that I’m unfamiliar with so with the esp-12f I have on my relay board I think the safest is maybe a cheap octocupler
I suspect that the 4-wire connector has ~24V supply on two of the wires, probably black and brown, which you can use for powering your Esp. Verify though.
Then you have completely separate connectors for control, likely labeled with some switch symbol. There you connect your relay output.
To get anything better than guesses you need to send some good photo of the circuit board.