D1 mini + garage door opener wall button

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
backslashv
 
Posts: 45
Joined: Fri Mar 27, 2020 11:48 pm

D1 mini + garage door opener wall button

Post by backslashv »

Hi, I'm trying to put a D1 mini (powered externally) in between the garage door controller wall wires and the wall button itself so I can control the door remotely as well. As soon as I connect the mini, the wall button turns off so it doesn't function anymore. Only the mini works. The voltage between the terminals of the wall button goes to 0 when the mini is connected. Some background info:

- The voltage between the two wires coming out of the wall: 8.5V
- D1 mini connected to an IRF3708 n-channel MOSFET.
- A 10K resistor between the gate and the source of the MOSFET.
- The two wall wires are connected to the MOSFET's drain and source with the D4 pin on the mini acting as a GPIO switch.
- The wall button is fairly advanced (has wifi built in and also controls/dims the light on the garage door opener).

How can I prevent the aforementioned voltage drop?

User avatar
backslashv
 
Posts: 45
Joined: Fri Mar 27, 2020 11:48 pm

Re: D1 mini + garage door opener wall button

Post by backslashv »

[EDIT] I switched the wires from wall that are connected to the drain and the source of the MOSFET. Now, the voltage on the wall button doesn't go to 0 all the time. It goes to 0 as soon as I apply voltage between gate and source (with ESPHome's GPIO momentary switch). This causes the garage door to stop mid opening. So, I still need a way to prevent this momentary voltage drop on the wall button.

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: D1 mini + garage door opener wall button

Post by adafruit_support_mike »

Bump the gate-source resistor up to 1M, and put a capacitor in parallel with the resistor.

The capacitor will basically act like a short-lived rechargeable battery holding the mosfet's gate voltage high.

The resistor and capacitor values you want will depend on the amount of time you want the mosfet to stay on.

Ohms Law says V=IR and R=V/I, which means resistance has units of Volts per Ampere. The Ampere is 1 Coulomb per second, so V/A==V/(C/s)==Vs/C. Capacitance has units of Farads, which break down to Coulombs per Volt. When you multiply them, all that's left are seconds:

R*F == (V/(C/s))*(C/V) == (sV/C)*(C/V) == s

That value is known as the 'RC Time Constant'. For any capacitor charging or discharging through a resistor, the voltage across the resistor will drop to 36.7% (1/e) of its starting value after 1 time constant. That's independent of voltage, so a 2 time constants the resistor voltage will be 1/e of its value at 1 time constant, and so on.

As a rule of thumb, the resistor voltage will be less than 1% of its original value after 5 time constants. We usually call that the point where the capacitor is fully charged/discharged unless we care about fractions smaller than 1%.

For the conditions you mentioned above, the gate voltage will start around 8V, and the mosfet will stay on until the voltage drops to about 3V. 3/8 is close to 1/e (0.375 -vs- 0.367), so you can assume the mosfet will stay on for about 1 time constant.

A 1M resistor in parallel with a 10uF capacitor will give you roughly 10 seconds.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”