Occupancy detection

You leave your dog in a crate?

Reply to
Robert L Bass
Loading thread data ...

A cave? I'm afraid I don't get it. I'm not sure how my reluctance to use old technology more suitable to stand-alone industrial process control than home automation makes me a trogdolyte. Learning to work with a current microcontroller would give me options like robotics that the Ocelot will never be able to handle.

The primary problem is that I am not an industry. I should have been more specific. Ladder logic appears to be done as far as home automation programming is concerned, *especially* mine . If I ever begin manufacturing operations in my house, I may come to regret eschewing ADI, CMAX and ladder logic programming. But I doubt it. The simple truth is that the payback for learning to program in ladder logic on the Ocelot just isn't worth it for me.

Good golly, Miss Molly, where did I EVER say robot hobbyists would, should or could use an Ocelot? Of course that's ridiculous. The Ocelot is old technology and totally unsuitable for that sort of application. However, a modern micro-controller can solve both my stair light problem and provide substantial future benefits like robotic control. The "ridiculous" thing would seem to be deciding to learn how to program microcontrollers, and then choosing one as old and limited as Ocelot's. Learning any one of the numerous newer hobbyist microcontrollers that use a structured language has far more value to me than struggling with very long-in-the-tooth CMAX and ladder logic.

The stairway lights are critical, therefore I have no real desire to revisit CMAX. The lack of CASE structures, local vars and the unusual evaluation of conditionals makes for very nasty spaghetti code that reminds me of the famous statue with all the snakes:

formatting link
I tracked the ADI forum for about a year and CMAX seems to consistently provide unexpected results for neophyte CMAX coders like me. It's great for people who learned on ladder logic or who love programming PICs or in assembler. It's not so great for people like me who can program, but don't have a feel for CMAX's structural oddities. It's totally unsuitable for rank newbies with little coding experience.

Let me make it perfectly clear I have nothing but respect and appreciation for all the CMAX users out there. The last time I took a run at CMAX the ADI forum people and folks here were *extremely* helpful, providing code, samples, hints, serious debugging help and more. But if the concepts don't click, all the help in the world isn't going matter. If my ability to earn a living depended on it, I would slog through learning CMAX the way I slogged through coding Newton's approximation method for solving quadratic equations in PL-1, Fortran, COBOL (yes - it was a comparative language course!) and PASCAL in college. But those days are long, long gone and this is just a hobby. I'd rather investigate the newer microcontroller offerings that use something other than ladder logic. I'll probably end up putting the CPU-XA in service as a broadcast storm detector because that's a pretty trivial problem and if it fails, no one fails down the stairs in the dark.

Here's an excerpt from a ladder logic tutorial:

formatting link
(NOT CMAX, but of the same basic design) that might help to explain my lack of enthusiasm for LL:

"Kind of IF THEN" sums up my feelings for ladder logic. It's "Kind of" of programming language. Kind of. Energize THIS, ladder logic! --|#%$$!!!!|-- and then stuff it in your output coil.

