Hi, I'm relatively new to programming with the arduino. I hope my problem is easier too solve then it looks for me.
I want to make a night light which lights up when im standing up.
My Problem: no matter what i put into the pir pin, the lights light up. a single wire not even connected to the pir is enough. Maybe you guys can help me.
they even light up when i put a wire in pin 6. which is not in use
I am assuming that putting the wire in Pin6 involves removing it from pin 5. I notice this pin is set as just an input, with nothing attached to it it could read as any value. We say it is floating.
If your PIR sensor has an open collector output it will need a pull up resistor on the Arduino. You can use the internal ones on the Arduino by using the following line in the setup function:-
I had a same problem with a PIR sensor and a 4 digit 7-segment LED display. The LED display generated noise that caused the PIR sensor to be "on" all the time.
Is solved it by adding a LC filter on the power line to the PIR sensor.