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.
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)