Occupancy detection

Have a question or want to start a discussion? Post it! No Registration Necessary.  Now with pictures!

Threaded View
I came across the following article recently and began to wonder about the
current state of occupancy detection.  Even X-10 at its smartest is pretty
dumb when it comes to turning out lights that you're not really using and
conversely NOT turning out lights that your ARE using (i.e. longer than
average bathroom stays.)   The article got me to thinking about how dogs do
"occupancy detection" and where AI could play an important part of light
control, conservation and "wellness detection" for want of a better term.


Can Motion Sensors Predict Dementia?
June 18, 2007 - 4:15pm

AP Medical Writer

WASHINGTON (AP) - Tiny motion sensors are attached to the walls, doorways
and even the refrigerator of Elaine Bloomquist's home, tracking the
seemingly healthy 86-year-old's daily activity . . . to see if
round-the-clock tracking of
elderly people's movements can provide early clues of impending Alzheimer's
disease. . . . The theory is that as Alzheimer's begins destroying brain
signals to nerves may become inconsistent _ like static on a radio _ well
before memories become irretrievable. One day, signals to walk fire fine.
The next, those signals are fuzzy and people hesitate, creating wildly
varying activity patterns.


I recently took a tumble down a stairway controlled by an X-10 Hawkeye
(OUCH!).  As a result, I've come to the conclusion that X-10's motion
detectors, while useful in some situations and for some people, are not
making the cut when it comes to my house.  Ironically, the fall occurred
because I was moving very quickly and did not trigger the Hawkeye, which,
until I fell, had never failed to turn on that particular light reliably.
It's a lot to ask of an HA system to be able to record and analyze speed of
travel and travel patterns within a house, but that article made me think we
might finally be there, equipment and software-wise.   The dog sure knew I
was heading down the stairs at a fast clip, but the HA system did not.  It
could have known, though.

Part of the problem with X-10 RF is wire lathing in all the walls blocking
radio reception.  But I suspect another part of the problem is the growing
saturation of the RF band used by the HawkEye/EagleEyes.  I tested reception
in my house five years ago and where I was reaching 15' between test points
in the past, I now only reach 10'.  While I'm aware there could be a number
of possible causes, the bottom line is that RF-based motion detector signal
propagation is not reliable, particularly in dangerous areas like dark

I've decided instead to investigate the feasibility of using multiple
sensors, and incorporating IR light beams across doorway openings to
positively detect when someone has entered or exited a room.  I've had some
success with pressure mats under carpeted areas, but the places that most
need automatic light control have concrete, tile or wood floors.  If the
sensors and light sources are small enough, I could embed them in the door
trim pretty easily.

I've come across an interesting candidate at:


and the price per doorway seems to be right but I have a few concerns.  The
first is whether I can mount the diodes and detectors remotely on a 10'
length of wire without affecting circuit values adversely.  The second, more
important question is whether putting IR emitters in all the doorways is
going to cause more problems for the Powermid and other IR communication
devices.  The third is whether I can run all the kits from a master power
supply without interaction issues.

The second half of this equation is what sort of controller is best suited
to handling the demands of multiple-sensor, very high reliability occupancy
detection?  We've discussed this here before, but with WiFi-enabled cell
phones and other new, miniaturized wireless devices becoming available, it
may finally be possible to tell where every member of the household is, 24
by 7.  While it sounds intrusive, think about how much greater the degree of
control there would be over personalized automation if the HA system could
know who was where, and what they were doing.

If they are sitting quietly watching TV, no sudden light flashes.  If
someone's taking a super-long shower or "other" activity, no sudden
darkness.  The system would be able to respond to rules like "if no motion
is detected *but* no one has left the bathroom, leave the light on."  This
one ability would shoot SAF (and my own AF) up considerably and it should be
doable unless someone climbs out the bathroom window.  Turning off lights as
soon as rooms became empty (instead of after X minutes) and being able to
provide "light pathways" as a person walks along through a darkened house
should shave some serious $ off the electric bill.

