5
\$\begingroup\$

This is my first time to use PIR (HC-SR501 ) . It's in repeat trigger model. But when I test the output of the PIR , it gives always HIGH . enter image description here

I rotate sensitivity adjustment and time delay adjustment randomly to see any changes occur. I even cover the sensor with cloth so that It get's no infrared . still it gives high. I changed my sensor and bought a new one. This shows the same problem too. arduino code :

int PIC_IN = 10;
int LED = 13;


void setup()
   {
  Serial.begin(9600);
   pinMode(PIC_IN, INPUT);

  digitalWrite(LED, LOW);
   }

void loop()
{
  int val = digitalRead(PIC_IN);
   if (val == HIGH)
   {
  Serial.println("Moton detected");
  digitalWrite(LED, HIGH);
   }
else
   {
    Serial.println("...........");
  digitalWrite(LED, LOW);
    }
  }

here is the link for PIR Datasheet.

What I am doing wrong ? I have no clue why it's not working.

\$\endgroup\$
  • \$\begingroup\$ What is your code? And what voltage are you using? \$\endgroup\$ – Passerby Mar 3 '16 at 20:17
  • \$\begingroup\$ What happens when you set it to single-trigger mode? \$\endgroup\$ – brhans Mar 3 '16 at 20:19
  • \$\begingroup\$ I use 5V (from arduino) \$\endgroup\$ – Anklon Mar 3 '16 at 20:39
  • 2
    \$\begingroup\$ Please include link to datasheet (so that all of us don't have to search for it). Did you check the voltage out of the PIR? This will help you determine whether the PIR is working or not and if it is it will point to a connection or code error. Please use the schematic editor button to add a diagram. Place all the information in your original question and not in the comments. \$\endgroup\$ – Transistor Mar 3 '16 at 20:45
  • \$\begingroup\$ Output voltage of PIR is 3.9 V \$\endgroup\$ – Anklon Mar 3 '16 at 21:07
4
\$\begingroup\$

I finally found a solution to this problementer image description here First you should adjust the delay knob to the left as min delay time.After connecting the power to the sensor, you should wait 1 min for the sensor to warm up, Now the sensor is ready to use and before this time its performance won't be stable. Also remember when you the sensor signal moves from high to low, it take around 5 seconds out of service, after than you can trigger it again.

After make sure it work properly you can increase the delay a little bit to increase the on time ^_^...

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

You need to check if the voltage on the PIR output switches. Use a multimeter to measure the voltage between OUT and GND.

If you don't see any change in level then you may need to add a "pull-up" resistor. If you have a 10 k resistor to hand then connect that between OUT and the 5 V supply. If this works then you need to enable the internal pull-up resitor on the Arduino. See the documentation for that.

If that still doesn't work then measure the voltage between the PIR sensor pin 2 and GND while someone fires an infra-red remote control beam at it. You should see a change in voltage.

Report back and we'll try and help.

| improve this answer | |
\$\endgroup\$
  • 3
    \$\begingroup\$ PIR sensors typically shouldn't respond to a IR remote led... \$\endgroup\$ – Passerby Mar 3 '16 at 21:55
  • \$\begingroup\$ And just tested it, definitely won't trigger. \$\endgroup\$ – Passerby Mar 4 '16 at 2:15
  • \$\begingroup\$ Thanks for that. I hadn't tested. An incandescent bulb would be the next suggestion. Wouldn't it :-? \$\endgroup\$ – Transistor Mar 4 '16 at 9:28
2
\$\begingroup\$

If Vcc accidentally is only 3.3V, the HC-SR501 continuously retriggers independent of motion or the sensitivity setting (about 1s break between triggers, trigger length defined by right potentiometer).

Even though the output is rated at 3.3V, the input is expected to be 5-20V.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

It can probably see through the cloth. When it first starts up, you need to not move for up to 60s while it calibrates.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I sit still more then 60s for it to calibrate . \$\endgroup\$ – Anklon Mar 3 '16 at 20:34
  • 1
    \$\begingroup\$ From the specs: Sensor module is powered up after a minute, in this initialization time intervals during this module will output 0-3 times, a minute later enters the standby state. \$\endgroup\$ – angelcervera Dec 11 '16 at 8:50
0
\$\begingroup\$

Connect it to analog input and check the value in serial read. Leave results afterward.

beside that, try to adjust those potentiometers that are on bottom side. Maybe they're just at one most-left/right position. Also, check if they are soldered on PCB. Might be also a "bad sensor", I assume it's bought from China?

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

I encountered the same problem. The solution was simple in my case. Check if your + and ground are connected correctly!! If you look at the image you would suggest that the left cable is the + (red cable). But if you look at the connection sheet HC-SR501 this is the ground connection. And so you could be tricked by having it connected as the drawing suggests.

| improve this answer | |
\$\endgroup\$
-1
\$\begingroup\$

First check with manufacturer's diagrams!!!

mine was having +ve and -ve contrariwise and giving 5v at output pin always. Reversing the input made output of ~3v to only when it triggered.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.