Trying to read voltage difference on 16V maximum garage door opener wires

Then by definition the first LOW read on the wire is the start of the pulse. After detecting that I would wait for say 10-20mS and read again to verify.


Rob

Thanks Rob, I just learned my assumption that the two states were 16V steady and 16V pulse. I did a simple analog read and output to serial. At first it was 1023 for many test states (I put no delay in) then suddenly I saw reading of 0 to others (I think the others is i am catching right at the state is changing). So I know know that the difference between the states is a different pulse rate.

Do you or anyone have suggestion on how to determine the pulse rate? I am thinking I just have to sample it a bunch and figure it out.

Is there any bounce in the signal? If so you need to take a couple of readings a few mS apart and only accept the value if they are the same.

Note that if you are using an analog input a slight difference in readings should be considered "the same", in fact in your case anything > 500 is a HIGH, < 500 is a LOW. But why wouldn't you use a digital input?

What is driving this signal? A mechanical switch or some electronics?

To determine the period/frequency just time between two consecutive rising (or falling) edges, you could use an interrupt for this or just poll the input


Rob

Rob good point on the digital signal. I think that may be the way to go. I will try that today. I did notice that there is a large variance in analog values even on a constant signal from the arduino's 5V pin to the analog. I did make this less when I put the adjacent pin to ground. There seems to be a bit of cross talk on the analog pins.

OK tested my signal using digital pin and traced the resulting pulses using the simple digitalread example in arduino. I got the results in groups of 8, 1s and 8, 0s. Unfortunately, I saw no change in the pulse rate in either condition which puzzles me.

There are two states on the line. One when the lockout is inactive (the LED on the button panel is solid on) or active (the LED blinks). I figured that the pulse would be different. Any ideas as to how to identify the difference would be greatly appreciated.

I am thinking of tapping the LED as there has to be a difference there or else how could it be solid/blink?

This activates the lockout and it then changes the signal form steady 16V to a pulse on/off (which I can see on the LED on the button panel.)

So have you ever verified that this signal pulses at all?

TBH I don't see why it would and the flashing LED is just a visual indicator that is better than just turning it off.

I can't picture what it controlling what here.

What does this wire with this 16v run between?


Rob

Rob,
OK what this wire is is the Garage Door Opener has two wires that run to the entrance door and connected to the button panel used to open/close, turn on/off the light and lock out the wireless remotes. The circuitry of the panel is quite simple as you expect. I has 3 buttons. one simply closes the circuit which triggers the garage door to open and close. The other two buttons have a capacitor each of different levels which when closed send I would expect a different voltage level to the unit which in turn interprets that and performs the action requested. The LED just connects to both wires + and - with a resistor.

So, I tested the voltage with my tester and found that it normally produces 16V. I also test it when the lockout was active (LED flashing) and the volts are all over the place which is what triggered me to assume there was a pulse to when it was active and solid HIGH (LED on not flashing) when inactive. This turned out to be a bad assumption because I followed your advice and tested the signal on a digital pin and there definitely is a pulse in all cases. I indicates a steady pulse that does not vary no matter what state the lockout is in. What makes no sense is the LED is either steady on or flashing on/off. The only source of power to the LED is the wires running from the unit.

What I am thinking of doing now is test the signal right at the LED and see what I am getting. I still assume I need to reduce the voltage because I am sure it is 16V at that point.

Just so you know why I am attempting this. For the door status I simply have magnet contact sensor switches at the closed position as well as at the fully open position to give me that status. I am trying to also be able to know the status of the lockout. Is it active or inactive? The reason for this is extra security so when we are away I can make sure the remotes are not active since we have issues with people breaking into cars and then using the remotes to open the garages.

The other two buttons have a capacitor each of different levels which when closed send I would expect a different voltage level to the unit

Capacitors can't really be used to give you a different voltage level, they could provide different ramp up/down times for the button press but that would be weird thing to do.

It sounds to me that they are using resistors to provide three levels on two wires. There would be a pullup resistor in the main box and X, Y and Z ohm resistors on the three buttons.

The LED just connects to both wires + and - with a resistor.