If FPS games can track hundreds of actors across multiple continents in huge
simulated terrains the CPU horsepower is obviously available to track two
slow moving people and two somewhat livelier little dogs in a rather small

Any thoughts or relevant information will be appreciated.

Bobby G.

Re: Occupancy detection
Just a couple of points...

1. There's no reason to think the various motion detectors are saturating
the RF environment. They only transmit for a very brief period (5 bursts
that last about 65mS each) when triggered by motion so unless someone in the
household is now constantly wandering about aimlessly (or purposefully, for
that matter), RF activity attributable to the motion sensors should remain
more or less the same over time. The decrease in range could be caused by
any number of things - weaker batteries, higher humidity, temperature, etc.

2. The IR used in the types of sensors you are considering is usually of a
different wavelength and does not modulate a 38-40kHz carrier and IR is also
line-of-sight so it's unlikely to affect the Powermids.

Quoted text here. Click to load it

Re: Occupancy detection
Quoted text here. Click to load it

The RF range has decreased over time, and I did not mean to imply it's from
the RF detectors "saturating" the environment.  There are times in the
morning now where the X-10 RF flat out doesn't work unless you put a Palmpad
or keychain remote within a few feet of the transceiver.   Whether these
blackouts are caused by sunspots, military transmissions or whatever, I
can't say.  Without an RF meter it's just guesswork.

However, one doesn't need to know the cause to see the effects.  They are
pretty hard to ignore.  When it happens, all the wireless thermometer
displays either go blank or fail to update.  That sort of unreliable
environment makes occupancy and motion detection using the X-10 RF frequency
unworkable, at least IMHO.  The lax enforcement by the FCC tells me things
will get worse and not better as more and more wireless gizmos make their
way to market.

More importantly, the apparent lack of collision detection of the RF
component of the "chain of command" means that if there's more than one
person and one detector in the house, problems are bound to occur.  I've
tried all sorts of combinations of transceivers.  The protocol's just not
robust enough to support the task, at least in a house where there's fast
motion of more than one occupant.  When I lived alone, I recall being
skeptical about all the problems people reported with multiple occupants and
motion detectors.  Not anymore!

Quoted text here. Click to load it

That's good news.  I was worried because I didn't think either the sun,
CFL's or plasma TV's modulated a carrier or worked on the Powermid
wavelengths but managed to trash IR distribution just the same.  Like
mercury in CFLs, I hate solving one problem by inducing others!  I guess
I'll plunk down some bucks and buy a few of the kits:


and see what's what.  They're not very expensive.  Thanks for the input,

Bobby G.

Re: Occupancy detection

Quoted text here. Click to load it

So just how close to the Naval Observatory are you?

Re: Occupancy detection
Quoted text here. Click to load it

Apparently too close.  I also believe I am in a straight line path between
two large military installations active in Homeland security work.  From
what I can see each has several huge towers with all sorts of different
antennas pointed my way.  Not sure what bands the transmit on or even if
they are involved but the blackouts are becoming more and more frequent.

At first, I thought there was something wrong with the wireless thermometers
and kept changing batteries only to find they hadn't run down more than half
a volt.  That's when I noticed the bathroom lights would misfire, despite
the close proximity of the TM751 to the Hawkeye.  I'd reset all the
thermometers so that they had blank displays and when they finally
refreshed, the RF "storm" seemed to be over.  The bathroom light goes on and
off nearly instantaneously when the RF skies are clear and becomes quite
erratic when the thermometer displays "lock up."  I can only assume it's a
stronger signal drowning out the flea-powered devices like the Hawkeyes and
the thermometer transponders.

