Those PIR sensors need 5volt power, but the internal circuitry runs on 3.3volt.
So they output 3.3volt HIGH when movement is sensed.
A Schottky diode has a lower voltdrop than a common diode, so more available for the Arduino.
The bleed resistor is not critical, but 1Megohm is a bit high for a leaky Schottky diode.
Anything between 10k and a few hundred k should work.
Leo..
So I have it set up right now on a breadboard with two mini PIR sensors and just 5V power and a multimeter. The power supply is going to the rails on the breadboard and PIRs are connected to the rails accordingly, positive and ground. I have IN4007 MIC diodes (didn’t receive others yet and had these at house so tried). The silver bands on the diodes are touching each other (plugged into same row of bread board) so opposite leg of each diode goes to a respective center out PIR sensor leg. I have the multimeter plugged into the ground rail (black wire) and where the two diode legs (silver band) combined in the breadboard to go into what would be the pin on the ESP pin I have the red cable of the multimeter.
I’m not sure what all this means but if no motion I’m running about .450 ISH volts up to 0.790 V. If one reads motion I get anywhere from 3.07 V to 3.2X ish V thereabout. When I get the higher numbers like 3.24 something volts when the motion stops the idle is more like 0.745 something volts. I haven’t tested if 3.07 V is enough to trigger motion in the ESP or not. Fingers crossed. Commonly, the power seems to be around 3.11 V whether one is detecting motion or two are detecting motion. Awesome! I don’t quite understand why but I’m excited that if the voltage is high enough they should do what I want it to.
Where am I putting this resistor in my example? Would the resistor help with smoothing out the weird inconsistent results with the up and down?
P.S. Sorry I don’t know how to make one of the diagrams that you guys have used or I would do so.
So I believe I measured a 10k resistor with my multimeter. Gold, orange, black, brown stripes. I put one leg of the resistor into the same row where the diodes come together and a wire to the ground rail of the other leg of the resistor. At the base of the diodes, I read 1.409 V when both detect motion, or 0.934 V when only one detects motion. With no motion at all, it is reading all zeros now where before it was between the 0.350 V and the 0.7 ish V. So this is not working as intended as the voltage is far too low to actually trigger a positive outcome. However it is getting rid of the small amount of power when no motion is detected. I’m going to see if I have a lower resistance resistor.
The bleed resistor to ground makes sure the ESP pin gets zero volt with no motion.
10k might be a too high load for a proper HIGH. As said, use 100k or so.
The Schottky diodes only drop about 0.25volt at that current vs. 0.5volt for the 1N4007.
That increases HIGH with another 0.25volt or so.
Leo..
Yes no motion was definitely getting zero which is great. Well like I said I do have the Schottky ordered. Hopefully here tomorrow. Not sure if I have higher resistors. You said 10k might be too high but then said 100k. Isn’t that higher? Oh I have so much to learn. Wouldn’t that take more power from when they are on motion trigger lowering voltage? I’ll see if I have any just to try. But of course I’ll try everything again once I have the correct diode since my testing has been flawed from that stand point.
We are so close, just can’t wait for it all to come together!
"load too high" = resistance too low ![]()
Leo..
Well, that makes more sense then. Hopefully I have something higher. Don’t want to have to wait ordering more parts!
OK, one down! Using the two 1N5819 Schottky diodes on my test rig gives me around 3.28 - 3.30V when motion is detected on either PIR or both at the same time and when no motion is detected the voltage on the meter is 0.00V! This is without any resistor from the signal pin to the ground rail. Great! Adding anything there actually is still lowering the signal voltage.
However, with that success comes new issues/complications. When I transfer the configuration from test rig to my project there is voltage detected at the signal pin just after the diodes again when no motion is present and worse the motion detected signal values are not ~3.30V as they were in the test rig and were quite a bit lower, so it is not turning the presence indicator on and off in the software. I unfortunately don't remember the values since this was last night but I think it was idle at ~0.5-0.6V when idle and I really don't recall the motion detected value now (i'll have to gather that today). I still don't have a resistor in there since I didn't have a need in the test rig and I don't have the higher resistor like 100k as suggested that I have found. I am ordering a pack that have seemingly all conceivable values https://www.amazon.com/gp/product/B09PLNPX3P/.
Theoretically, does it seem that with a high enough resistor this issue will be eliminated?
I guess with my limited understanding if things my best bet may be to create a test ESP8266 (d1mini) board the same as what I am using but only configure a single PIR pin without all my other sensors and see if it is working. This would then indicate something else I have plugged in is conflicting with the PIR setup I am trying to use.
What is the diagram tool you all are using so I can try and create a diagram for you all of what I have configured?
OK, I didn't get to test the higher resistor yet, but hopefully today. I did configure a test board that had only a NodeMCU and the two PIRs combined with the 1N5819 diodes with no resistor into one sensor pin (D1) and it worked beautifully. No matter which or both PIR(s) saw motion the software lit up for motion detected. I didn't get measurements though. So now to the real board with all the other sensors test with 100K and/or higher resistor. If that doesn't work I may have to add one item in at a time to the test board to find what else is throwing the values off.
Again, if someone can help me with what the diagram tool is that is making those sketches I'd appreciate it and could document the setup.
@bigwalnutz i fully understand what you're trying to accomplish, I've read the old discussions regarding this topic also, I'm trying to build a security system thay consists of multiple PIRs and also other sensors, LED display, a 4x4 keyboard, a camera,so I'm trying to save as many inputs as i could because my future plants is to add a robot as a master to all the sensors and for that i need the robot to detect every sensor input so that it would be able to locate where the breach is and execute the proper/specified code depending on when sensor detected HIGH and I can't come across any forum that would be able to help me out so most probably I'm going to accept the fact it's not possible to save inputs for my project, I know that my case is different than yours because i need to allocate where exactly the signal came from. Nevertheless, if anyone here has anything to share please feel free to.
If you are running out of pins you may want to look at https://www.arduino.cc/en/Tutorial/Foundations/ShiftOut and https://www.arduino.cc/en/Tutorial/Foundations/ShiftIn
I do actually believe that would come handy and actually solve my problem, I'll just buy another breadboard instead of an Arduino mega since I already have a 74HC595, Thank you so much.
Sorry, I was sick this past week and hadn't been able to continue working the issue to provide resolution for anyone else following this that may be looking for similar answers. I am hoping to get back to this in the next few days to very what is needed to make things all come together.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.