Announcement

Collapse
No announcement yet.

Garage Door Control

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Garage Door Control

    Using information from previous topics regarding garage door position, I have finished converting my garage door position functions from X10 to Ocelot.

    I am now ready to quit controlling the closing of the garage door with X10 and to use Ocelot as well. And I am thinking of also opening the garage door as well since with the Ocelot I am no longer at a security risk as with X10 (<256 combos and you could have opened the door).

    Any suggestions?

    Jim Doolittle
    Jim Doolittle

    My Twitter
    My Hardware & Software

    #2
    Hi Jim,
    first I'd do is use an external relay to control the garage door. This way the small relay in the secu16 wont have any problems. thus if you blow up a relay its not going to take the unit out of service. I just run the external from the secu 16 for 2 seconds.
    Stuart

    Comment


      #3
      I have one of the output relays of an SECU-16 connected in parallel with my wall-mounted garage door opener switch. This works perfectly. Are you saying there is a chance of damaging my SECU-16 with this setup?

      Comment


        #4
        <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by DC:
        I have one of the output relays of an SECU-16 connected in parallel with my wall-mounted garage door opener switch. This works perfectly. Are you saying there is a chance of damaging my SECU-16 with this setup?<HR></BLOCKQUOTE>

        Hi,
        I had mine setup the same way. Then I had read somewhere about someone frying the contacts. I think they ended up fusing the contacts closed. But for whatever reason I felt that where I had so many extra relays I felt I would isolate the internal from any problems.

        Stuart

        Comment


          #5
          I guess if it were going to fry the contacts, it would most likely have already happened.

          Comment


            #6
            I am triggering my door with a PowerFlash module. However, I run that contact in series with a switch that is only closed when the door is fully open. If you are concerned about an errand X10 signal tripping your door to open, and you only want the ability to close your door, this is the way to go.

            Bill


            ~Bill

            Comment


              #7
              Bill,

              I have the same setup which is what I meant with moving away from X10 so I could open the door without creating a security risk.

              Since my setup is already working nearly flawlessly, I am not sure if I will migrate to Ocelot/Secu16 but I would like the added reliability of the Ocelot versus X10/powerline. Plus, I do have another use for the PowerFlash that would be in a more isolated location.

              Jim Doolittle
              Jim Doolittle

              My Twitter
              My Hardware & Software

              Comment


                #8
                William,

                Can you explain a little more about your setup? That sounds like exactly what I want to do.

                My plan would be to open my garage door with its own components and not with X10. X10 would not be able to open the garage door using the circuit you are describing (the most wiring experience I have is installing a car stereo!).

                Eventually, an alarm system will be added and a mag sensor added to the door. I would like for a sensor to see the garage door open and disarm the alarm.

                I would also like for X10 to be able to close the door.

                Comment


                  #9
                  Here's a little about how I'm controlling my garage door.

                  First off, I use two magnetic contacts, one to indicate the door is fully closed, one to indicate it is fully open. Across each contact (in parallel), I have placed two different resistors (can't remember the values, would have to look). I believe one is 470 ohm across one of the contacts, and the other around 200 ohms.

                  I then use a single input on my SECU16 connecting it to the magnetic contacts/resistors in series and use the SECU16 input in analog mode.

                  What this gives me is a reading from 0-255 that tells me the following:

                  1. If there is a SHORT in the wires (input reads &lt; 15 (ie: close to 0)). This will tell me something is wrong in the setup, and my program can act accordingly.

                  2. If there is an OPEN circuit (input reads &gt; 240) - ie: something else is wrong

                  3. If the door is FULLY OPEN (input between 163 and 177, normally 170) meaning one the open magnetic contact is closed and the one for the door closed is open.

                  4. If the door is FULLY CLOSED (input between 145 and 159, normally 152)

                  5. If the door is "IN BETWEEN" (input is between 177 and 188, normally 183). This means neither magnetic contact is closed (and no short or open circuit), thus the door must be partially open. I use this to decide that the door is either moving or stopped.

                  I then have code in the Ocelot (which I can post, though due to a bug in CMAX, copying code to a snippet file results in the Skip To statements pointing to the wrong lines... ugghhh) to handle all these.

                  Basically, it will look at the sensor value and past history (more later) and then set an Ocelot variable (which HomeSeer then can use) to determine the status of one of (I use Ocelot variables as constants so that in CMAX I can see what the value is rather than having to remember a number):

                  SHORT_CIRCUIT
                  OPEN_CIRCUIT
                  GD_POS_OPEN
                  GD_POS_CLOSED
                  GD_POS_MOVING
                  GD_POS_STOPPED

                  I also keep track of the 'last' direction of the garage door - ie: either UNKNOWN, GD_POS_CLOSED, or GD_POS_OPEN. This is used to determine, when the position is currently GD_POS_MOVING or GD_POS_STOPPED, which way the door is moving. This is important to know such that if the Ocelot presses the garage door button, it will know what will happen (ie: if door is moving and opening and it presses the button, it will stop and next press of the button will cause it to start closing).

                  The Ocelot sees the position as "stopped" if the door is in GD_POS_MOVING state for more than 15 seconds before changing to another state. (15 secs is arbitrary). This could be the case of someone hits the button while it is moving, or a few other cases).

                  With all of this, I'm then able to do the following:

                  1. Command the door to CLOSE and ensure it gets closed regardless of previous state (even in cases where the door is partially open and pressing the button once would cause it to open further, the program is smart enough to figure this out and ensure it gets closed)

                  2. Command the door to OPEN and ensure its open as above.

                  3. Show accurate status on what is going on (as best as can be).

                  Works very well. And it only uses up one SECU16 input, and one output (for the button).

                  I can try to post the code if anyone is interested.

                  All this code is in CMAX, not HomeSeer. Reason is that if I takedown HomeSeer (or if power goes out and my UPS dies) the Ocelot still knows the state of things (it is backed up on its own UPS which can run it for weeks). Also, I think this logic is simply more reliable being in the controller.

                  HomeSeer is then used to take the high level status to put on the webpage, etc. And let me command the door without having to worry about all the intricate details.

                  This also lets me have my HAI OPII control the door by running a 'button' tells the Ocelot (through serial port - could be done via X10 though) to close or open the door to the Ocelot which ensures it happens (ie: from the HAI phone interface).

                  I also control my irrigation directly in CMAX (also with the same SECU16 and external relays), but allow HomeSeer to override its setting, change time, etc.

                  Below is the code I use to control this (notice the skip in line numbers, have removed the rest of my Ocelot code as it is irrelevant here):

                  <pre class="ip-ubbcode-code-pre">
                  0001 - // *** Ocelot - Master ***
                  0002 - IF Program-Version is = 0 // Initialize......
                  0003 - THEN Program-Version = 40508 // 05/08/2004
                  0004 - THEN UNKNOWN = 65535 // *** Set General Constants ***
                  0005 - THEN TRUE = 1 //
                  0006 - THEN FALSE = 2 //
                  0007 - THEN SEC_OFF = 0 // *** Set Security Constants ***
                  0008 - THEN SEC_DAY = 1 //
                  0009 - THEN SEC_NIGHT = 2 //
                  0010 - THEN SEC_AWAY = 3 //
                  0011 - THEN SEC_VACATION = 4 //
                  0012 - THEN SEC_DAY_INSTANT = 5 //
                  0013 - THEN SEC_NIGHT_DELAY = 6 //
                  0014 - THEN SHORT_CIRCUIT = 1 // *** Set Garage Door Constants ***
                  0015 - THEN OPEN_CIRCUIT = 2 //
                  0016 - THEN GD_POS_CLOSED = 3 //
                  0017 - THEN GD_POS_OPEN = 4 //
                  0018 - THEN GD_POS_MOVING = 5 //
                  0019 - THEN GD_POS_STOPPED = 6 //
                  0020 - THEN GD_DIR_OPENING = 1 //
                  0021 - THEN GD_DIR_CLOSING = 2 //
                  0022 - THEN GD_CMD_OPEN = 1 //
                  0023 - THEN GD_CMD_CLOSE = 2 //
                  0024 - THEN GD_CMD_STOP = 3 //

                  0057 - IF Command-Request becomes NOT = UNKNOWN // *** Get the command from the serial port...
                  0058 - THEN Current-Command = Command-Request //
                  0059 - THEN Command-Request = UNKNOWN //
                  0060 -
                  //
                  0083 - IF GD-Last-Position is NOT = GD-Current-Position // Figure out last position from previous loop
                  0084 - THEN GD-Last-Position = GD-Current-Position //
                  0085 - // Possibly do not want to do on every pass...
                  0086 - IF Module #3 -SECU16 Garage-Door-Status-(A7) is NOT = 0 // Read analog value into a variable.
                  0087 - THEN Load Data to: GD-Sensor-Value //
                  0088 - ELSE Load Data to: GD-Sensor-Value //
                  0089 - //
                  0090 - //
                  0091 - IF GD-Sensor-Value is &lt; 15 // Short Circuit
                  0092 - THEN GD-Current-Position = SHORT_CIRCUIT //
                  0093 - THEN Skip to line 120 //
                  0094 - //
                  0095 - IF GD-Sensor-Value is &gt; 240 // Open Circuit
                  0096 - THEN GD-Current-Position = OPEN_CIRCUIT //
                  0097 - THEN Skip to line 120 //
                  0098 - //
                  0099 - IF GD-Sensor-Value is &gt; 145 // Closed
                  0100 - AND GD-Sensor-Value is &lt; 159 //
                  0101 - THEN GD-Current-Position = GD_POS_CLOSED //
                  0102 - THEN Skip to line 120 //
                  0103 - //
                  0104 - IF GD-Sensor-Value is &gt; 163 // Open Fully
                  0105 - AND GD-Sensor-Value is &lt; 177 //
                  0106 - THEN GD-Current-Position = GD_POS_OPEN //
                  0107 - THEN Skip to line 120 //
                  0108 - //
                  0109 - IF GD-Sensor-Value is &gt; 177 // Moving (For Now Only)
                  0110 - AND GD-Sensor-Value is &lt; 188 //
                  0111 - AND GD-Current-Position is NOT = GD_POS_STOPPED // Only change to MOVING if not already STOPPED
                  0112 - THEN GD-Current-Position = GD_POS_MOVING // Set to MOVING
                  0113 - THEN Skip to line 120 //
                  0114 - //
                  0115 - IF GD-Current-Position is NOT = UNKNOWN // If we got here, then we need to make
                  0116 - THEN GD-Current-Position = UNKNOWN // sure position is set to UNKNOWN
                  0117 - THEN Skip to line 120 // Goto STAGE 2
                  0118 - //
                  0119 - // ** GD STAGE 2 **
                  0120 - IF GD-Current-Position becomes NOT = GD_POS_MOVING // If GD stops moving
                  0121 - THEN GD-Moving-Timer = 0 // Reset timer.
                  0122 - //
                  0123 - IF GD-Current-Position becomes = GD_POS_MOVING // If door starts moving
                  0124 - THEN GD-Moving-Timer = 1 // Only do it if we just STARTED moving...
                  0125 - ELSE Skip to line 150 // Goto STAGE 3
                  0126 - // ** Now we know the door IS MOVING ***
                  0127 - IF GD-Last-Position is = GD_POS_OPEN // * Moving but last OPEN
                  0128 - THEN GD-Last-Direction = GD_DIR_CLOSING // Direction now is closing
                  0129 - THEN Skip to line 150 // Goto STAGE 3
                  0130 - //
                  0131 - IF GD-Current-Position is = GD_POS_STOPPED // If stopped, don't update last direction
                  0132 - THEN Skip to line 150 //
                  0133 - //
                  0134 - IF GD-Last-Position is = GD_POS_CLOSED // * Moving but last CLOSED
                  0135 - THEN GD-Last-Direction = GD_DIR_OPENING // Direction is now opening
                  0136 - THEN Skip to line 150 // Goto STAGE 3
                  0137 - //
                  0138 - IF GD-Last-Direction is = GD_DIR_CLOSING // Toggle last direction
                  0139 - THEN GD-Last-Direction = GD_DIR_OPENING //
                  0140 - THEN Skip to line 150 // Goto STAGE 3
                  0141 - //
                  0142 - IF GD-Last-Direction is = GD_DIR_OPENING //
                  0143 - THEN GD-Last-Direction = GD_DIR_CLOSING // Toggle last direction
                  0144 - THEN Skip to line 150 // Goto STAGE 3
                  0145 - //
                  0146 - IF GD-Last-Direction is NOT = UNKNOWN // Since we're here, we don't know what last direction was
                  0147 - THEN GD-Last-Direction = UNKNOWN // So set it to UNKNOWN (should never get here)
                  0148 - //
                  0149 - // ** GD STAGE 3 ** - Check for STOPPED
                  0150 - IF GD-Current-Position is = GD_POS_MOVING // If door is MOVING
                  0151 - AND GD-Moving-Timer is &gt; 15 // And it has taken over 15 seconds
                  0152 - THEN GD-Current-Position = GD_POS_STOPPED // Assume door is really stopped
                  0153 - THEN GD-Moving-Timer = 0 // Don't track how long
                  0154 - //
                  0155 - // ** GD STAGE 4 ** - COMMANDS
                  0156 - IF Current-Command is = UNKNOWN // If no command then skip
                  0157 - THEN Skip to line 228 // Goto STAGE 5
                  0158 - //
                  0159 - // * Check CLOSE
                  0160 - IF Current-Command is NOT = GD_CMD_CLOSE // If not CLOSE
                  0161 - THEN Skip to line 189 // GOTO Check OPEN
                  0162 - // * Command is CLOSE if here
                  0163 - IF GD-Current-Position is = GD_POS_OPEN // If OPEN
                  0164 - AND GD-Button-Timer is = 0 // and button NOT pressed
                  0165 - THEN GD-Button-Timer = 1 // Press Button
                  0166 - THEN Module #3 -SECU16 Garage-Door-Button-(R12) Turn ON //
                  0167 - THEN Skip to line 228 // Goto STAGE 5
                  0168 - //
                  0169 - IF GD-Current-Position is = GD_POS_CLOSED // If CLOSED
                  0170 - THEN Module #3 -SECU16 Garage-Door-Button-(R12) Turn OFF // Ensure button is NOT pressed
                  0171 - THEN GD-Button-Timer = 0 // Reset timer, no button pressed
                  0172 - THEN Skip to line 228 // Goto STAGE 5
                  0173 - //
                  0174 - IF GD-Current-Position is = GD_POS_MOVING // If MOVING
                  0175 - AND GD-Last-Direction is = GD_DIR_OPENING // and direction is OPENING
                  0176 - AND GD-Button-Timer is = 0 // We need to stop it...
                  0177 - THEN GD-Button-Timer = 1 // Press the button
                  0178 - THEN Module #3 -SECU16 Garage-Door-Button-(R12) Turn ON //
                  0179 - THEN GD-Current-Position = GD_POS_STOPPED // We should have stopped it now...
                  0180 - THEN Skip to line 228 //
                  0181 - //
                  0182 - IF GD-Current-Position is = GD_POS_STOPPED // If STOPPED
                  0183 - AND GD-Button-Timer is = 0 // And button is not pressed
                  0184 - THEN GD-Button-Timer = 1 //
                  0185 - THEN Module #3 -SECU16 Garage-Door-Button-(R12) Turn ON //
                  0186 - THEN Skip to line 228 //
                  0187 - //
                  0188 - // * Check Open
                  0189 - IF Current-Command is NOT = GD_CMD_OPEN // If not OPEN
                  0190 - THEN Skip to line 218 // Goto Check Stop
                  0191 - //
                  0192 - IF GD-Current-Position is = GD_POS_CLOSED // If CLOSED
                  0193 - AND GD-Button-Timer is = 0 // and button not pressed
                  0194 - THEN GD-Button-Timer = 1 // Press Button
                  0195 - THEN Module #3 -SECU16 Garage-Door-Button-(R12) Turn ON //
                  0196 - THEN Skip to line 228 // Goto STAGE 5
                  0197 - //
                  0198 - IF GD-Current-Position is = GD_POS_OPEN // If OPEN
                  0199 - THEN Module #3 -SECU16 Garage-Door-Button-(R12) Turn OFF // Ensure button is NOT pressed.
                  0200 - THEN GD-Button-Timer = 0 // Press Button
                  0201 - THEN Skip to line 228 // Goto STAGE 5
                  0202 - //
                  0203 - IF GD-Current-Position is = GD_POS_MOVING // If MOVING
                  0204 - AND GD-Last-Direction is = GD_DIR_CLOSING // and direction is CLOSING
                  0205 - AND GD-Button-Timer is = 0 // We need to stop it...
                  0206 - THEN GD-Button-Timer = 1 // Press the button
                  0207 - THEN Module #3 -SECU16 Garage-Door-Button-(R12) Turn ON //
                  0208 - THEN GD-Current-Position = GD_POS_STOPPED // We should have stopped it now...
                  0209 - THEN Skip to line 228 // Go to STAGE 5
                  0210 - //
                  0211 - IF GD-Current-Position is = GD_POS_STOPPED // If STOPPED
                  0212 - AND GD-Button-Timer is = 0 // And button is not pressed
                  0213 - THEN GD-Button-Timer = 1 // Press Button
                  0214 - THEN Module #3 -SECU16 Garage-Door-Button-(R12) Turn ON //
                  0215 - THEN Skip to line 228 // Goto STAGE 5
                  0216 - //
                  0217 - // * Check STOP
                  0218 - IF Current-Command is NOT = GD_CMD_STOP // If command not STOP
                  0219 - THEN Skip to line 228 // Goto Check Invalid Command
                  0220 - //
                  0221 - IF GD-Current-Position is = GD_POS_MOVING // If MOVING (and ONLY if MOVING)
                  0222 - THEN GD-Button-Timer = 1 //
                  0223 - THEN Module #3 -SECU16 Garage-Door-Button-(R12) Turn ON // Press Button
                  0224 - THEN GD-Current-Position = GD_POS_STOPPED // Set it to STOPPED
                  0225 - THEN Skip to line 228 // * Invalid command
                  0226 - //
                  0227 - // ** GD STAGE 5 - Cleanup GD Button
                  0228 - IF GD-Button-Timer is &gt; 5 // If button down for 5 secs
                  0229 - THEN Module #3 -SECU16 Garage-Door-Button-(R12) Turn OFF // Let go of button
                  0230 - //
                  0231 - IF GD-Button-Timer is &gt; 8 // Wait a few more seconds before we allow button to be pressed again
                  0232 - THEN GD-Button-Timer = 0 // Reset the timer
                  0233 - // **** END OF GARAGE DOOR CODE ***
                  0234 - //
                  0235 - // *** Actions based on garage door
                  0236 - IF GD-Current-Position becomes NOT = GD_POS_OPEN // If Garage door opens
                  0237 - AND Is-Daytime? is NOT = TRUE // and it is night
                  0238 - THEN Back-Floodlight-(O4), Turn ON // Turn on back lights
                  0239 - THEN Back-Porch-Light-(O3), Turn ON // NOTE: This will OVERRIDE the motion
                  0240 - THEN tOutsideLightOffTimer2 = 1 // sensor, thus it will do for ANOTHER 10 mins
                  0241 - //

                  0268 - //
                  0269 - IF GD-Current-Position becomes NOT = GD-Last-Position // Update garage door info
                  0270 - THEN Module #1 -Slave Leopard GD-Current-Position-(M) to: GD-Current-Position // Send to Leopard
                  0271 - THEN Module #1 -Slave Leopard GD-Last-Position-(M) to: GD-Last-Position //
                  0272 - THEN Module #1 -Slave Leopard GD-Last-Direction-(M) to: GD-Last-Direction //
                  0273 - THEN Module #1 -Slave Leopard GD-Sensor-Value-(M) to: GD-Sensor-Value //
                  0274 - // *** IRRIGATION ***

                  0390 - End Program //
                  </pre>

                  Comment


                    #10
                    I am moving into a new house and am wondering what is a good brand of garage door opener that is "Home Automation" friendly. I will probably get an Ocelot soon and like the idea posted here for Ocelot control of the Garage Door to open/close it. Just wondering what brand everyone uses to allow easy SECU-16 relay control. Thanks

                    Comment


                      #11
                      The code I posted will work for virtually any garage door out there. Mine is a 14 year old Genie opener. Nothing fancy.

                      A lot of the logic in the code is to deal with making sure that I can tell the door to close and have it actually do so. Most openers, upon pressing the GD button, simply reverse the motor (or stop it if it is already moving). Thus, the need for the additional logic to know what happened in the past.

                      In an ideal world (for automation purposes), you'd have a garage door that had basically two buttons, one to automatically close, and one to automatically open. That would greatly simplify this code. However, I know of no such critter out there...

                      BTW - you could implement similar logic to what I have done here using HomeSeer scripting instead of CMAX, though I would recommend leaving it in CMAX for a variety of reasons - latency, etc. If you DID want to implement the logic in HomeSeer instead, you'd still need to have some code in CMAX, that to take the analog value from the SECU16 and store it in a variable, as I don't think HomeSeer has access to analog values (which this method requires) of an SECU, just the digital ON/OFF interpretation.

                      If you wish not to use analog values, you could do so by hooking the two magnetic contacts into two SECU16 inputs (which would speed up the code), but you'd also loose the ability to detect short or open circuits on your cabling.

                      Comment


                        #12
                        My system uses the limit switches inside the garage door opener to determine open or closed, and the order in which things happen sets a variable which tells my programs whether the door is opening or closing. It required a bit of hacking, as my design uses an opto-isolator circuit to check whether there is any voltage across the limit switches. (If there is no voltage, then the switch is closed).

                        I concur on using an external relay to open and close the door. My Chamberlain opener uses an AC control circuit, and it will and did eventually arc weld one of my SECU16 relays. I beat on the relay a few times with the end of a screwdriver and it released and began working again, but after that, I used an ELK 912a relay board to do the dirty work.

                        Comment


                          #13
                          Regarding the SECU16 relays getting frozen.

                          I had this happen a few times. Even when using an ELK relay board off the SECU16 relay (ie: supply 12v DC to SECU16 relay, when it goes on, it powers the ELK relay which controls my 24v AC irrigation valves). The ELK relays are supposed to have protection for this, but it still managed to fry the SECU16 relay. What I did was put a diode across the ELK relay COM and + for the coil. This (in addition to the diode in the ELK board) totally eliminated any problems. I have been running 4 zones of irrigation like this for about 3 months this year and about 3 months at the end of last summer, coming on and off twice per day, with no problems now...

                          In addition, wanted you to know that in the event you fry one of the SECU16 relays, you can purchase exact replacements from www.digikey.com. Takes about 5 minutes to take the SECU apart and replace a relay. Have replaced about 5 of these and not have a problem since (4 due to the previous irrigation issue, one due to a home grown "serial port switch" that did not have adequate protection initially).

                          Also, on digikey you can probably also find other relays that will work (from the same compnay) that provide the diode internally to the relay, as well as additional ones that handle a bit higher current (though not much). There were 3 or 4 types that would appear to be able to be used as direct replacements for the SECU, though I haven't tried them, just went with the exact matches. The standard relays were around $1.50 I believe each.

                          Comment

                          Working...
                          X