2 driveway sensors to determine direction?

wbonnell

Member
I was trying to figure out a way to use the rules of an M1 to try to determine if a vehicle was coming or going from my residence. I can get driveway sensors that have a NO contact on them that I can tie into the panel. I am not that familiar with creating rules but I thought maybe using the counters we could come up with a way to do this. If anybody has any ideas I would greatly appreciate any help!!

Thanks

Bill
 
I think you want to use a virtual output (which really just holds a "state", such as on or off) instead of counters.

What about this:

Sensor A is at top of driveway, Sensor B at bottom.
Assume you want to turn on a light (Garage Light) if car goes from top to bottom.

Create an output (let's say output 20).

First Rule:
WHENEVER Sensor A BECOMES NOT SECURE
THEN TURN Output 20 ON FOR 10 SECONDS

Next rule would be:
WHENEVER Sensor B BECOMES NOT SECURE
AND Output 20 STATE IS ON
THEN TURN Garage Light ON (you may wish to put a time duration on this)

For the reverse, create a different output and just reverse the scenarios for Sensors A and B.
If you really wanted to make certain of direction, you could make it a little more complicated. Let's assume output 21 is tied to Sensor B:

The second rule above could then have a second AND statement: AND Output 21 STATE is OFF

That should make it certain that something has gone FROM Sensor A TO Sensor B.
 
I have a Stargate, not an Elk, but I'm guessing the logic would be similar. Like Madcodger's suggestion, you create a device (in this case a flag) that is cleared to effectively disable one event if the other event is triggered first. In my case, a 15 second disable period provides enough time to pass over the second sensor. This works because the ladder logic scheme of Stargate repeatedly evaluates these events - I assume Elk is the same way? The DI is the digital input from the driveway sensor to Stargate. This is what it looks like in Starglish:

FASTEVENT: Drive Up Alert [ DI:Driveway 1 Goes ON]
Then
|-If
| (F:Driveway Flag) is SET
|Then
| Voice:HONK CAR COMING [Line]
| LOG 'Drive up sensor was tripped'
| |-If
| | After Sunset SMTWTFS
| |Then
| | X10: E-1 Front Door Light ON
| | X10: E-3 Front Walk Light ON
| | X10: B-3 Shed Landscape ON
| |- Nest End
| (F:Driveway Flag) CLEAR
| DELAY 0:00:15
| (F:Driveway Flag) SET
|- Nest End
End

FASTEVENT: Drive Down Alert [ DI:Driveway 2 Goes ON]
Then
|-If
| (F:Driveway Flag) is SET
|Then
| Voice:HONK CAR LEAVING [Line]
| LOG 'Drive down sensor was tripped'
| (F:Driveway Flag) CLEAR
| DELAY 0:00:15
| (F:Driveway Flag) SET
|- Nest End
End

Mark
 
Back
Top