Go Down

Topic: Using ESP8266 / Arduino and 2n2222 for Garage Door (Read 4107 times) previous topic - next topic

coogle

Well my goals are sort of incremental here.

Primary goal: Open and close the garage door from ESP8266 GPIO by closing the "Command" switch momentarily.

Secondary Goal: Implement the other two features as well by recreating the single produced by the switch/cap combinations of the other two switches.

The intent is a complete replacement of this circuit board. If anything, I will (separately) add a different momentary switch across the leads to open/close the door in the event the ESP8266 crashes or whatever.

INTP

So make your own board with identical components and use optocouplers in parallel with the buttons so you maintain manual control and you isolate the ESP from the higher voltage the garage opener works at.

wvmarle

It doesn't really have an effect on the circuit.
I wouldn't be so sure about that.

Quote
You are also correct on the three switches. One shorts the two leads directly and the other two short the leads but use a capacitor to create a signal. The rate of discharge of the caps determines the behavior interpreted by the garage door base.
How did you figure out that part? Did you attach a scope to it to follow the signal in time and see what it really does?
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

coogle

#18
Jul 26, 2017, 08:22 pm Last Edit: Jul 26, 2017, 08:33 pm by coogle
No I just deduced that because it makes sense. All three close the two leads, one of them closes the two leads directly, the other two do so but first they must charge a cap. The result on the leads would be a waveform of signal, would it not? (btw, if you just short the leads together it closes the door -- so yes, the LED placement was wrong in my schematic, but it probably didn't matter in this case).

The rest of the circuit doesn't know anything else besides what's happening on those two wires. I suppose it could be doing something a lot more complicated but that seems way overkill. Either way that was a secondary concern for me (as I don't use either feature besides open/close) so I was going to play with that once I got the other part working.

I ordered some octocouplers and I'll play with it that way. You are absolutely correct probably the best answer here is to use them in place of switches and keep the caps,etc. as they are in my board. I've got enough GPIO pins on the ESP8266 to use three of them and still have my reed switches. I may or may not bother implementing parallel momentary switches for all three -- like I said I don't really care about two of them.

To answer my original question, which is why my transistor solution didn't work -- is the answer then because I incorrectly assumed that the V- lead was ground?

Riva

What about your code? How long are you powering the transistor on/off for as this will affect the action taken as a button press.

Are the switches momentary close or momentary open (or a mixture of both)

Do you need a resistor in the emitter or collector line to limit current through the transistor?
Don't PM me for help as I will ignore it.

coogle

#20
Jul 28, 2017, 11:29 pm Last Edit: Jul 28, 2017, 11:37 pm by coogle
Hello all!

This has been much more difficult than I expected!

Update: So I went off and ordered some optocouplers per the suggestion of INTP and created the following circuit with it. Unfortunately it does NOT work!! Please see the attached schema of what I've built.

I measured the voltage across the V+ V- leads of the garage door wires and it is actually about 22V DC across the leads. When I activate the optocoupler it drops to 0.5V but the garage door doesn't open.

Considering the original control circuit it seems to me, all I should have to do is short out these two contacts! Is it possible that the 0.5V is causing the control board not to recognize the short? Is there something I can do to here I'm missing?

Again I'm just as interested in why this doesn't work as a solution (i.e. just use a relay).



Thanks!

John

coogle

What about your code? How long are you powering the transistor on/off for as this will affect the action taken as a button press.

Are the switches momentary close or momentary open (or a mixture of both)

Do you need a resistor in the emitter or collector line to limit current through the transistor?
The switches are both momentary close, and my code sets the trigger pin to HIGH for 1 second. For what it's worth, if I short the leads to the opener there is no delay (as soon as they short the door closes) so it should be plenty of time.


INTP

Yeah, the duration doesn't matter for button press for the 'open' command. That is, unless you can press it super duper quickly to trigger the other commands that are controlled by caps on a DC (I.e., nothing passes a cap in DC, but there is a little bump)

TomGeorge

#23
Jul 29, 2017, 02:18 am Last Edit: Jul 29, 2017, 02:20 am by TomGeorge
Hi,
Can you put your DMM across the RED and WHITE terminals and record the DC voltages and record the AC voltages when you have no buttons pressed and each button pressed?

Hold each button for 3 or 4 seconds please.

Thanks.. Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

coogle

Yeah I'll hook up the original board and take those measurements tomorrow and post. It's really quite confusing! Nothing about this circuit looks at all complicated..

TomGeorge

#25
Jul 29, 2017, 05:19 am Last Edit: Jul 29, 2017, 05:20 am by TomGeorge
Hi,
Sending three different instructions down two wires can get complicated, your button board may work on a current rather than voltage basis.
Or AC/DC.

Tom.. :)
PS A relay would be easier.   lol... :)
Everything runs on smoke, let the smoke out, it stops running....

wvmarle

Again I'm just as interested in why this doesn't work as a solution (i.e. just use a relay).
If you have the complete schematics of the rest of the control system, we may be able to understand why it doesn't work.

As per other posters, I'm also suspecting that there's an AC involved. Three buttons on two leads, two capacitors - there's some trickery behind this that I don't know. Having AC of course causes problems with your optocoupler, which effectively is a diode as well.

So just thinking about this: what happens if you take two diodes in parallel, opposite biased, and use that to short the leads? Then of course you still have the 0.7V or so drop, but at least AC passes more or less unhindered. If that works, it should also work by using two optocouplers to replace a push button.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

wvmarle

Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

coogle

Thank you all for your ideas and suggestions so far!

So it turns out whoever thought of AC here was right. I hooked the original control board up and this is what I found:

33V AC across the Red and White leads with no buttons pushed

~0.7 AC across the Red / White leads with open/closed pushed

~27V AC across the leads with "Light" pushed

So based on this, in theory, I should be at least able to get the open/close working with a combination of two optocouplers triggered at the same time across both leads.

Here's the next question though -- we are quickly leaving my world of understanding so this is a lot of fun! I have many questions now. Let's start with this one..

I'm super confused as to how the polarized components (i.e. both caps and the LED) are functioning in this AC circuit. The LED I sort of get (it's only being lit by the current going in a single direction since it's a diode), but I'm very confused on the caps play into this..


Either way, how could I use optocouplers to address this? I figure if I can get open/close working the rest will work fine if I put in an appropriate cap on the red lead.

John

wvmarle

Maybe the LED is even running on DC while the rest works with AC - you can superimpose one on the other. That's how you can do power over ethernet, for example. The AC signal and DC power supply don't interfere.

Capacitors let AC signals pass, while blocking DC signals. Different values of capacitors have different impedance (resistance) to different AC frequencies. Maybe they have a second pair of 1 uF/22 uF capacitors in the main control so they can see which signal is passed through?
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up