Omni Pro II Relay programming to determine direction

Hello,
We are working on a huge project and was wondering If you had any ideas on how to program the relays (just a add on 4 port relay board 10A07-1) in a Omni Pro II so we can determine direction of a car entering and exiting a driveway. The goal here is to voice announce that a vehicle is entering or exiting the property. Note that we use voice announcements for other Omni action already.

The layout is we have relay #1 that activates temporarily when a car crosses a magnetic sensor we have installed in the driveway. We also have another relay, relay #2 that activates temporarily when the driveway gate starts to open. Just for reference, the magnetic driveway sensor is about 25’ before you get to the gate (when exiting). Note that both relay #1 and relay #2 already announce their respective statements when activated. It’s just we don’t know if a vehicle is entering or exiting the property.

Sounds simple as all we need to do is voice announce a vehicle is exiting the property if the driveway sensor relay (Relay #1) activates first and the driveway gate relay (Relay #2) activates second.

Note that we would also want to program it as well to voice announce a vehicle is entering the property if the driveway gate relay (Relay #2) activates first and the driveway sensor relay (Relay #1) activates second
We have racked our brains on countless code variations and are still failing. If you have any thoughts/code could you please share.
Thanks,
Mike
 
Hi and welcome. So typically, you can just have an If statement and a condition together. When the "if" triggers, it checks the "condition." so "If" Relay #2 is on, with a condition of Relay #1 on, THEN its the #2 to #1 direction. Just reverse for the #1 to #2 direction. If you tried that and it doesn't work, it's because your two events are happening to close together, and the Omni is pretty slow. Try that first, if it doesn't work, you'll have to get a bit creative.
 
I should add, what I said will only work if #1 stays on long enough to be on the same time as #2, and vise-versa. If that isn't the case, then you will have to extend the time that each is on so that, at one instance, they are both on. You can do this with a flag, or by extending the length of time your relay #1 is on and your relay #2 is on. Instead of just turning relay #1 on when things trigger, turn it on for 3 seconds, say, and do the same for the other one, this will give them more time to overlap. I'll provide some sudo code.
 
OK maybe something like this...

IF gate trigger, THEN relay #2 on for 5 seconds
IF gate trigger, CONDITION relay #1 is on, then motion is gate-to-driveway
IF driveway trigger, THEN relay #1 on for 5 seconds
IF driveway trigger, CONDITION relay #2 is on, then motion is driveway-to-gate

That should work.
 
Here is the program I use for this:

150. WHEN Wireless Driveway sensor 2 NOT READY
THEN Timer for direction of car ON FOR 20 SECONDS
151. WHEN Wireless Driveway sensor 1 NOT READY
AND IF Timer for direction of car ON
THEN SAY (Beep) VISITOR IS APPROACHING
152. WHEN Wireless Driveway sensor 1 NOT READY
AND IF Timer for direction of car ON
AND IF House AWAY
AND IF Flag 20 minutes after sunset ON
THEN RUN Button LV outdoor lights on
THEN UPB Link all outdoor lights on ON
 
Back
Top