user63944: I want to make the PIRs to stay on for about 1 minute. I've found the code that can do so for 1 PIR, but I dont know how to apply the code for 3 PIRs.
Here is the code for 1 PIR with timer using millis:
int ledPin = 8;
int pirPin = 3;

unsigned long piron;
//the time we give the sensor to calibrate (10-60 secs according to the datasheet)
int calibrationTime = 10;       

int off;
int on;
const int LDR = A0;
int ldrStatus;

unsigned long currentMillis =( millis()/1000 ) / 60;

/////////////////////////////
//SETUP
void setup(){
  Serial.begin(9600);
  pinMode(pirPin, INPUT);
  pinMode(ledPin, OUTPUT);
  digitalWrite(pirPin, LOW);


  //give the sensor some time to calibrate
  Serial.print("calibrating sensor ");
    for(int i = 0; i < calibrationTime; i++){
      Serial.print(".");
      delay(1000);
      }
    Serial.println(" done");
    Serial.println("SENSOR ACTIVE");
    delay(50);
  }

////////////////////////////
//LOOP
void loop()

{  
ldrStatus = analogRead (LDR);
if (ldrStatus <= 700)     // variable reading(ldrStatus) according to ldr 
                          // the higher reading(ldrStatus), the dimmer light
                          // the lower the reading(ldrStatus), the brighter light

{
analogRead (pirPin) == off;

Serial.println ("Its SUNNY DAY !!!");
digitalWrite(ledPin, LOW);

}


if (ldrStatus >= 700)
{
Serial.println ("Its DARK already");

    if(digitalRead(pirPin) == HIGH){
       digitalWrite (ledPin, HIGH);
     piron = ( millis()/1000 ) / 60;
  }



  if ((currentMillis - piron) > 1) {
    digitalWrite(ledPin, LOW);

  }

    }
}
`


and here is the code for 3 PIRs without the timer

    int calibrationTime = 10;       


int pirPin = 3;    
int ledPin = 8;

int pirPin1 = 4;   
int ledPin1 = 9;

int pirPin2 = 5;    
int ledPin2 = 10;

int ledPin3 = 11;

int off;
int on;
const int LDR = A0;
int ldrStatus;


/////////////////////////////
//SETUP
void setup(){
  Serial.begin(9600);
  pinMode(pirPin, INPUT);
  pinMode(ledPin, OUTPUT);
  digitalWrite(pirPin, LOW);

   pinMode(pirPin1, INPUT);
  pinMode(ledPin1, OUTPUT);
  digitalWrite(pirPin1, LOW);

   pinMode(pirPin2, INPUT);
  pinMode(ledPin2, OUTPUT);
  digitalWrite(pirPin2, LOW);

 pinMode (ledPin3, OUTPUT);

  //give the sensor some time to calibrate
  Serial.print("calibrating sensor ");
    for(int i = 0; i < calibrationTime; i++){
      Serial.print(".");
      delay(1000);
      }
    Serial.println(" done");
    Serial.println("SENSOR ACTIVE");
    delay(50);
  }

////////////////////////////
//LOOP
void loop()
{
ldrStatus = analogRead (LDR);
if (ldrStatus <= 700)     // variable reading(ldrStatus) according to ldr 
                          // the higher reading(ldrStatus), the dimmer light
                          // the lower the reading(ldrStatus), the brighter light

{
analogRead (pirPin) == off;
analogRead (pirPin1) == off;
analogRead (pirPin2) == off;
Serial.println ("Its SUNNY DAY !!!");
digitalWrite(ledPin, LOW);
digitalWrite(ledPin1, LOW);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
}


if (ldrStatus >= 700)
{
Serial.println ("Its DARK already");
digitalWrite(ledPin3, HIGH);    

    if(digitalRead(pirPin) == HIGH && digitalRead(pirPin1)== LOW && digitalRead(pirPin2) == LOW){
      digitalWrite (ledPin, HIGH);
      digitalWrite(ledPin1, LOW);
      digitalWrite(ledPin2,LOW);
    }



    if(digitalRead(pirPin) == LOW && digitalRead(pirPin1)== HIGH && digitalRead(pirPin2) == LOW){
      digitalWrite (ledPin1, HIGH);
      digitalWrite (ledPin, LOW);
      digitalWrite(ledPin2,LOW);

}
   if(digitalRead(pirPin) == LOW && digitalRead(pirPin1)== LOW && digitalRead(pirPin2) == HIGH){
      digitalWrite (ledPin2, HIGH);
      digitalWrite (ledPin1, LOW);
      digitalWrite (ledPin, LOW);

   }



     if(digitalRead(pirPin) == HIGH && digitalRead(pirPin1)== HIGH && digitalRead(pirPin2) == LOW){
    digitalWrite (ledPin1, HIGH);
    digitalWrite (ledPin, HIGH);
    digitalWrite (ledPin2, LOW);

}

     if(digitalRead(pirPin) == HIGH && digitalRead(pirPin1)== LOW && digitalRead(pirPin2) == HIGH){
      digitalWrite (ledPin, HIGH);
      digitalWrite (ledPin2, HIGH);
      digitalWrite (ledPin1, LOW);
     }


     if(digitalRead(pirPin) == LOW && digitalRead(pirPin1)== HIGH && digitalRead(pirPin2) == HIGH){
     digitalWrite (ledPin2, HIGH);
     digitalWrite (ledPin1, HIGH);
     digitalWrite (ledPin, LOW);
     }



    if(digitalRead(pirPin) == HIGH && digitalRead(pirPin1)== HIGH && digitalRead(pirPin2) == HIGH){
      digitalWrite (ledPin2, HIGH);
      digitalWrite (ledPin1, HIGH);
      digitalWrite (ledPin, HIGH);

    }


     if(digitalRead(pirPin) == LOW && digitalRead(pirPin1)== LOW && digitalRead(pirPin2) == LOW){
      digitalWrite (ledPin2, LOW);
      digitalWrite (ledPin1, LOW);
      digitalWrite (ledPin, LOW);
     }

}

}


user40318: This is not a complete answer, but an idea of how to accomplish the task.
I just typed it in without testing the code.
Use arrays to hold variables. That way a loop can be used to service the three sensors and the three LEDs..
for (i = 0; i<3; i++) {                                              
   currentTime = millis();                             // save current millis() value

   if (digitalRead(pirPin[i]) == HIGH) {               // check if PIR is detecting motion
      trigTime[i] = millis();                          // save trigger time
      trig[i]     = true;                              // set a state variable that indicates
   }                                                   //   that a trigger happened


   if (trig[i]) {                                      // if trigger happened
      if (currentTime - trigTime[i] < 50000) {         // is it less than 50 sec since last motion?
         digitalWrite (ledPin[i], HIGH);
      }
      else { 
         trig[i] = false;                              // 50 second timer ran out
         digitalWrite (ledPin[i], LOW);
      }
   }
}


63944: <p>I want to make the PIRs to stay on for about 1 minute. I've found the code that can do so for 1 PIR, but I dont know how to apply the code for 3 PIRs.</p>

<p>Here is the code for 1 PIR with timer using <code>millis</code>:</p>

<pre><code>int ledPin = 8;
int pirPin = 3;

unsigned long piron;
//the time we give the sensor to calibrate (10-60 secs according to the datasheet)
int calibrationTime = 10;       

int off;
int on;
const int LDR = A0;
int ldrStatus;

unsigned long currentMillis =( millis()/1000 ) / 60;

/////////////////////////////
//SETUP
void setup(){
  Serial.begin(9600);
  pinMode(pirPin, INPUT);
  pinMode(ledPin, OUTPUT);
  digitalWrite(pirPin, LOW);


  //give the sensor some time to calibrate
  Serial.print("calibrating sensor ");
    for(int i = 0; i &lt; calibrationTime; i++){
      Serial.print(".");
      delay(1000);
      }
    Serial.println(" done");
    Serial.println("SENSOR ACTIVE");
    delay(50);
  }

////////////////////////////
//LOOP
void loop()

{  
ldrStatus = analogRead (LDR);
if (ldrStatus &lt;= 700)     // variable reading(ldrStatus) according to ldr 
                          // the higher reading(ldrStatus), the dimmer light
                          // the lower the reading(ldrStatus), the brighter light

{
analogRead (pirPin) == off;

Serial.println ("Its SUNNY DAY !!!");
digitalWrite(ledPin, LOW);

}


if (ldrStatus &gt;= 700)
{
Serial.println ("Its DARK already");

    if(digitalRead(pirPin) == HIGH){
       digitalWrite (ledPin, HIGH);
     piron = ( millis()/1000 ) / 60;
  }



  if ((currentMillis - piron) &gt; 1) {
    digitalWrite(ledPin, LOW);

  }

    }
}
`