For me, the really bothersome part of the problem is that in many, many
cases, the darn things work just fine.  You can hardly get more bang for
your buck, especially if, like me, you got the X-10 gear with the vouchers
they used to hand out like candy.  To get to the next quantum level of
reliability means you have to basically leave the X-10/RF world and go
multiple sensor and hard wire or an use RF protocol that's two way with
collision detection.  Even so, my front tooth, my costochondral separation
and my patella are working hard to convince me that near the Nation's
Capital I might be wise to cut RF completely out of the loop if I want to
maximize reliability.

I have *so* many Hawkeyes that I'd be willing to try hacking a few to
disable the RF transmission feature and use their output to close contacts
or otherwise act as sensors in a hard-wired system.  Or I might decide that
the X-10 RF component can act as a secondary or tertiary sensor in a
multiple sensor setup, with the primary motion detector being the hardwired
broken IR beam sensors.  I like the beam because it's immune to all but
leaping pets, flying bats and couples crossing the barrier "in flagrante

The problem becomes how to integrate the critical lights into the X-10
system while maintaining isolation from some of the typical X-10 problems of
collisions, inadvertent activations and lost commands.  I'd like to still be
able to turn all the houselights out with a single button press but that
feature makes the stairway lights vulnerable to someone pressing the ALL
LIGHTS OFF switch while someone else is descending the stairs.  The
stairways lights should only respond to X-10 commands if no one is using the

Bobby G.

Re: Occupancy detection

Quoted text here. Click to load it

You need to learn how to program your CPU-XA/Ocelot for use with hardwired

Re: Occupancy detection
Quoted text here. Click to load it

