# trigger after certain signal-order

hi list
i have an installation with 25 sonar-sensors connected via arduino to touch.
so far all good and running well.
what i need now, is to know if a person is walking from left to right or from right to left.
so sensor 1 is all left and sensor 25 is all right, just to imagine…
my attempt is (but failing till now…) to program a simple logic, where a trigger-signal is send out when sensor 1,2,3,4 are triggered in that specific order. that should be enough to roughly identify the walking-direction.
i would be very glad for some ideas how to get that task done.
best
luca

ps: would also that answer this thread: viewtopic.php?f=27&t=7282&p=27775&hilit=order#p27775

hi luca,

The Techniques forum is only for sharing techniques you have developed or workflows you use that you think others may find useful, questions should go in General or Beginners.

that said, my approach would be to have each sensor add a character to a string.
After each trigger you check the string.
When string == “1234” do your thing. You could also check if string equals 2345 / 3456 so it also works if you start halfway. Then you also need to build in some reset for the string, maybe when nobody is near any sensor.

hi nettoyeur
hmmm, well your right, that was not so clever of mine…
but, thank you for you answer!
that was my thought too, but right at the point of creating the string and check is where i stuck…
to close as fast as possible this wrong placed thread, could give me a hand ?
anyway thank you!
luca

is there a way to move a post to an other forum?

my approach would be something like this:
Assuming a sensor sends out a one if a person is there and a zero if nobody is there:
Multiply each sensor’s output by its ID. Then add up all the results. What you should get is a position indicator of the person. So a five if the person is standing in front of sensor five etc. This can all be done in CHOPS. When you have that, you just need to see if the derivative of the position (slope CHOP) is positive or negative. (You might need to choose some more clever filtering than just the derivative, which is a very simple highpass filter)

i like your approach much better hrtlacek, as it would work from any position.
My method is better for entering a password instead of finding direction.

But how would that work as the sensors give a signal once in a random period with the slope chop has a sampling rate of 60Hz?

attached the network as you said, i’m a bit lost how i can get a direction from this if i press the buttons in a certain order in let’s say 5 seconds, could you fill me in?
slope.toe (5.05 KB)

hi,
here is an example, (I think what you are saying is that you need a hold chop too)
use the keyboard buttons 1-5 for testing,
cheers!
direction01.toe (4.79 KB)

hey guys
thank you for your ideas and toe’s!
here is my very simple approach.
i want that after passing sensor4 a triggersignal is sendet to a component in touch.
to avoid the trigger to happend when someone passes in the other direction i created a individual trigger-chop for those 4 sensors, but with a very short attacktime for sensor 4.
long words, try it out if you like…
best
luca
direction.toe (6.53 KB)

thanks for your example hrtlacek, i had totally forgotten about hold chop.
And cool that you made it work for your installation luka.