and here is the code for 3 PIRs without the timer

    int calibrationTime = 10;       


int pirPin = 3;    
int ledPin = 8;

int pirPin1 = 4;   
int ledPin1 = 9;

int pirPin2 = 5;    
int ledPin2 = 10;

int ledPin3 = 11;

int off;
int on;
const int LDR = A0;
int ldrStatus;


/////////////////////////////
//SETUP
void setup(){
  Serial.begin(9600);
  pinMode(pirPin, INPUT);
  pinMode(ledPin, OUTPUT);
  digitalWrite(pirPin, LOW);

   pinMode(pirPin1, INPUT);
  pinMode(ledPin1, OUTPUT);
  digitalWrite(pirPin1, LOW);

   pinMode(pirPin2, INPUT);
  pinMode(ledPin2, OUTPUT);
  digitalWrite(pirPin2, LOW);

 pinMode (ledPin3, OUTPUT);

  //give the sensor some time to calibrate
  Serial.print("calibrating sensor ");
    for(int i = 0; i &lt; calibrationTime; i++){
      Serial.print(".");
      delay(1000);
      }
    Serial.println(" done");
    Serial.println("SENSOR ACTIVE");
    delay(50);
  }

////////////////////////////
//LOOP
void loop()
{
ldrStatus = analogRead (LDR);
if (ldrStatus &lt;= 700)     // variable reading(ldrStatus) according to ldr 
                          // the higher reading(ldrStatus), the dimmer light
                          // the lower the reading(ldrStatus), the brighter light

{
analogRead (pirPin) == off;
analogRead (pirPin1) == off;
analogRead (pirPin2) == off;
Serial.println ("Its SUNNY DAY !!!");
digitalWrite(ledPin, LOW);
digitalWrite(ledPin1, LOW);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
}


if (ldrStatus &gt;= 700)
{
Serial.println ("Its DARK already");
digitalWrite(ledPin3, HIGH);    

    if(digitalRead(pirPin) == HIGH &amp;&amp; digitalRead(pirPin1)== LOW &amp;&amp; digitalRead(pirPin2) == LOW){
      digitalWrite (ledPin, HIGH);
      digitalWrite(ledPin1, LOW);
      digitalWrite(ledPin2,LOW);
    }



    if(digitalRead(pirPin) == LOW &amp;&amp; digitalRead(pirPin1)== HIGH &amp;&amp; digitalRead(pirPin2) == LOW){
      digitalWrite (ledPin1, HIGH);
      digitalWrite (ledPin, LOW);
      digitalWrite(ledPin2,LOW);

}
   if(digitalRead(pirPin) == LOW &amp;&amp; digitalRead(pirPin1)== LOW &amp;&amp; digitalRead(pirPin2) == HIGH){
      digitalWrite (ledPin2, HIGH);
      digitalWrite (ledPin1, LOW);
      digitalWrite (ledPin, LOW);

   }



     if(digitalRead(pirPin) == HIGH &amp;&amp; digitalRead(pirPin1)== HIGH &amp;&amp; digitalRead(pirPin2) == LOW){
    digitalWrite (ledPin1, HIGH);
    digitalWrite (ledPin, HIGH);
    digitalWrite (ledPin2, LOW);

}

     if(digitalRead(pirPin) == HIGH &amp;&amp; digitalRead(pirPin1)== LOW &amp;&amp; digitalRead(pirPin2) == HIGH){
      digitalWrite (ledPin, HIGH);
      digitalWrite (ledPin2, HIGH);
      digitalWrite (ledPin1, LOW);
     }


     if(digitalRead(pirPin) == LOW &amp;&amp; digitalRead(pirPin1)== HIGH &amp;&amp; digitalRead(pirPin2) == HIGH){
     digitalWrite (ledPin2, HIGH);
     digitalWrite (ledPin1, HIGH);
     digitalWrite (ledPin, LOW);
     }



    if(digitalRead(pirPin) == HIGH &amp;&amp; digitalRead(pirPin1)== HIGH &amp;&amp; digitalRead(pirPin2) == HIGH){
      digitalWrite (ledPin2, HIGH);
      digitalWrite (ledPin1, HIGH);
      digitalWrite (ledPin, HIGH);

    }


     if(digitalRead(pirPin) == LOW &amp;&amp; digitalRead(pirPin1)== LOW &amp;&amp; digitalRead(pirPin2) == LOW){
      digitalWrite (ledPin2, LOW);
      digitalWrite (ledPin1, LOW);
      digitalWrite (ledPin, LOW);
     }

}

}
</code></pre>
 40318: <p>This is not a complete answer, but an idea of how to accomplish the task.</p>

<p>I just typed it in without testing the code.</p>

<p>Use arrays to hold variables. That way a loop can be used to service the three sensors and the three LEDs..</p>

<pre><code>for (i = 0; i&lt;3; i++) {                                              
   currentTime = millis();                             // save current millis() value

   if (digitalRead(pirPin[i]) == HIGH) {               // check if PIR is detecting motion
      trigTime[i] = millis();                          // save trigger time
      trig[i]     = true;                              // set a state variable that indicates
   }                                                   //   that a trigger happened


   if (trig[i]) {                                      // if trigger happened
      if (currentTime - trigTime[i] &lt; 50000) {         // is it less than 50 sec since last motion?
         digitalWrite (ledPin[i], HIGH);
      }
      else { 
         trig[i] = false;                              // 50 second timer ran out
         digitalWrite (ledPin[i], LOW);
      }
   }
}
</code></pre>
