Please, I have a problem, with my PIR motion detector.
I don't know why, but even when nothing is moving, it is still reading high, and it's frustrating
Please, I have a problem, with my PIR motion detector.
I don't know why, but even when nothing is moving, it is still reading high, and it's frustrating
You started a topic in the Uncategorised category of the forum whose description is
DO NOT CREATE TOPICS IN THIS CATEGORY
Your topic has been moved to the Programming category
Please post your sketch, using code tags when you do, and a schematic of your project. A photo of a hand drawn circuit is good enough
Mine’s working fine, it must be your battery.
the below is the sketch
int ledpin = 6;
int motion = 9;
void setup() {
Serial.begin(9600);
pinMode(6, OUTPUT);
pinMode(9, INPUT);
}
void loop() {
int motion = digitalRead(9);
Serial.print("motion value =");
Serial.println(motion);
delay(1000);
if(motion == 1){
digitalWrite(6, HIGH);
} else{
digitalWrite(6, LOW);
}
}
My cIrcuit is connected to my PC
Is the LED backward?
Maybe i made mistake with this sketch, but its not irl. the longer is connected to the arduino, and the shorter is connected to the resistor and ground
the real problem is with the pir sensor. it is reading high, even when no movement is made. it has been reading high since i uploaded the code.
my friend told me to reduce the sensitivity, i did, and its still the same thing
Adafruit has a page on testing a PIR that you might find useful.
And guys, the circuit is correct, and the code also. It is running perfectly in the simulation. The problem is with the motion sensor in real life. It is reading high, even when nothing is moving.
I don't get it. It's still not working.
guys please, help me
You performed all the steps that were laid out on the testing page? In under 12 minutes?
yes(sorry for late reply), i was doing a house chore
the led now is just blinking.
it's blinking and changing brightness, not on and off
Do you have a link to the exact PIR?
I bought a bunch that were very inexpensive and got what I paid for. Junk.
a7
i bought mine from the market physically. then, i think its my pir that is the problem
Post good pictures, top and bottom.
TIA
a7
my phone camera is really bad, it may not capture it well.