You only get about 2.75volt on the Arduino pin with an "OR" made with diodes and a resistor.
That is out of specs for the pin on a 5volt Arduino. One day it might work, another day not.
A solution is to connect your diode "OR" to the base of a small NPN transistor.
Emitter to ground, and the collector to the input pin with the internal pull up resistor enabled in pinMode.
pinMode(pirPin, INPUT_PULLUP);
Reversed logic now (HIGH when nothing detected and LOW when a PIR is triggered).
This way the pin gets a properly defined HIGH or LOW.
Lower the resistor to 100k or so for better noise imunity.
Leo..
Yes, I guess you are right, I have now 2.93V when the LED turns on, so this day 2.93volt works
And when the LED is not turned on, there is 0.14V in the output, which I guess is not good.
As you said it should be about 3.3V output, and are you sure I have to use transistors?
Ok, no problem for me, transistors are not so expensive either, but could you give me a schematics of what you write and what you mean? I am not so good with English (I am Swedish).
I think I understand what you mean, but it would be great if you could draw a schematics. Or if I draw a schematics of what I think you mean, and you can say yes or no
