Dear specialists!
I`m a new Arduino User, and this is my first posting. May I ask you a question regarding my project?
I need to start 2 Motors depending on the signal of PIR sensor.
I have all the hardware and everything works fine.
For example, if I make my sketch just to turn on both of the relays "together" , "hand in hand", say, 3 seconds after the Sensor switched on and hold both of the relays for 7 seconds On, it is working, because it is simple, using the delay() function.
But what I need is something like that: after the Sensor is sending the HIGH signal, I need the First relay to start, say, 2 seconds after the Sensor and keep on for 10 seconds only, but the Second relay to start only 15 secs after the initial signal from Sensor and keep the second motor on for, lets say 30 seconds, after that to switch off. And NOT to continue to do it further in a loop, until the new signal from Sensor arrives.
I mean - I need individual starting time and duration time for each of my relays / motors, but the starting point - the signal from the Sensor - is the same for both relays.
And when - after some longer pause programmed trough delay() Arduino - the signal from Sensor is coming again, I need my relays to behave exactly as the previous time:
one earlier, other later; one for shorter time, other for longer time.
How something like that could be done? One sensor and 2 timewise differently behaving actuators?
I discovered the Metro library a bit, but I was not too talented to implement it in my sketch.
I would appreciate any advice indeed.
thanks! And sorry about my english.
Gj