I am using an ATTiny85 to run a PIR light switch. I've got the coding down (I think) for one sensor, but can anyone tell me what I need to add so it can be triggered by 2 different sensors in an either/or setup?
I just meant that the Relay Pin goes high (for 800ms) if either of the PIR Pins go high. It doesn't need to be both. It's for a set of stairs lighting. The stairs aren't straight up and down, so I need a sensor at the bottom and one at the top.
Once the delay(800) is done, the loop restarts and if the PIR output is still high (very likely), the relay will remain activated.
Your code keeps the relay ON as long as the PIR output is HIGH, which is typically several seconds (depending on its builtin setup potentiometer). A simple test will confirm this.
If what you want is the relay to turn on only when a presence is detected and the PIR goes from LOW to HIGH, for just 800mS, you have to modify the code to detect when this change happens
Adding a second PIR is very simple, so I would focus on fixing this first.
Sorry gang! 800 is a typo. I meant 8000ms. The sensors, according to the documentation, have a high time of 3.2 seconds. So I think I'm good on the delay time.
Like you probably found out, your code (even for the first PIR) doesn't work.
That's because after delay you do nothing. Instead you need to return the relay to LOW state.
I'm sure they could, but there is a full 180 degree turn in the stairs separated by drywall. So due to obstructed view, the lower sensor cannot see what the upper sensor sees and vice versa.
ok, then you need to make your code remember which sensor turned on first and you do that be adding code to each sensor to turn on it's memory bool if the other sensor's memory bool is not on.
Then when you turn the light off, reset each memory bool to false.