Prop trigger using PIR

Hello Everyone, I am trying to create a sketch that I can use to trigger multiple Halloween props using a PIR. Once motion is detected, I want one (demo switch) to activate the prop. Once that prop has gone through it's cycle, I want another prop to activate its (demo switch). this will prevent them from talking over each other and allow for all four props to cycle through. I currently am able to trigger the first prop but am not sure in the sketch, how I trigger the next. If anyone has suggestions, please let me know.

I currently am able to trigger the first prop

Using what code?

but am not sure in the sketch, how I trigger the next.

It would be similar to how you triggered the first one. 8)

How does the Arduino know how long it takes the first one to do it's thing?

I am just using the basic led blink sketch and added the PIR. It trigger but when I add an additional led line, I can't seem to get it to trigger. I have to count the time it takes to run it's cycle and the try to figure out the delay that I need. Here is the basic code that I used but then added delays.

int PropOnePin = 8; //Prop One connected to digital pin 8
int PropTwoPin = 9; //Prop One connected to digital pin 9
int PropThreePin = 10; //Prop One connected to digital pin 10
int PropFourPin = 11; //Prop One connected to digital pin 11
int PropFivePin = 12; //Prop One connected to digital pin 12
int SensorPin = 2; //Sensor connected to analog pin 3
int State = Low; //by default, no motion detected
int SensorVal = 0; //variable to store the value read

void setup() {
pinMode(PropOnePin,output); //sets the digital pin as output
pinMode(PropTwoPin,output); //sets the digital pin as output
pinMode(PropThreePin,output); //sets the digital pin as output
pinMode(PropFourPin,output); //sets the digital pin as output
pinMode(PropFivePin,output); //sets the digital pin as output
pinMode(sensor, input); //sets the sensor as an input
}

void loop(){
SensorVal = digitalRead(SensorPin); //read the input pin
if (SensorVal == High) //Check if the sensor is HIGH
}
digitalWrite(PropThreePin, High);
digitalWrite(PropFourPin, High);
digitalWrite(PropTwoPin, High);
digitalWrite(PropOnePin, High);
digitalWrite(PropFivePin, High);
Delay(10000);

if (state == LOW) {
Serial.println("Motion detected!");
state = HIGH; // update variable state to HIGH
}
}
else {
digitalWrite(PropThreePin, Low);
digitalWrite(PropFivePin, Low);
digitalWrite(PropOnePin, Low);
digitalWrite(PropTwoPin, Low);
digitalWrite(PropFourPin, Low);
Delay(5000);

if (state == HIGH){
Serial.println("Motion stopped!");
state = LOW; // update variable state to LOW
}
}
}

Does that compile? Looks messed up.

int PropOnePin = 8;      //Prop One connected to digital pin 8
int PropTwoPin = 9;      //Prop One connected to digital pin 9
int PropThreePin = 10;   //Prop One connected to digital pin 10
int PropFourPin = 11;    //Prop One connected to digital pin 11
int PropFivePin = 12;    //Prop One connected to digital pin 12
int SensorPin = 2;       //Sensor connected to analog pin 3
int State = Low;         //by default, no motion detected
int SensorVal = 0;       //variable to store the value read

void setup() {
pinMode(PropOnePin,output);    //sets the digital pin as output
pinMode(PropTwoPin,output);    //sets the digital pin as output
pinMode(PropThreePin,output);  //sets the digital pin as output
pinMode(PropFourPin,output);   //sets the digital pin as output
pinMode(PropFivePin,output);   //sets the digital pin as output
pinMode(sensor, input);        //sets the sensor as an input
}

void loop(){
SensorVal = digitalRead(SensorPin);     //read the input pin
if (SensorVal == High)                 //Check if the sensor is HIGH
 { // wrong brace direction was here
digitalWrite(PropThreePin, High);
digitalWrite(PropFourPin, High);
digitalWrite(PropTwoPin, High);
digitalWrite(PropOnePin, High);
digitalWrite(PropFivePin, High);
Delay(10000);

 if (state == LOW) { // not same variable as above: int State = Low;  Case sensitive!
      Serial.println("Motion detected!"); 
      state = HIGH;       // update variable state to HIGH >> State
    }
  } 
  else {
digitalWrite(PropThreePin, Low);
digitalWrite(PropFivePin, Low);
digitalWrite(PropOnePin, Low);
digitalWrite(PropTwoPin, Low);
digitalWrite(PropFourPin, Low);
Delay(5000);

if (state == HIGH){  // >> State
        Serial.println("Motion stopped!");
        state = LOW;       // update variable state to LOW >> State
}
}

} // need one more to close out loop()
}

Fix the { and the names, that should help

All the int could be byte to save on SRAM.
And perhaps const byte for the pin assignments as they will not change.

This does not appear to be used:
pinMode(sensor, input); //sets the sensor as an input
Did you mean SensorPin instead?

I re-wrote the code but it still only lights the first LED. Do I need to tie a LOW signal variable to get it to go to the next LED? How is the best way to set my delay time if the average time between prop triggers is 45 seconds? I am still new to all of this programming language.

Here is how I changed the code and it does compile:

/*
Prop5
Turns on 5 various props at different time intervals.
*/

int led1 = 9; //the pin that the LED is attached to
int led2 = 10; //the pin that the LED is attached to
int led3 = 11; //the pin that the LED is attached to
int led4 = 12; //the pin that the LED is attached to
int led5 = 13; //the pin that the LED is attached to
int SensorPin = 2; //sensor connected to analog pin 2
int SensorVal = 0; //variable to store the value read

//the setup function runs once when triggered by the PIR
void setup() {

// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
//make the Sensor's pin an input;
pinMode(SensorPin, INPUT);
// initialize digital pin as an output.
pinMode(led1, OUTPUT); //sets the digital pin as output
pinMode(led2, OUTPUT); //sets the digital pin as output
pinMode(led3, OUTPUT); //sets the digital pin as output
pinMode(led4, OUTPUT); //sets the digital pin as output
pinMode(led5, OUTPUT); //sets the digital pin as output
}
void loop()
{
SensorVal = analogRead(SensorPin); //read the input pin
if (SensorVal>100)

digitalWrite(led1, HIGH);
delay(100);
digitalWrite(led2, HIGH);
delay(100);
digitalWrite(led3, HIGH);
delay(100);
digitalWrite(led4, HIGH);
delay(100);
digitalWrite(led5, HIGH);
delay(100);
}

Please use [ code ] tags. The forum software eats some of your code if you don’t.

What’s wrong with delay(45000)? That will give you 45 seconds of delay. It also prevents you from sensing anything else during that time but it doesn’t seem like that’s required for this project.