< g > (And apologies to those that love ladder logic, it's just not my cuppa tea.)

Now let's return to analyzing just what sensors and other components are required to build an ultra-fast and ultra-reliable stair light control system that will still respond to X-10 commands if safety conditions permit.

-- Bobby G.

Reply to
Robert Green

All it takes is once to cause serious problems. The "ALL OFF" scenario is just once facet of the problem. As you well know the X-10 protocol is vulnerable to a number of problems related to speed, collisions and the one-way nature of the sensors. What's more likely is that a command gets dropped, stepped on or otherwise garbled and the light never comes on. Non permisso! I want the stairway light to come on as soon as someone crosses through the door frame and stay on until they are well off the stairs. I also want the light to respond to ALL OFF when safe to do so.

Sadly "any" doesn't apply to the Hawkeyes. To maximize battery life they're stingy on instant retries. Try this test with a stopwatch. See how many steps you can cover when moving at a good clip (imagine a family member in distress!) in two seconds. Stairwells are mission-critical areas where an error can cause a bad outcome up to and including death. The Hawkeyes certainly won't reset fast enough to prevent disaster although I imagine hardwired, A/C powered detectors will since they don't have to worry about conserving battery life. I'd like the system to respond to X-10 commands, but not be controlled by them. It should also not respond to X-10 if that would create a safety hazard.

I disagree. It will take a number of components including X-10 Powerflash and Universal modules as well as latchable relays and timers, but I think it can be accomplished without adding a PC and all the unreliability that entails. If a small set of condition equals true, then accept the X-10 command, if not, ignore (or queue) the command until the proper conditions exist (i.e. stairway empty). Remember, the switch that controls the light will not be an X-10 unit, but a hard-wired, relay controlled unit that responds only to low voltage contact closures. Those contact closures would have X-10 commands as potential input, but would primarily respond to the sensors determining someone had crossed the threshold of the stairway.

individually.

And that's precisely why you'd need the system I described - a hardwire control of that particular light that can accept X-10 commands if the conditions are right. It's a question of downsides. If the system "guesses" wrong, the worst that SHOULD happen is that the light stays on and I contribute more to global warming than I'd like. Right now, the worst that can happen is that the light goes out in mid-stride and someone loses their footing as a result. From a quick scan on Google I found that an estimated 2.5 million injuries, and a further 4000 deaths in the UK in 1995 were due to home accidents. About 230,000 of these injuries and 497 deaths resulted from falls on stairs. I'd guess the numbers for the US are equal or higher, per capita.

I agree completely with all of that which is why I believe the stairway lights cannot be connected directly to an X10 switch but need to connected to a hardwired relay switch like the GE low voltage units. The switch could be then be connected to the X-10 network via a powerflash module or a PC without inducing serious latency problems.

I'm looking to biology for design ideas. When you touch something hot, you pull away without really thinking about it. Cognitive control, a la Gordon Liddy willing himself to burn a hole in his arm, comes in at a different level, overriding the local "reflex" response only after serious signal processing occurs.

In this case, when an X-10 OFF command is received, all that happens is that a latched relay line is activated. No light gets turned off. That only happens if the sensor input determines that no one is on the stairs. That's the critical function here. The system is designed with "Fail Safe" principles in mind. (Raise your hand if you've seen either version of the movie or read the book.) In this case, that means the light only gets shut off if there's a certainty (more than two sensors "concur" - maybe even three) that the stairs are unoccupied. That's basically how grocery store doors work. They won't close unless the sonar, pressure mat and IR beam all indicate no one in the way. Still, little old ladies get knocked down all the time so even that's not perfect. If a single Hawkeye controlled the average supermarket door, the courthouse would overflow with people who had been batted by the door closing at the wrong time. (-:

(!!!! [light bulb lights over my head]!!!!) One of the reasons I find these discussions useful is that sometimes odd things click in just the right way. Dave's comments about industrial controllers got me thinking about commercial building stairwells and how they're set up. Up until this minute I didn't realize that part of my fail safe solution has to include battery-powered emergency lamps of the type found in every high rise. A power failure on the stairs is a far more likely event than an errant ALL LIGHTS OFF and I hadn't even thought of it until now. With a little rewiring, I am sure I can interface my system to the emergency lights so that if the 110VAC light did go out while the stairs were "loaded" then the emergency lights would fire. This would protect against a bulb popping as you started down the stairs.

That's a good idea but I'd feel a lot more sanguine about the system if the premise was "don't turn off the lights for any reason unless the system is certain the stairs are empty." The scenario you suggest would certainly work, but there are a lot of potential failure points. Since I fell down the stairs I have a better appreciation of why I wouldn't want to use a crash-prone PC to keep me from crashing into the basement floor. (-: I'm going to try to find some wiring diagrams for commercial door closers to see if they use a microcontroller or a simple circuit board with TTL components.

Well, I agree. If the cost in time, effort and materials is greater than running a CFL 24x7 for 10 years, it's probably not worth doing. But I believe it's going to turn out to be something that I can hack together with TTL components. I'll have to work out the requirements precisely so I can decide whether I should go simple TTL or more complex microcontroller or just restore the manual 3 way switches to the circuit. Since I've already fallen, I don't want to fall again so as unlikely the scenario may seem, I want to design a system that can accommodate all of the failure modes I can identify. In this message alone I've identified two more conditions: building power failure and bulb burnout.

-- Bobby G.

Reply to
Robert Green

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.