This I don't really get but maybe they reverse the polarity of the main box input to drive the LED.

I also test it when the lockout was active (LED flashing) and the volts are all over the place which is what triggered me to assume there was a pulse to when it was active and solid HIGH (LED on not flashing) when inactive.

A reasonable assumption.

This turned out to be a bad assumption

Or not.

If they are doing all this with only two wires there's something clever going on that will take a lot of deep thought (or a proper schematic) to figure out.

What I am thinking of doing now is test the signal right at the LED and see what I am getting. I still assume I need to reduce the voltage because I am sure it is 16V at that point.

If you just test across the LED the max voltage will be about 2v regardless of the 16v as LEDs have a fixed Vf more or less and the resistor takes up the rest. That may be the best thing to do.

I could maybe come up with a circuit to do as you say using resistors and reversing the polarity to flash the LED but I don't think that helps.

Four questions

a) What is the approx frequency of the LED flash?
b) Do you have to hold the buttons for a while before they register? IE at least one LED flash.
c) If you give the buttons a very quick press when the LED is off do they work?
d) Can you properly trace the circuit and produce a schematic?


Rob

Are you sure you don't have some diodes in that controller as well?

IIRC, my Liftmaster garage door opener (Craftsman is just a re-badged Chamberlain unit) has a diode on the lock button and another on the lights button. This allows the main unit to sense which half of the cycle is blocked by the diode and know which button you pressed.

-j

J, the button panel board is really simple to deconstruct. I have the schematic on paper. I will try and create it in a post here shortly.

Rob,
a) What is the approx frequency of the LED flash?
I will get an approximate rate on that.

b) Do you have to hold the buttons for a while before they register? IE at least one LED flash.
Yes, only on the lockout. The button for the open/close which has no capacitor triggers immediately. The light which has a capacitor triggers the light immediately. The button for the lockout has a capacitor of a different value as the light button requires depressing the button for about two seconds or more to activate.

c) If you give the buttons a very quick press when the LED is off do they work?
I will check to make absolutely sure the door and light do. The lockout, no it has to be pressed for an extended time.

d) Can you properly trace the circuit and produce a schematic?
I can type in the schematic of the button panel here shortly. The unit itself will take some time if I need to do that. I have a spare unit I can tinker with if I need to. I didn't expect this was as complicated to hack so never thought I would need to go there.

So I think I understood your comment on my plan to test at the LED may be fine since the voltage is low enough. I will test it before applying it to the micro pin.

FYI,,, the pulse of the wires was 11111111000000001111111100000000
using the code:
void loop() {
int sensorValue = digitalRead(2);
Serial.print(sensorValue);
}
Which I don't know the actual pulse rate since I don't know how fast the read loop is occurring. But in any case, this does not change based on the state of the lockout. It does as you would expect when you depress any of the buttons as the signal bypasses the voltage divider. It goes LOW while the button is depressed.

I may have the polarity wrong I don't have the board in front of me so going off memory
D1 is the LED
SW1 is the door open/close switch
SW2 is the light on/off
SW3 is the lockout

D1 R1___________
| |
| |
| /--------------SW1---------------------------\ |
| / \ |

  • ----------------------SW2-------C1------------------------- -
    \ /
    _SW3_____C2___/

As you can see, not much to the board.

test at the LED may be fine since the voltage is low enough.

Yes, the voltage across the LED should only be ~2v, that's not enough to drive a digital input HIGH though so you'll have to go back to the analog input.

Which I don't know the actual pulse rate since I don't know how fast the read loop is occurring.

Print the value of mills() every time the value changes from 1 to 0, even better remember the last mills() value and print the difference every time.

I can't figure out how it works from the schematic, but if measuring across the LED works maybe that's all you need.


Rob

Those caps indicate that there is AC afoot.


Rob

Thanks Rob. The forum went down while I was writing up my updates.

I reviewed the actual board and found I had an error in my schematic.

/--------SW1---------------------------
/
/-----------SW2----------C1----------------
/ \

  • -------------------------<R1 1.6K>----------------------------------- -
    \ /
    _SW3________C2____/
    \ /
    _D1_____/

