I am, a starter with arduino , using a uno3 compatible board. I ama good enough programmer without a electronic background..
recently I bought a pir sensor and tried experimenting with it. My expectation was to see a high or low when I am I front of it and opposite when I move away. How ever when I print the state to serial, I see high for a few seconds then low for few seconds and so on. It keeps alater aging by itself even when there is no subject I front of it.
Am I to do some adjustments or is this simply a defective item ?
Turn the “time” pot fully anti-clockwise, so the ‘on’ time is very short (a few seconds, not 7minutes).
Leaven the “sensitivity” pot in the middle.
Let Arduino extend the “on time” if needed.
PIR sensors detect MOVING warm objects between the segments of the fresnel lens that is covering the sensor.
That could be a human being, or cat, or the rising air of a heater.
They are very sensitive (>7meters).
AFAIK the sensitivity pot has nothing to do with range, but with how many detections are needed to change the outut to high.
Thank you I will try that and post back. But for more Info I also observed that after leaving it alone for any amount of time, when I go and move infront of it it detects nothing not even in close proximity. The alternating blocks of high and low continues. Only when I hold it in hand it goes to low till I keep it back.
I am back from some testing. i am lost i must admit and feel stupid. I bought 2 more sensors and they are also acting in the same way. either all are defective or i have no clue to what i should be expecting.
Here is what my console output:
int pirPin = 2; //the digital pin connected to the PIR sensor's output
int ledPin = 13;
val = digitalRead(pirPin);
if(val == HIGH)
So whether i stand in front of sensor or not it does not matter ? Then how does it work ?
I have exactly the same PIR detectors. They usually work faultlessly and are very reliable. I’ve had a pair of them running for about a year now without problems.
They’re different to the one shown in Brayd’s link. They are not open-collector and, as pointed out by Wawa, don’t require a pullup resistor.
The output signal is 3.3V, active-high.
Operating voltage range is 4.5V to 20V.
Calibration time after powerup is about 35 seconds with these units, so in my firmware I wait 40 seconds before reading the PIR pin. There is no need to cover the module during this period. (That might negatively affect the calibration.)
This is the (pidgin English) info from the eBay listing:-
The automatic sensor: to enter the sensor output range is high, people leave the sensor range of the automatic
delay off high, output low.
The photosensitive control (optional, factory is not set) may set the photosensitive control during the day or
light intensity without induction.
The temperature compensation (optional, factory is not set): In the summer when the ambient temperature rises
to 30 ~ 32 ℃, slightly shorter detection range, temperature compensation can be used as a performance compensation.
Two trigger mode: (can be selected by jumpers)
With induction blocking time (the default setting: 2.5S block time)
The output high level signals
Product Type: HC–SR501 Body Sensor Module
Operating voltage range: DC 4.5-20V
Quiescent Current: <50uA
Level output: High 3.3 V /Low 0V
Trigger: L can not be repeated trigger/H can be repeated trigger(Default repeated trigger)
Delay time: 5-200S(adjustable) the range is (0.xx second to tens of second)
Block time: 2.5S(default)Can be made a range(0.xx to tens of seconds
Board Dimensions: 32mm*24mm
Angle Sensor: <100 ° cone angle
Operation Temp: -15-+70 degrees
Size:3.2 x 2.5 x 2.5cm(L x W x H)
Here’s a clearer pic of the back of one of one of the boards that I have, for comparison:-
I have already tried 3 sensors. some people say on this forum its normal. i don't understand how that could be so. If its really going to do all that by itself where si the trigger ? i just got started with this stuff and simple stuff like buzzer beep / led light up etc work just fine. But PIR sensor is not something I am understanding.
Edit: i will remove breadboard from the equation and try again.
WOAH believe ti or not it works as i expect when i get rid of the breadboard.!!!! YIPPEE !!. So one question is it that bread board is faulty ? or something else ? cause when i need to multiplex stuff i will need breadboard. what to do then ?
Ok i understood your point and i checked some things on the board for my knowledge. Thank you very much to everyone on this forum for helping me getting started on arduino. thank you for The product specs, for the troubleshooting and everything. Arduino rocks!!