hooking up my SECU16 to my Ocelot

BSR:

The only problem with that is that the switches only close when the magnet is close. If the door is between switches, you won't know where it is.

However, if you have a program that is tracking it and remembers the last switch that was closed, then you know the position within the resolution of the switches.

Only one resistor will be removed at a time. So you will need to come up with a pattern of resistor values that will give you a reasonable range of voltages. All resistors in-circuit will produce a minimum (or maximum) voltage indicating that the door is between switches.
 
"John Warner's garage doors" was an ongoing project at one point! It all started when he wanted to determine if a door was either open, closed, or in-between somewhere. Then he mentioned that he wanted to do this on two garage doors, but he didn't have enough SECU16 inputs left. What ensued was a discussion started by myself about how he could use a single input in analog mode to do all that, plus determine if there was a wiring fault (short or open) between the SECU16 and the garage.

The idea is to use four magnetic sensors, two per door. One to determine that the door is closed and another to sense that it is opened. Each switch has a different value resistor, arranged in an exponentially rising range of values so that all possible combinations produce a unique total resistance value. This is then wired to the input jumpered as a supervised input, so that the external resistance would form a voltage divider with the internal pullup to +5v. Interpreting the input as an analog value then gives you the state of the garage doors.

We had lots of fun fine tuning this project. You can find more information on it here, including a spreadsheet for calculating the analog values for various reistors:

http://www.appdigsupport.com/cgi-bin/ultim...ic;f=6;t=000010
 
Looks like we all posted in the same 5 minutes...

My last post essentially describes what BSR is hinting at. Yes, it is a viable approach but will not give you a real analog posisiton indicator. Smee's idea about using a software pulse counter might actually be usable on something as slow as a garage door. The SECU16's latch logic and the adnet bus speed means that you can detect and count a off to on input transition about once every two seconds reliably. If it takes 15 seonds to close the garage door, then you could have about 7 or 8 discrete steps that you could count to have an approximate idea of its position. As was pointed out, it would be best to have a seperate input that determines the absolute "closed" position to reset the count every time and eliminate any cumulative errors.
 
So I install 2 NO contacts (I have 1 NO, I think, installed right now), what kind (and how many) resistors do I need, I am going to be very close to RadioShack in 30 minutes, so this would be the perfect time to pick up whatever I need so I can work on it this weekend (too much snow, so I don't want to drive 40 minutes to the nearest RS). I looked at the spreadsheet, but it only made half sense to me as I am still learning all this stuff.

Btw, smee, I like your ideas (and might try some, as I have plenty of cuecats), but I want to get away from using the PC to monitor the garage door for reliability reasons. I do appreciate your input (sorry, I just had to :lol:)
 
electron said:
Btw, smee, I like your ideas (and might try some, as I have plenty of cuecats), but I want to get away from using the PC to monitor the garage door for reliability reasons.
I'm not going to push it as being the best approach, but it shouldn't be difficult at all to connect a small processor to the CueCat and have it monitor the data. It could do all the processing and present the data on demand or have its own UI.

There doesn't need to be a PC in the loop at all. That's just the easy, free way (assuming you have a PC sitting around and especially assuming you have one of the free CueCats from RS).
 
How far is the door moving? How many feet of clearance is there from the bottom of your garage to the highest point of clearance. I might have an idea for you but i need to work out the math first.
 
Squintz: whatever height a standard garage door is, I can check when I get home.

Guy, that spreadsheet shows 3 cases for my SECU16 (not the I version), does it matter which case? You mentioned I could just use 2 1k's, would I still get the same benefits (knowing when the door is open, closed and ajar) ? Thanks!

edit: looks like I want 3 resistors after checking the spreadsheet again, just wondering about what case# is the best choice, unless that doesn't matter. Also, is there a reason not to use this method (and stick with one input per sensor), I am thinking about using this method to figure out if a window/door is locked/unlocked/opened/closed at the same time, using 1 input again, instead of just reporting when a window opens/closes. Bad idea?
 
I use 2 NO magnetic switches and 2 inputs on my SECU16. I then use scripts to monitor opening and closing. They just use simple time calculations on the last change field. This way I can tell if the garage door is stuck opening, or closing. Then I can have HS complete the transaction, sometimes it takes two presses to get the door to it's desired open or closed position. This is due to the door reversing.

This has worked flawlessly for ~1 year now... HS will close the door if I leave it open after logging out, it will remind me if I leave it open at night and then close it, it will monitor and tell me if it is stuck, and if stuck opening it will open it. If stuck closing and I am home it will let me check it manually, as I don't want HS bashing one of my kids toys to death.
 
that's how I was going to do it, but this would save me an input, I can use it for another project, and it also would allow me to figure out i.e. if a door/window was opened the normal way or if the glass was broken (using a glass break detector and magnetic reed switch).

Would someone be so kind to post which radioshack resistor I need, I see several ones listed, all with different specifications, so any help would be appreciated :lol:
 
Electron, the "3 cases" are just a way of trying or comparing 3 sets of resistor values and seeing them side by side. The spreadsheet was initially made by John Warner and he wanted to make it really fancy. I then added the text explanations on the right under the schemetic and a few other things.

If you scroll down the spreadsheet, you will also see a second section for the SECU16I. Its readings will be a bit different because of the added resistance of the mux chip, as explained on the right hand side.

The tradeoff in using this method over one input per switch is that this uses analog mode, so its a bit slower because the controller is periodically reading the analog value from the input and a short (less then 1 second) switch activation could be missed. It is best used to get current status for a timed macro or visual status display. With one input per switch, you get the latching action of the SECU16/16I supervised inputs so a very short closure will always get detected. This is best used for pushbuttons, doorbells, etc.
 
Guy Lavoie said:
For the RS resistors, just get the regular 1/4 watt ones. They're usually in packages of 5 if I'm not mistaken.
Something like this: Radio Shack 1K ohm 1/4 watt resistors. 5 for $0.99.

I remember when these were $0.19 for 5.

Guy:

How sensitive is the A/D on the Ocelot/SECU16? When you set up the program to look at the analog input, do you need to worry about ranges of values (for each switch)? If the resistors are going in the garage (near the switches), the resistances may vary (slightly) throughout the year (considering electron's arctic climate). If the resistors are inside somewhere (with a lot more wires running to the garage), this probably wouldn't be a problem.
 
The A/D inputs of the SECU16/16I have 8 bit resolution (256 steps) over a 0 to +5v range. They are actually built into the PIC chip. Yes, the resistors will vary a bit but if you use the same type of resistor and they're all together in the warm or cold air, then their temperature coefficients will likely all drift together, except for the 1k pullup which is inside the module. Still, with about 20 steps of resoltion between each possible condition, it is easy to write the C-Max code to be quite tolerant by accepting a range of values that are about 10 steps above or below the nominal value.
 
would you recommend against using these resistors for alarm purposes (monitoring doors and windows mainly), and stick with the supervised inputs?
 
Back
Top