Properties of the signal pin on a PIR sensor

Hi

I have a small project, where I use a PIR sensor to detect motion. (One of these: http://www.ougar.dk/filer/pir_sensor.jpg)

It has 3 pins, VCC (5V), Ground, and a signal pin, which outputs high (3.3v) when movement is detected an 0V on idle.

I am a noob, and I would like to understand the properties of such a signal pin better.

Question 1:
Can I draw current from such a signal pin? Can I for instance connect the signal pin to a resistor and an LED and then to ground, to get a direct visual indication of the sensor reading? How much current can I draw? Can I read that in a datasheet somehow? In general: Does such a signal pin behave just like a "standard" output like a usual ardiuno output port?

Question 2:
What happens if I "override" the signal, by forcing the signal pin high or low by connecting to ground or 3.3V with a pushbutton? I want to be able to have a manual activation button as well as activation by sensor, and simply forcing the signal pin high or low seems like a VERY simple way to do that. Can I do that directly? What happens when I connect a signal pin, which is LOW directly to 3.3V Do I damage the PIR sensor? Or damage the arduino? By trying to draw too much current? Or will the signal pin just be forced to HIGH as I want to?

Or could force it high safely by using a resistor between the signal pin and the forced high input pin to the arduino?

I hope it makes sense, and sorry if the question is very simple :slight_smile: Thanks in advance for any input.

Hi, welcome to the forum.

My advice is: don't do anyting with the PIR module output. Connect it to an digital input of an Arduino, nothing else.
You may certainly not override the signal. In the software (the sketch) you can decide what to do with the signal.

The output is sometimes an open collector output. I have connected such a module to a 5V Arduino board, and I used "pinMode(2, INPUT_PULLUP) ;". The internal pullup resistor helps the signal to get a little higher.

Adafruit connects a led to the pir output in the tutorial : Overview | PIR Motion Sensor | Adafruit Learning System
Perhaps the PIR module sold by Adafruit can do that. I don't know if every PIR module can do that.

I would expect that a sensor with 5v for Vcc would output a signal at 5v. I would also expect an open collector, though there may be a pull up R on the board to give a high signal.

I agree with the above re not doing anything but connecting to an input of the Arduino. If you want a button override, use another input.

Weedpharma

They have a voltage regulator of 3.3V. That voltage regulator requires more current than the rest of the PIR module. That means for battery operation, a 3.3V Arduino and the PIR module with the voltage regulator removed require only micro-amps.

Peter_n:
Hi, welcome to the forum.

Thank you.

weedpharma:
I would expect that a sensor with 5v for Vcc would output a signal at 5v.

Well, I thought so too, but it's not. The input is actually 3.6V to 20V, while the output is 3.3V. That's what the specifications says on the homepage where I bought it: PIR sensormodul - 120° 7m - 3,6-20Vdc (HC-SR501). And I confirmed the output voltage of 3.3V with a multimeter.

Peter_n:
My advice is: don't do anyting with the PIR module output. Connect it to an digital input of an Arduino, nothing else. You may certainly not override the signal. In the software (the sketch) you can decide what to do with the signal.

Great. Thank you. I won't try that.

Peter_n:
The output is sometimes an open collector output.

What does that mean for my circuit? I have tried to read about "open collector" on wiki, but I dont understand the implications for my circuit.

Thanks very much for your replies :slight_smile:

Use it as they show in the picture with an Arduino.

Here is a schematic for the PIR module (scroll down) : http://www.electrodragon.com/w/index.php?title=HC-SR501_PIR_Motion_Sensor_(Passive_Infrared_Sensor)
The output is an output pin of the BISS0001 chip. I checked the datasheet of that chip, and it says that the output current is 10mA. I guess it is a digital output that is either 0V or 3.3V, so it is not an open collector output.

49 DKK = 6.57 EUR,
They can't be compared, because there are differences in the type, and for the same type one PIR module might have good components, and another might have bad components.
However, I think that PIR module from elextra.dk (type hc-sr505) should cost no more than 2 euros, and perhaps 3 euros in a shop in Europe.
Adafruit : 9.95 dollars
Sparkfun : 9.95 dollars
Ebay : 1 dollar

I have also a small one from Ebay, it works as well (I only needed a maximum distance of 6 meters).

Peter_n:
Use it as they show in the picture with an Arduino.

Here is a schematic for the PIR module (scroll down) : http://www.electrodragon.com/w/index.php?title=HC-SR501_PIR_Motion_Sensor_(Passive_Infrared_Sensor)
The output is an output pin of the BISS0001 chip. I checked the datasheet of that chip, and it says that the output current is 10mA. I guess it is a digital output that is either 0V or 3.3V, so it is not an open collector output.

OK. So does that mean, that when the output is high (3.3V) I need to have at least 330 Ohm resistance (3.3V/10mA) between the output and ground, to keep the current below 10mA? And if I somehow try to draw more than 10mA, I risk damaging the chip? And that I could for instance use the output to drive an LED by connecting the output to an LED and a resistor in series and then to ground, as long as I keep the current below 10mA?

Peter_n:
49 DKK = 6.57 EUR,

Yep. Its bloody expensive. But it's the only place i know in Copenhagen, where I can get electronic stuff without having to wait. And sometimes I am very impatient :slight_smile: I have started to buy more stuff on ebay. I just ordered a bunch of stuff from China, just to see if it works out. Some of the stuff is REDICULOUSLY cheap. I ordered 10 small lasers for €1.50 (total) in stead of 1 laser for 15€ at my physical Elextra shop. It's completely crazy, that they can sell a small laser for €0.15.

The schematic shows there is already a resistor of 1k in the output signal. So you can do whatever you want with the output signal, the current is already limited.
But please forget about that. Connect it to an Arduino digital input, and nothing else.

Perhaps that resistor is omitted in the module, or just any resistor is put there. Perhaps you have a different PIR sensor, and the schematic is for an other sensor. Perhaps you want to exchange the PIR module some day, and the new PIR sensor is totally different.

Therefor, please don't do funny things with it, connect the output to an Arduino input, or else you might get into trouble (or not :grin: ).

Things on Ebay are cheap, but they are often make with very cheap components, sometimes even counterfeit components. I don't use power supplies (like wall warts) from Ebay anymore, because they are not safe. However, I do use cheap small sensors, motors, pumps, and so on.