If only it were that simple.  This a primarily a reliability issue, at least
for me, so there are a number of reasons not to use ADI gear.  I don't want
to knock ADI too hard because lots of people seem to use their equipment
quite successfully.  However, in this specific case, putting a novice ladder
logic programmer (me!) who really dislikes unstructured languages like CMAX
in as a "keyman" is NOT likely to enhance the system reliability index.  (-:
The few times I've worked with CMAX have been less than optimal and, in
fact, very disappointing.  I wanted to use the CPU-XA as an IR translator
but the latency was completely unacceptable. To get good reads required
changing operator behavior.  In reading through their forum it turned out
that reliable reads meant the user had to press buttons on the remote for at
least 1 second.  That had zero SAF.

If I were to struggle with CMAX and "drip down" ladder logic, all that would
likely happen would be the reliability "demon" will simply move from the
X-10 gear into my CMAX code.  If I were to add a PC to the mix so that I
could use a more structured language like HomeSeer, that would merely move
the reliability demon to a Windows-based PC.  But there are other reasons
for me to find another solution. I just checked the ADI forum again and it's
pretty clear the Ocelot line is on life support.  Under new products there's
only the one message and it's just a code update, not a new product:

New ADI Products  --- As new products are released, we will spotlight them
   Posts=1  Threads=1

Release C-Max 2.00e3 / Executive 3.18  #189683 - 02/09/07 08:36 AM
   Daylight Savings Time Schedules changed for 2007
   ASCII Bobcat RX Compare added  (must use Version 8 or greater Bobcat)
   Fixed "Need to Load New Exec" message
   Fixed Manual TX Ascii Message for C-Max window bug

It's the same old crap but at least they are still patching the code!  But
they're also still listing meetings for 2005.  When Dan Boone left, ADI's
interests obviously went elsewhere.  I had to embarrass the heck out of them
to even get them to update their BBS, which was years out of date.  I recall
at the time being assured that new products were in the wings.  That was two
years ago.  Still nothing.

Even though I own more than enough ADI gear to solve the problem, I'm
unwilling to invest the considerable time in learning how to program a
"throwback" language on a dying product line.  I'd have to feel I had
mastered CMAX to be assured the problem was solved.  I'm guessing that it
will take at least the same amount of time it took to learn FORTRAN or COBOL
or Pascal or BASIC.  I *had* to learn those to get my degree;  there's no
such motivation with CMAX.

I'll have to throw out most of what I learned about structured coding and
embrace a programming language that's based on now-obsolete "ladders" of
mechanical relays.  Worse, still, it's a language that flies in the face of
what I was taught were good coding techniques, which inevitably means "hard
to maintain" even for the original coder.  It's just too much effort to
expend in order to solve a light switch problem that could, in all truth, be
solved by either manually operating the switch or using a dedicated motion
sensing light switch that can't be interfered with by X-10 demons.

But before I even begin to think about choosing a HW platform, good coding
technique dictate I do a requirements analysis that fully describes what I
want the system to do.  The stairway problem breaks down fairly simply:
Reliably sense entries and exits and occupancy via multiple sensors as well
as motion and light output (so that I know if the light's burned out or
really ON or OFF).  Then I need to put the entries in a state table with
some simple rules and act accordingly.  It probably doesn't even need a
microprocessor as the logic would be simple enough to implement with some
TTL devices on a perf board once the proper inputs and outputs had been

I hope other CHA'ers can add their insight as to what that logic should look
like.  Ben P. and Frank have already given me some things to think about.
By writing this message, I've come up with some of my own, including a
provision for ALL LIGHTS OFF to be ignored in a occupied room if the command
was fired remotely.  That means no more shouts of "who turned off the
lights!!!???" from my wife whom I have occasionally plunged into sudden
darkness via an ALL OFF.  The programming is beginning to show similarities
to game code.  Create a data structure of all the rooms in the house and
increment and decrement counters as people move around.  Too bad I can't
program a "god mode" to turn clipping off that allows me to walk through
walls like I can in Doom!

In any event, even if I were to go the microprocessor route to solve the
problem, I'd probably opt for something newer and more powerful than the
CPU-XA or Ocelot.  Most critically, I would choose something that could be
programmed in a higher-level language than CMAX without requiring a PC
running 24/7.  The Basic Stamp series looks interesting, as do a number of
other controllers.  The Maxbotic site


described some of the platforms people are using for their sensors (BasicX,
BX24p, Basic Micro, Atom, Wright Hobbies DevBoard-M32, AVR using Bascom,
Parallax, Basic Stamp BS2).  Not one was an ADI platform.  Learning how to
program a newer, more powerful microprocessor would probably have payoffs in
other areas of automation that will need microprocessor control.  Ladder
logic and leisure suits both had their day, but that day is gone, at least
for me.

Bobby G.

Re: Occupancy detection

Quoted text here. Click to load it

Ahh! I didn't realize that your new residence was going to be a cave. ;) It
will help with energy costs.

Ladder logic is used throughout industry worldwide. Its use probably
outnumbers higher level languages by several orders of magnitude. Its day is
far from done.

Comparing microcontrollers like those you've listed to ADI's system is
comparing apples and orange groves. ADI uses an RS485 network with a
protocol (published) of their own design. Expecting robotics hobbyists to
use an Ocelot is rather ridiculous - it wasn't intended for that.  

If you're going to try rolling your own, look at...

     ZBasic - much more advanced than any of the stamp progeny you've listed
     BasCOM AVR - good
     mikroBasic - available for PICs, AVR. and other microcontrollers
                  available in C, Pascal, Basic, ???
                  (still evolving)

There's even a stamp-like module that uses ladder logic...


I doubt that Jeff Volp will agree with your anti-ADI screed.

Re: Occupancy detection
Quoted text here. Click to load it
Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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

Quoted text here. Click to load it

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:


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:


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

<<Normally in a programming language things happen in order. The command or
line of code on top is executed before the command on the bottom until you
hit the end of a loop. This is not so in ladder logic. Everything happens at
the same time. . . . "The things you will probably use the most writing
Ladder Logic are the relay conditionals --| |-- ---|/|--- and the output
coils ---( )---. These three things basically make up a kind of IF THEN
statement. This --| |-- means closed if energized while --|/|-- means closed
if not energized. The output coil --( )-- basically means then energize

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

Re: Occupancy detection
On Tue, 7 Aug 2007 07:51:12 -0400, "Robert Green"

Quoted text here. Click to load it

By "HW platform" I think that BobbyG is referring to a central processor or
microcontroller and not the platform of sensor hardware (eg motion

An important step in system and sensor design is the decision of whether to
create the Event of "Occupied = YES/NO" at the sensor itself or  in a higher
level processor. Or both.

An actual example of hardwire-based decision-making are dual technology
motion/occupancy detectors that use both Passive Infrared (PIR) and microwave
and only report an Event when both sensors are triggered.

Along the same lines, the outputs of two motion detectors in a room can be
logically OR'd together or logically AND'd. The OR'd arrangement increases
the risk of a false positive but decreases the risk of a missed occupancy.
And vice-versa  for the AND'd configuration. Sending the uninterpreted ON-OFF
Event data from _both_ sensors to a processor for decision-making provides
for better risk and error management.

Event 1 Detector_1 Only
Event 2 Detector_2  only
Event 3 Detectors 1 and 2 Both
Another example is/was the use of what Savoy dubbed "Motion Vectors" in the
CyberHouse software released ca 1998 which used the time relationship between
"ON" events reported by two motion detectors monitoring two different
contiguous locations to create Motion Vector Events (eg: 'Motion to north in
Hallway"; "Motion to south in Hallway"). The latency problems of X-10 made
useful implementation difficult/impossible even with hard-wired motion

The hardwired THOL (Temperature, Humidity, Occupancy, Lightlevel) system I
designed and am installing can be used with multiple motion detectors at a
single measurement site so as to be able to create a Motion Vector Event in
hardware in real time as well as pass on the raw, uninterpreted sensor data.

The data and the events are combined into a single 0-10vdc analog level which
in turn can be treated downstream as a single event by defining the event
threshold analog voltage or as a series of readings of the different sensor
or both. More than one downstream processor can receive, interpret, store
and(or) act on the data, so different processors can have different

Continuing with my THOL example of Occupancy, a single commercial PIR
detector simply toggles the output between two voltages (typically 0 and
10vdc but they could be any two values between 0 and 10vdc) when the contact
of its internal relay closes.

Contact closure of each motion detector in an array of n detectors can short
out a different resistor in a conventional R-2R resistance ladder and so
create a unique 0-10vdc value for each of the possible 2^n outcomes.

Adding a simple PIC or AVR can add interpreted outcomes (= Events) based on
timing, IOW, Motion Vectors. The practical number of different states that
can be reported by an analog signal depends on ADC resolution and precision
and system noise among other factors. Reporting independently the five
different Y/N states requires 2^5 = 32 different values.  This is easily
handled by a 10-bit ADC (1024 possible values) in a system with sufficiently
low noise and stability.

Bit 5 Motion South         
Bit 4 Motion North     
Bit 3 Motion Detector_1    
Bit 2 Motion Detector_2     
Bit 1 Motion Detector_3

Note that Bits 1-3 are raw sensor data. Bits 4-5 are interpreted data.

So by logging the analog voltage one is logging both all the raw data and the
Motion Vector events interpreted by the on-site hardware.

These discrete events could be usefully lumped together to create fewer
combinations of possibilities that impose less stringent demands on the
analog hardware and communication. For example by reporting exclusively only
_one_ of these six  Events

Event 1 = Motion South Three Detectors = 8.volts
Event 2 = Motion North Three Detectors = 7 volts
Event 3 = Motion North Two Detectors   = 6 volts
Event 4 = Motion South Two Detectors   = 5 volts
Event 5 = Any Two Detectors            = 4 volt
Event 6 = Only One Detector            = 2 volts
No Event= No motion                    < 1 volt

at the receiving (downstream) end one can more easily  use analog comparators
or TTL/CMOS PICs or AVRs or a simple LM3914 Dot Display driver to physically
create a discrete electrical signal in the form of a contact closure or TTL
signal for the event.

2 volts would imply low certainty with no perceived motion.
4-6 volts moderate certainty
A voltage > 7 volts would imply high certainty, etc.

Quoted text here. Click to load it

With flawless event definition, "simple rules" might work well most of the
time for many actions.

Quoted text here. Click to load it

This is a classic GIGO situation. A CPU or MCU processor can help to filter
the data in a way that "simple" rules" can't and to create infrequently
enacted rules that might be very important but might not find their way into
a system based entirely on discrete logic ICs.

A fully hardwired TTL approach also mostly forces definition of the event of
"occupied" beforehand and essentially eliminates any stochastic evaluation or
risk analysis and their use in determining actions. Stupid machines make
stupid mistakes.

Also, IIRC, in previous posts wrt temperature and HVAC BobbyG expressed an
interest in data storage. How does one do this efficiently with TTL's  alone?
A hardwired TTL circuit might have a place in the system if (especially)
there are other devices that also translate, use and act on the data.

(FWIW, making one-off PCBs has become relatively easy, fast and inexpensive.
And for non-RF prototypes, solderless breadboards work fine. Perf-boards for
TTL are fragile and error-prone IME.)

... Marc

Re: Occupancy detection

Quoted text here. Click to load it

Those are Velleman kits and I found schematics although I did not find any
specs. If I remember how to calculate the frequency of an astable
multivibrator, the carrier frequency should be in the neighborhood of 5kHz
which should be OK with the Powermids but the acid test is to try one in
case I misplaced the decimal.


Re: Occupancy detection

Hi Bobby

How about using ultrasonic sensors such as the Maxbotix sensor.....

http://www.maxbotix.com /

You can connect up to 4 of these to Gerrys board which reports each via
a serial




Frank Mc Alinden

Re: Occupancy detection
"Frank Mc Alinden" <Frank.Mc.Alinden.2urjf4@no-

Quoted text here. Click to load it

They look interesting.  The problem for me, as I outlined in the note to
Dave, is that going to the next level - seamlessly integrating non-X10
equipment into the existing setup is going to require a lot of work.  I
don't want anyone to be able to press ALL LIGHTS OFF in one part of the
house while a person is descending the stairs in another.

Thanks for the URL!

Bobby G.

Re: Occupancy detection
Quoted text here. Click to load it

But just how likely is that to happen?  That and any motion sensor would
trip again on seeing motion and turn the like back on.  What's going to
happen faster?  Controlling 'All Off' but keeping exceptions for currently
detected motion cannot be accomplished at the device level.  It would
require a computer (dedicated PC or whatever) and intercepting the 'All Off'
functions entirely.  This may be a bigger problem as the 'All off' function
is usually directly sent from controls to devices and can't be easily
disregarded.  If keypads that had 'All off' functionality had the ability to
reprogram the housecode for just that key then it might work.  But none
offer this, they only allow one housecode for all buttons, not individually.
You'd have to change the housecode and use a PC to intercept and retransmit
all keypresses, not just the 'All off'.  This adds an unacceptable delay as
the commands have to get sent twice.  They're already 'slow enough' from the
keypads directly to the devices.  Adding a PC into the loop will definitely
be a WAF problem.

I'd consider adding logic on a PC that tracked motion sensor status and IF
an 'All off' was detected that signals be sent to immediately bring those
lights back on.  But with a timer that monitored for any additional motion
detection.  As in, the stairs sensed motion, an 'all off' was detected, turn
the stairs back on and wait X period of time to see if any other motion was
detected, if not, turn the stairs back off again.

I'm guessing it'd be far too much work trying to come up with a "fix" to a
relatively unlikely or infrequent scenario.

-Bill Kearney

Re: Occupancy detection

Quoted text here. Click to load it
Quoted text here. Click to load it

The problem stems from a work-around for the low bandwidth of X-10 and the
original lack of scenes downloaded to dimmers and other devices.  What was a
nifty feature when first introduced is now a liability.

For X-10, one 'solution' is abandon the All ON/OFF command by moving all
devices off the affected house code. Whether one can mitigate the resulting
increased lag and decreased relibility when one wants to turn on all Lights
ON or OFF at once depends in part on how many switches one is willing to
replace with expensive X-10 switches that support scenes.

ABIK, neither the table-top or wall-mounted wired keypads or RF INSTEON
control pads have a _global_ ALL ON/OFF although one could program a key as a
global ALL instruction without having to use a PC to execute it. The ALL
commands that are on the RF pad sends instructions only to the six _sets_ of
devices programmed in the pad but those could be all the devices in the house
if one chose.

... Marc

Re: Occupancy detection
Quoted text here. Click to load it

All it takes is once to cause serious problems.  The "ALL OFF" scenario is
just once facet of the problem.  As you well know <g> 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.

Quoted text here. Click to load it
like back on.
Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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.

Quoted text here. Click to load it
the 'All Off'
Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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.

Re: Occupancy detection
I'm glad to see this getting attention, because motion activation of
lights is definitely on the top of my list of things i'm not happy w/
about my automation installation.  However, reliability doesn't seem
to be the issue for me, what is an issue is the latency.  Generally I
have to carefully position the sensors so that just walking by the
room (but not into it) doesn't trigger the light to come on, but this
means that you have to take a step or two into the room before you are
detected.  Add to that the delay of the detector picking you up once
you are in range, sending the signal, the tranceiver relaying the
signal to the powerline, my PC picking up the signal, and my PC
broadcasting a "hey turn on the kitchen lights" signal back down, and
it takes at least 1-2 seconds before anything happens.  (I relay
through the PC so i can do more macro control such as only turning on
lights when it's after dark).

Often this means walking into a dark room.  I've actually
subconsciously trained myself to walk into the room more slowly to
ensure the lights have a chance to come on before i get too far and
walk into something i can't see.  I started on HA to make my house
adapt to me, not to adapt myself to my house.

One thing i've considered to help the situation is a product I saw a
while ago (sorry no link handy right now) which acts as a whole-house
radio reciever and connects to your PC directly.  This would eliminate
the "sensors->transceiver->PC" leg of the trip and probably cut the
response time in half.  You still have the latency of being noticed by
the sensor and the PLC lag time though.  Incidentally this product has
a "real" antenna and claims to boost reception ranges significantly.
I'm sure Dave Houston knows what i'm talking about and knows whether
those claims are valid.

I've considered going the route of individual hardwired motion sensor
lightswitches like lutron makes which would no doubt operate faster
than my x10 mechanism, but I really like having a central "brain" to
my house and having the ability to set rules or be able to remotely
control those lights independently if i need/want to.

Re: Occupancy detection
ben.parees@gmail.com wrote:

Quoted text here. Click to load it

The BX24-AHT (no longer available) and roZetta (not likely to become
available for a few more months and then without internal RF) are based on
the principal of centralized RF reception. It's fairly simple to design an
efficient antenna (and add a wideband preamp, if needed) to get good RF
reception (200' even with lots of metal and wire lath in the environment).

The only commercial device that I'm aware of is being sold in defiance of
FCC testing requirements so I neither mention its name nor comment on its

What I will try soon to again make available is a replacement PIC for the
MR26 that allows it to report standard X-10, security X-10, CR14A (Ninja,
Robocam), Chamberlain garage door sensor, Digimax 210 (European RF
thermostat) as well as some protocols of my own for extended dims, preset
dims, and ADC sensors. You can add an antenna (with preamp, if needed) and
accomplish what you want as far as eliminating the powerline leg of the

I will also try, in the next few weeks, to release a PIC and DIY design for
direct RF input (standard & security X10) to the ADI family of controllers
(CPU-XA, Ocelot, Leopard) for those who would like to eliminate the PC.

Re: Occupancy detection
On Fri, 03 Aug 2007 18:27:53 GMT, nobody@whocares.com (Dave Houston) wrote in

Quoted text here. Click to load it

I checked Dave's web site and all the documentation needed binary and other
files to make PCBs and program the BX24-AHT are still here at
http://www.davehouston.net/files.htm .

The pcb's are still listed as in stock and available here:

I have a couple unused pcb's that I can add to my Home Automation and
Electronics porch sale at www.ECOntrol.org/porch_sale.

Perhaps what Dave means is that he has effectively withdrawn permission. Many
of the files are marked " Copyright. No part may be reproduced except by
[italic] written [/italic] permission. This restriction extends to
reproduction in all media." Makes them purty hard to use ...  

Quoted text here. Click to load it

Dave refers to the WGL designs W800RF32 family of RF receivers
that competed with his device when parts for his were being sold by Dave's
family and fully assembled by Laser. WGL is supported by at least 17
different home automation programs. Dave pulled the plug on the BX24-AHT ca
2004 after his family shut down the supply web site without warning and Dave
lost control of the Yahoo groups BX24-AHT forum.

There are, as Dave doubtless knows, other centralized RF reception systems
out there.

Check out, for example, RFXCOM http://www.rfxcom.com/ available from
www.cheapertronics.com in the US who also distribute CheaperRFID.

RFXCOM supports X10, Oregon Scientific, Visonic, KlikOn-KlikOff, ELRO, NEXA,
Domia Lite, ATI Remote Wonder. The RFXMeteis a modular utility metering
device with RFXPwr for power usage metering.  RFXSensors reportedly include
RF transmitters for 1-Wire®  temperature, humidity and barometric pressure
sensors. Also reported available are external sensors for temperature,
humidity, barometric pressure and A/D input 0-10V DC.

Then there's the new HomeSeer HSM100 Z-Wave multi-sensor
that opens new possibilities for lag-free response of automated lighting to
motion sensors. (I previously posted about this in this newsgroup.)

Quoting the HomeSeer web site:

"The new device is designed to sense motion, temperature and light and home
owners can use the HSM100 to control up to 4 other Z-Wave devices directly.
Those with HomeSeer-equipped homes can also use the HSM100 to trigger more
complex automation events for whole house control of Z-Wave and non Z-Wave
automation products."

... Marc

Re: Occupancy detection
Quoted text here. Click to load it

There are newer motion detectors which make
this easier and with a better WAF rating. Visonic
makes SOY series motion detectors which are
very small.  The electronics are in a tiny cylinder
which slips into a hole in the wall.  The "eye" is
a small, round head about 3/4" diameter.  The
detector can be ceiling or wall mounted, just
inside the door to a room.  If there is only one
door to the room it is possible to use two
detectors -- one inside and one outside to count
occupants.  That's a somewhat imprecise science
but it can be made to work, especially if there are
not a lot of people coming and going at the same

There are several models (SPY1, SPY2, SPY3
and SPY4) with different detection patterns.  I
have DIY customers using them to control lights,
HVAC, etc.  In one application a "curtain" pattern
detects movement through a narrow plane of
detection.  The detector was turned 90º to make
a layer of coverage about 2.5' above the floor.
This is high enough to ignore the dogs but will
trigger if a person the room.

Quoted text here. Click to load it

Most hard-wired detectors can be set to respond
in the first 1 or 2 footsteps into the protected area.
Also, when automating little used rooms such as a
pantry or closet, you can use simple magnetic
sensors (called a "contacts" in the security trade)
to detect the door being opened.  These respond

Quoted text here. Click to load it

That will add latency, no matter what kind of
detectors you use.  Have you considered a PC-
connected system with separate, stand-alone alarm
/ automation controller?


Robert L Bass

Bass Home Electronics
4883 Fallcrest Circle
Sarasota · Florida · 34233

Site Timeline