PIR HC-Sr505 usage

I have been wanting to try the common mini PIR HC-Sr505 from Ebay.
But, I found the Delay was too long, about 10 seconds between Sense On and Off.

I replaced the TC cap of 0.1uF (?) with 22pF - 100pF to speed up the Sense Toggles to 0.1sec - 1sec.
This seems to perform its function.
The only problem I see , is the Boot-up takes about 10 seconds - before the Sensor Out turns Off.

  • Any ideas ?

This is the Circuit :

This is the board with the Cap circled in Red :

_HC-Sr505_Cap.png

_HC-Sr505_Cap.png

This is the Sketch that I used to test it on the Arduino :

/// PIR_SR505_Test_1.ino ///

/// 
/// HC-SR505 - replace Center CAP 1nF with 100pF or 10pF 
///   1nF     10sec delay 
///   100pF  1sec delay 
///   10pF    0.1sec delay
///

#define   PIRPIN   8   // This is the D8 pin that we are going to use
#define   LEDPIN   13

unsigned long motionDelay = 5000;   // Motion Delay Timer
//unsigned long motionDelay = 3000;   // Motion Delay Timer
//unsigned long motionDelay = 1000;   // Motion Delay Timer
//unsigned long motionDelay = 100;    // Motion Delay Timer

boolean inMotion = false;  // Motion sensor need to be read or not flag

int  Cnt = 0;

void setup() 
{
  pinMode(PIRPIN, INPUT); 
  pinMode(LEDPIN,OUTPUT);

  Serial.begin(9600); 
}

void loop() 
{

  if ( digitalRead(PIRPIN) == HIGH  &&  ! inMotion )
  {

    Cnt ++ ;
    Serial.print("Motion Detected ");
    Serial.print(Cnt);
    Serial.println("");

    inMotion = true;
    digitalWrite(LEDPIN,1);

  } 
  else 
  
  if ( digitalRead(PIRPIN) == LOW )
  {

    if(inMotion == false)
      Cnt = 0;
      
    inMotion = false;
    digitalWrite(LEDPIN,0);

  }
  
  else
  {
    ;
  }

}

jlsilicon:
The only problem I see , is the Botup takes about 10 seconds - before the Sensor Out turns Off.

  • Any ideas ?

Not without knowing what this "Botup" refers to.

If the botup takes 10 seconds, then wait for it.
Put a 12 second delay in setup().

...
Serial.begin(9600);
delay(10);
Serial.print("Waiting for botup... ");
delay(12000);
Serial.println("Done\n");
}

Leo..

Oh... "Botup" is supposed to mean "boot up" or "starting up"?! Yes, then just wait for it. It's also one of the very few times that I can agree with a delay(12000); call :slight_smile:

I'm working with the HC-SR505 right now for a project and found this thread.

My application also requires a reliable PIR body detector, but very little delay. I tried nearly all the PIR modules on Amazon, but they all were either unreliable or had a delay that could not be changed.

So I have settled on the HC-SR505. It is very solid and reliable. But I needed to reduce the delay to under 1 second, and I agree with the OP that you can change capacitor Ct and get very short delays.

In case anyone else finds this thread, I created a spreadsheet to calculate the values of Ct (the capacitor that is pointed out in the photo earlier in this thread) that are required for various time delays. Here is an image of the table:

I have attached a PDF of this table, and a live Excel file with the formula to this post.

I hope this helps someone. :wink:

--Jim

EG4001 HC-SR505 PIR Decector Delay Calculation.pdf (122 KB)

EG4001 HC-SR505 PIR Decector Delay Calculation.xlsx.zip (8.88 KB)

1 Like

Thank you all. This was exactly what I waas looking for re reducing the delay to a useful time for me.

Did anyone find a way to reduce the bootup time?
Is it perhaps to allow the PIR to settle to a a "steady" state or "log" what is the ambient IR reading?

--Euan.