I had the resistor in line with the LED.

I then did some testing of the voltage (DC) on the line
All switches open 14.23v
SW1 closed 14.5v
SW2 closed 14.0v
SW3 closed 14.0v

Based on my A/C test on the line it showed a voltage of 33V about double the DC reading. (with my limited knowledge I think any DC signal would show up as double if you select A/C on the multimeter correct?) The capacitors give smell of A/C based on your comments as well as what I have read on use of capacitors in A/C circuits.

I think I am going to open up the spare unit I have and see how it is wired up. The fact I can't see a correlation in the voltage while that LED is blinking (1second per cycle) makes no sense to me. A/C may explain it.

Rob, I think I have it figured out but look to your expertise. Before I was simply using two resistors of different resistance to divide the voltage to 4.2v from 16v. That worked as designed however, it didn't work for the purpose of sensing voltage change. I was getting a lot of noise. The signal bounced all over the place.

Based on the possibility that this line was A/C and not D/C I googled around and found this link:
http://openenergymonitor.org/emon/buildingblocks/measuring-voltage-with-an-acac-power-adapter

It is for monitoring A/C voltage. It basically is a voltage divider with additional capacitor and two resistors on the Arduino 5V line to reduce that voltage to 2.5v. I applied this to my circuit and bam. I am now getting a signal value that relates to the LED flash. I also took your advice and coded my monitor to say the value is HIGH when > 500 and LOW <= 500. If my assumptions and conclusions are correct, I can test the analog pin for HIGH (>500) for > 6 cycles. If it is, the lockout is active. If not, (it usually only has 2 cycles HIGH) then it is inactive.

Your comments are appreciated.

This is all a bit analog for me but looks clever.

So now you are getting pulses at some frequency that are in bursts of about 1/2 sec on/off. Like this ?

!!!!!!!!!!!!!!!_!!!!!

it usually only has 2 cycles HIGH

Why is it only > 500 for 2 samples? Is the frequency that fast? (or are you sampling that slow?)

What's you current code?

I'm having trouble working remotely and without any proper test equipment I have to say. This really needs a scope so we can see what's going on.

OTOH if you are getting reliable results maybe that's all we need for a one-off home job.


Confused

Agreed that a scope would be nice but lacking one I am doing a lot of trial and error.

I made some adjustments to get a status result that was 100% accurate. I had to increase the sampling and added a delay. I am sure I can reduce the delay to improve performance but I have what I needed for this particular project V1. As I learn more about circuit principles I am sure I can make improvements. But for now it works. Here is the simple code I used. I have not incorporated it into my overall door management code yet.

void loop() {
int No_High_States = 0;
for ( int x = 0; x < 12; x++) {

int sensorValue1 = analogRead(A0);

if (sensorValue1 > 500)
No_High_States = No_High_States++;
delay(50);
}
if (No_High_States > 4)
Serial.println ("Active ");
else
Serial.println ("Inactive ");

}

With the new enhanced divider circuitry, I eliminated most of the noise. What I found was there is always a pulse much like when manipulating a LED to blink slow or fast. When the LED is "solid" on, it actually has a fast pulse. When the LED is flashing, the pulse is about 1 second for a full on/off cycle.

I am sure there is a much simpler divider circuit I can use as it was designed for AC monitoring. I am using exactly the one in the diagram on the web page I listed previously.

All you need to monitor low-voltage AC is a diode (schottky would be best I think), that will half-wave rectify the signal and give you pulses which then have to be reduced to 5v.


Rob

I hope to learn more after hooking up an oscilloscope. My system is a Craftsman Residential 1/2 HP and appears to be sending 24V to the control panel. Based on the oscilloscope traces of the break-beam sensors showing state information encoded as pulses in the power line, I'm guessing similar tricks are happening at the control panel. A schematic would be straightforward to draw, there isn't much in the control panel.

Craftsman Residential 1/2 HP Garage Door Model #139.53985DM opener control PCB
R1 = 1.6 kΩ
C1 = 22 μF
C2 = 1 μF
White = 0V DC
Red = 24V DC (mostly)