How PIR modules work and using them to control LED strings.
Вставка
- Опубліковано 22 лип 2024
- Thanks to the wonders of the Arduino, there are a load of useful electronic modules available on ebay at ridiculously low prices. You don't need an Arduino to use many of these devices, so here's how you can add a buffer transistor to a PIR module to let it switch strings of battery operated LED lights.
The typical quiescent current of these PIR modules is just 50uA (50 micro Amps) so they will run a VERY long time on a set of rechargeable cells before they need recharged. The time they last depends on how often the lights are triggered.
This allows the possibility of an outdoor Xmas tree in the middle of nowhere that turns on whenever anyone walks near it and then turns off when they leave. Add a solar panel to top up the batteries and you could have a very low maintenance decorative effect.
As mentioned in the video, the modules may have a movable link that can switch between two modes. retriggerable and non-retriggerable. In non-retriggerable mode the lights will turn on for a fixed time and then turn off again even if there is continuous movement, but then re-trigger again for another time cycle. In retriggerable mode the timer keeps being reset every time movement is detected, meaning the lights will simply stay on while someone is in the vicinity. the retriggerable mode is the best in this application, and is set by default on many of the modules. - Наука та технологія
Clive, ur videos stand among the crowd..clear,educating, no BS...you re the man bro.
Instructive video explaining electronic circuits that are triggered by PIR modules. Thank you for explaining this popular and widespread application so nicely !
These little PIRs are great, each year I've used them at Christmas, I run a set of small xmas trees along our drive/pathway, put a PIR in each one, so as you walk up the drive they light in sequence, a nice little effect and cheapo!
+Andy Brown Replying to myself is always a bit strange, but anyway, the method of adding the transistor as +bigclivedotcom shows is a much better way than I'd done in the past.
My method fed each individual xmas tree set of LEDs back, and the output of the PIR, so each tree had 4 wires to it (+ve -ve LED-trigger PIR-output) which made it quite a mess wiring back 10 of these to my garage! Back in the garage I then used an Arduino (overkill!) to read the inputs coming from the PIRs and then switch a relay bank for the output. It was a bit heavy-handed approach, but gave me the advantage I could do a sequenced display on them when nobody was in front of them triggering the PIRs.
I'll do a video myself shortly with my plans this year as Clive has given me a bit of inspiration!
Great video to get me started on PIR in many places. I probably drive a relay with them to power various lighting needs and setups. The sensors also fit almost anywhere. Perfect.
I have been experimenting with logic level mosfets with these PIR sensors due to low current output but they usually didn't work for me , my only option was to use arduino to trigger a transistor but with this circuit design you have made my day sir.. I guess there always is something to learn after all :-)
Thanks a lot again for sharing and making the world a better place , at least for me :)
ua-cam.com/video/ZC_sEW3_694/v-deo.html
I like your use of standard connectors to build devices. Lots of people spew about lego building blocks. But you build things. Bravo.
Bought one of these for €0.70 (£0.52) after watching this video a while back. Been experimenting with it as a cat-on-kitchen-worktop-detector (soon to be deterrent once I find a suitable motor to hook up to this tambourine!) and it works rather well. For some reason with the jumper in the default (L) position the output stayed high constantly, no matter what I did. Removing the jumper entirely gave me the desired functionality. Thanks for the video.
Just got a few of these modules to play with and with no documentation, was wondering what the jumper and the pots did, then this turned up in suggested videos. Thank you for a good explanation of it all.
Excellent explanation of the break down of the PS! I've got some work to do to understand all the components. But, now I have a great road map!
Another totally Awesome BIG CLIVE production ! ;-) love Your vids Clive ... takes me back to when I should have been listening in School ! My Fave Project I made for my exam was A Bc108 trans circuit used as a water detector then applied to a window frame to close when rain detected of course .. back in 86 this was cutting edge stuff ! lol.. Look forward to more great vids Clive ..
Thanks for the video, been looking for a tutorial for using pir sensors without a microprocessor, lots of help!
Fantastic description of how PIR works. Now it makes sense! Thanks!
Koray
Excellent tutorial anyone who didn't study electronics will find this informative. These pir modules didn't exist when I studied, shows my ancient age.
I use this PIR as a movement sensor light. 3 X 1.5 Alkaline batteries with almost the same circuit you have there. I fitted an LDR and it works a treat. In our bathroom the batteries last about a year. I put all the electronics in under the Fresnel lens and used a 5630 LED with about 15mA drive. That lights up the whole room. Cost here on eBay was around $1.20 each for the PIR and the LEDs were $3.15 for 100 on a tape.
but is the voltage enough for the PIR sensor?
Great video. The diagram of the PIR you drew looked like you were going to draw a portrait of BOB ROSS. LOL.
Serendipity as I have been thinking on doing just this. Superb.
Nice, it is this sort of magic that make projects worthwhile
thanks Big Clive, that was pretty cool, I also bought some of those and this was a very helpful video for understanding them!
Ive used loads of these modules in the past, if you look closely on the front of the board next to the pir sensor itself there's two pads there for a standard ldr to fit under the fresnel lens for night only operation!
Lewis Wilson LDR?
A photoresistor (or light-dependent resistor, LDR, or photo-conductive cell)
Neat stuff
This video tittle literally describes word for word exactly what I was looking for. Thanks !
Also I found those LED lights to be called 'Copper String Lights'
Light emitting diode
Very nice presentation - you set the standard for factual YT videos.
Great video and box idea. I used one of these modules, buffered by a BC109 transistor and a reed relay to control a DFPlayer mini, to play an mp3 file from a micro-sd card. Run from 6 D-cell batteries. Strange problem, it played permanently except when somebody got close; it turned out the speaker magnet (external field) was opposing the reed relay coil's field causing the reed relay to operate as NC instead of NO! Moved it away from the magnet and now the module works fine, and my visitors will have ghost sounds at Halloween!
Was really hoping a new video came out soon. I really find them interesting. This one is one of your best, add you actually went through some (additional) circuit design. Nice job.
I always thought that the lens columnated what the PIR "sees" (in theory making it possible to walk around the beams) but your explanation makes sense. You are a natural teacher. Keep up the good work.
BTW... What's up with the one hater on all your videos? 10 minutes after any video you post there is one hater who posts a "thumbs down". You would think he would just stop watching if he feels that strongly. Thumbs up from here. ☝
+Markus Bates I've just given it a thumbs down myself to stop it looking lonely.
+Rich Booth dont worry about the thumbs down, apparently its all user involvement to youtube, also weirdly, from PC you can thumbs down a comment, but not from ipad or cell phone. thumbs up or nothing! weird, not that thumbing down a comment does anything useful anyway
+jusb1066 I actually just did it from my iPad, but in the desktop version of UA-cam.
bigclivedotcom
ahah, yeah i forgot you can from that side, i actually hate the app becuase its so hard to navigate
+Rich Booth yes i love the vid
Along with the pyroelectic sensor is a bunch of supporting circuitry, resistors and capacitors. It seems that most small hobbyist sensors use the BISS0001 ("Micro Power PIR Motion Detector IC"), undoubtedly a very inexpensive chip. This chip takes the output of the sensor and does some minor processing on it to emit a digital output pulse from the analog sensor.
you can increase the input impedance of the transisitor buffer by bootstrapping the input terminal of the transistor thus minimizing the loading effect on the pir module or better yet employ a complementary feedback pair where there is 100% feed back to the emiiter and base of the driver transistor taken from the collector current of the second transistor of the CFP resulting in an even much higher input impedance
Great Video Dude. Keep up the great work. & Happy New Year. Nick.
Nice video Clive - I just received 3 of these modules by mistake instead of the buck boost converters I ordered.
Now I know what they are, I'll have to find something to make with them...
The 3.3V output probably won't be enough to trigger a mosfet to switch a couple of 100W LEDs @ 32-34V, but a transistor should be able to bump it up.
VERY interesting article, and plenty of food for thought where device incorporation is concerned. Living in the Southern Hemisphere we don't bother with PIR when we have the Christmas (solar) lights out on the garden bushes, etc., 'cause we have no shortage of "Aussie Strength" midsummer sunshine during the day :-)
Good simple explanation on PIR's
Hi Big Clive! :)
Very interesting info here! I have a question: did you manage to compare and/or change the response time, and/or the retriggering time after detection in these models?
For what the models i have is concerned, i see a minimun HIGH time of about 3 seconds, and then about 5 seconds of stopped time to retrigger (in single triggering mode). In autoretriggering, as you explain, device is in HIGH continuously if there is a motion detection, but then, again 5 seconds of 'stop' time. I tried to make some hacks on resistor in order to decrease this time, unsuccesfully. Have you got any info or results in this way?
thanks so mucho!
Javi
Got me thinking of a project in mind.
Thanks BC!
Thanks for that detailed description and pointer to the datasheet...I got 3 of these from Aliexpress and one from Amazon...the jumper between high and low was missing on the ones from China but the rest of the boards look identical.
The purpose of the potentiometers was also a mystery but your video clarified that.
I still need to look at the output voltage to figure out if its linear or just switches on to a high voltage. The current draw is also a concern, will it be enough to drive a large NPN into saturation for a 500 ma load (12V LED string) or should I use a Darlington UL2003 to not worry about current multiplication factors.
Great tutorial - I'm actually going to do this with the added LDR for some stair lights. Can I ask which standard NPN transistor you recommend for this circuit? Many thanks.
hello clive,i have big problem my pir sensor.when i switch on pir sensor active nicely.no any motion continue activating again and again.can u tell what is the reason.i checked 3,4 sensor same problem
Your videos have inspired me to learn something about electronics. I love the way you showed the development of the circuit and I realize that you posted this a year ago, but I really want to know how you chose the value of the two resistors.
The base resistor was selected experimentally based on supplying enough current to turn the transistor on fully without loading the PIR module too much. The series resistor for the LEDs was chosen to provide enough current to make the LEDs glow at a decent intensity, but not draw too much current to maximise the battery life. Both can be adjusted within reason.
Well done video!
Where did you get the whitish connectors from?
Thanks for sharing!
Very useful video I ordered 1 of these and it's just come in the post.
play time ;-)
Ofcourse when I'm looking for something obscure like this you've done a video on it😂
I watch your videos regularly, but it's very handy to dip into "classic clive" from 7 years ago. I bought my first PIR module (noob alert) and confidently wired it to my ESP32 microcontroller. It detects movement ALL the time. Thought it was a dud, but MAYBE it just needs the transistor you mention in this video, as the ESP32 must be fluctuating quite a bit based on what I have already connected to it, the voltage/current to the PIR must be all over the place...I shall experiment!...BUT NEVER EXPERIMENT WITH 240V...again. Glad I didn't throw it away, it may work perfectly fine with the correct knowledge!
i think you can just add a pull down resistor to make it work
I bought a bunch of these HC-SR501's, and they all go off all the time, every few seconds. Completely useless. I've done more research, and they are crap. Many people complain of the same issue. Pull up or down resistors, extra capacitors, do not work. These super cheap PIR's are just no good. One place suggested getting Panasonic PIR's, in the EKMB or EKMC series. I got several for about $10 each from DigiKey, and these work perfect. They take either 3.3 or 5 volts in, but the output is 0.5 volts less that the VIN, so I supplied them with 3.3v so I don't overload the input on my ESP32. They are working perfectly, no false alarms.
Love these videos :) Do you have any plans to do a video about load cells + ADCs?
Dear Clive, I watched this vid sometime ago and it was/is excellent. Now I would like to link this sensor to the 130lm camping/solar light system you have also reviewed. Would the voltage be OK?
i have 12v LED chip connected with 12v battery throw a resistor witch can be light up with on / off button
now i have sr501 motion sensor .so plz tell me how to make the conetion
will i need any thing else.
great vids! Aside from using 4 batteries what is another solution for dealing with the FP flickering? I'm plugging in through 12V
Sir, I have a question regarding my project. I am using PIR motion sensor and it is detection a movement and for 5 seconds and after that it is showing no motion even though motion is still occurring and then it shows motion. So is there any way to decrease the delay?
Can you tell me how to change the delay on the HC-SR505. It is 8 sec and I wand about 0.5 sec. i can solder surface mount if needed. No one seems to have tried this in the net yet!
I'd add to your description that PIR window is silicon, the FET is usually connected externally as a source follower buffer with the drain heavily decoupled, and you can implement a simple detector with an LM358 dual op-amp and a discrete transistor threshold detector.
Also they detect far infra-red around 10 micron not the near infra-red as used in remote controls, two-element PIRs need to be mounted so the target movement is across the two elements one after the other - they're nowhere near as sensitive to movement at 90º. Due to the two elements in opposition they detect moving changes in temperature* which can mean colder as well as warmer, and the Fresnel lenses are moulded in HDPE.
* Actually it's changes in IR energy received, which can be down to temperature and/or emissivity of the target.
Hi Graham. Found your comment very interesting. I want to make a simple PIR circuit for Arduino that sends a pulse or toggles a digital line every time movement is sensed (with no retriggering - the arduino code will handle that).
You mentioned an LM358 and a transistor. How simple can the circuit be that connects to an Arduino's digital input? Are we talking three components?
+Mat Smith It's a lot more than just three components. The LM358 etc is just the starting point - there's something like 20-30 other components needed. Believe me you're far better off using one of these modules than rolling your own.
Coool, Thanks Mr.C, .... always wondered about them :~)
Could you tell me the type of transistor you use in this project and how to connect it ? Thanks in advance
Is there any reason you don't use 18650's in place of the nimh batteries? obviously the voltage differs but that's easy enough to get over
Hi sir
Thank you for your interesting video and I am thinking applying it for my car. How is schematic looks like to use 12v car battery as a source to drive a horn (similar car's horn) as a siren?
Thank you in advance for your advice.
Just the circuit I was looking for. 👍
top bananas, thanks Clive, just got mine working working on trying to connect it to another light source but that one has a switch on it maybe bypass the switch all together.
I have to ask you. I send in 11,1v lipoly. but I dont get more out than around 2v. I want it to turn on an led stripe. What do I wrong. It function normal but dont give me more than those 2v.
I have come across units that use LM324 chips. Those ones always have a relay.
I need to buy this guys notebook that he keeps drawing in.
Nice neat detectors, and if you want to drive the leds harder then replace the npn with a darlington type.
That tiny one is really neat :-)
I learned a lot from this video, thanks
Are there discussions of what goes into designing and building the actual PIR modules themselves?
Heyy Clive,
You talked a bit about the chip supporting a LDR and you where not sure if the trigger disable pin was just connected to 5V. If you look closely at the big PIRs you can spot two trough hole solder pads in the middle. That's so you can add a LDR yourself ;) The pull up resistor (R2 in the schematic) is already there.
I really enjoyed this video.
I wired mine the same way as your drawing, but without the transistor. It' working just the opposite. The led stays on and goes out when I put my hand in front of the sensor. I'm waiting on transistors to arrive in the mail. Will using the transistor make this work right?
What is the source for the small PIR and do you have a model number. Thanks.
I would have never guessed that these work by sensing body heat. I see them all the time in my classrooms, and at the local supermarkets to turn the lights on in the coolers when you're in front of the door.
Looks lovely, sadly I live 2 floors above ground so I can't really use them anywhere (except indoors I suppose).
I brought one of this pir module and it was written on its description that its timing can be adjusted from 3 seconds to 5 minutes but when i adjusted its timing to maximum it stayed on for about 11 seconds and no more then that. This really disappointed me. Do you know whats the problem?
Seems non-retriggerable mode would be good if you were, for example, counting the number of movements in front of the PIR, and once a threshold was reached, you then set a flag to send a message such as: "there seems to be a lot of movement in front of your car - it might be being stolen".
Getting so many spooky halloween ideas. :-)
How would you increase decrease the time the light stays on for for the small one as I want around 10 mins and want to run it off 3v as I want it descrete and don't want to use more than 2 batteries so I'll have to find a 3v sensor
You can adjust the delay with a small potentiometer on the larger units. On the smaller ones it may be possible with a capacitor change if you can identify the chip.
Thanks. Very helpful!
I don't know much about electronics, but where can you get an emitter (the one you connected the output, negative and LEDs negative with)? I have had no luck so far
You're looking for an NPN transistor. Depending where you are in the world it may be able to get a BC547 or 2N3904. These are very cheap and common low power transistors. You can also buy them on eBay. Note that different transistors have the emitter, collector and base on different pins so you have to check online to see which pinout your transistor style has.
Very informative, thanks!
Hello, thank you for nice explanation but i have an issue. I use 4 batteries AAA and the lights still turning on and off without any motion in area. How to fix this issue?
Are you trying to drive LEDs directly from the module?
Hello! Is it unwise to change the Fresnell lens to use a larger one? I want to use these cheap Ebay modules in a repurposed (previously 240v) ceiling mount and get a low voltage signal out of it. But the ceiling mount obviously has its own lens, slightly larger
The polythene lens just provides a series of sharp infrared contrasts to the sensor. As long as the new sensor is in the same place as the original one in the unit it will have the same coverage and sensitivity.
Hi Clive, I'm sure you are aware of those PIR sensor built in LED light Bulbs (E27 and B22). I have bought some but they stop to work after about a week of use. Do you what what could be causing them to fail?
I finally got my Raspberry Pi wired up with one of these PIR modules. It sends a signal to my Raspberry Pi to take a photo and email it to myself. I added an LED to let me know when it senses motion. It is so sensitive, I can just smile and it will trigger. The two potentiometers don't seem to change the sensitivity. I guess I could partially cover the lens to lessen sensitivity.
Evening, I’m trying to use MP2307 Adjustable Mini360 DC-DC Converter Step Down Buck Voltage Regulator but I’m getting lost as on your diagram only one wire come out the bottom, but on my regulator there are two outputs, can you offer any help? Happy to put a video up on my channel if needed
What distance will PIR's work? Are the same ones used with Arduino?
What is the range of these things?
Do you do any Arduino stuff Clive?
I made a few projects related to RF data transception and a couple videos on some of my projects I wanted made public, nothing fancy.
I never had a real need for PIR devices so I never ordered any but interesting video as always man.
The glass vs plastic thing is interesting, though
Can this be done with Halloween or Christmas animatronics? Most of my units run on 3.75v to 6v (3 to 4 AA batteries). I would be using the "TRY ME" wire, removing the pressure button. This is usually just a completion of circuit function to run the animatronics 1 time. I purchased the same small PIR as you are showing from Amazon... 5 for $16. Mine are rated to run on 2.7v to 12v but have the same VCC, V-Out, & GND connections.
I found this video while searching for the chip on that tiny PIR module. It's sold as hc-sr505 but the chip markings on the 8-pin are removed. That's stupid, what are they trying to hide?
You know I do enjoy your videos very much, my wife complains as I often buy the things you post as you make them very interesting. I have been playing around with one of these for a few weeks now off and on, trying to build a 12 volt LED night light that will light up in the bathroom of our RV when we are boondocking (camping with no hookups to power or water.) I had it set up through an arduino, then through a relay and to a little nightlight that I built up from a China kit. They sent me one for 220 rather then 110 and it never worked with AC so I simply cut the AC step down out and it works fine on 12 volts, however refuses to light at all with less voltage. Perhaps I could cut some more resistors out somewhere, but I do like the way it works now, and the fact that our RV has a 12 volt system makes this the proper voltage for my project. My question is, can I hook this up the way you show in this video through the transformer or will I have to use a buck converter to step down the voltage to run the PIR then back up to run the light?
Interface with small relays and switch line voltage lights
How do you think these compare to an ESP8266?
How much current PIR Sensor takes ?
Hi I have a Question. Can I use this with the home outlet 110V instead of the battery? Should I used a bigger Transistor and if so how big? Also Can I use a 5 watts light bulb instead of a bunch of LEDs? If I use batteries can it be 9 Volts or 6 Volts is the maximum? I have very limited knowledge on electronics but I am learning a lot here.Thanks for your help.
You can get outdoor PIR units for security lights that do work from mains voltage and allow the switching of larger lights.
You can also get inline 12V ones that allow switching 12V lights or LED tape run from a plug-in 12V power supply.
If they are effected by a warm body passing in front of the sensors why then does moving grass etc. set them off?
Anything that can cause a heat disturbance or reflect heat can trigger a PIR. But it usually requires a large temperature difference like an animal.
They're like a giant compound eye.
Thanks for the useful info Clive - I've been wondering how to make best use of my PIR to make a hallway night light. I hooked up the output and ground driving various LEDs, which always seemed to be under-driven by a few tenths of Vs from getting full brightness. Am I right in thinking there's some sort of LED voltage detector built into the PIR module (mine is very similar to the larger square one with 2 orange presets you show in your video).
These units are not designed to drive a load. They can only put out a small current for other circuitry to use. Hence why I added a transistor to allow them to drive a higher load in one of the videos.
Assuming the LED is 1W you then choose a transistor for 1W for this application? Instea of a transistor, Could I put a 3vdc relay to manage higher AC or DC currents? Thanks
every time I watch a movie again I learn something, good work m8 Thank you and make more PLz :)
Hi BigClive. Thank you for your video. Very instructive. Is there a way to change the detection distance of the mini PIR detector? Thank you.
The bigger ones have an adjustment the smaller ones don't.
+bigclivedotcom Thank you for replying and for posting this tutorial.
At 7:08, why not an N-channel MOSFET? You'd have lower on resistance and wouldn't be loading the PIR down with base current.
An area of pirs not covered well is the effects of external temperature. Early thermal imagers and perhaps still used gadolinium lenses cooled down with liquid nitrogen. Another site says that pirs will not work in hot climates. Space is made for a thermistor on some pirs. Pirs work much better in winter in the UK and not so well in the summer. Can this be sorted with a thermistor? Does cooling the unit increase the sensitivity or does the range extend in a cooler environment or both? Just a thought or two.
Great learning opportunity you provide, many thanks
The PIR sensors detect thermal difference. You can adjust the sensitivity in the summer.
Interesting light 💡 technology
I could use your skills on our team :) Very interesting, thanks for posting
Is there a difference between Ac and Dc pir
Could an LED circuit fitted with the smaller model PIR be driven by just x2 AAA NiMh batteries (2.4V) or would it need some sort of step up to 4.8V? If so what would you need?
The modules have a 3.3V voltage regulator which could possibly be bypassed to allow lower voltage operation, but the LEDs may not be bright at a voltage so close to their forward voltage.
Hi, great video, I've got an led strip in a display case which looks great now. However the motion sensor is a little unpredictable. Any thoughts on why this is happening. Also I'm using 9v instead of 5v in the video do I need different resistor values?
If it keeps retriggering it might be due to a high load versus the power supply. If it is just not detecting people it needs an open and direct view with no glass in the way.
It's triggering but seems to take about 5-7 seconds to turn on the LEDs.
I just found out that those big PIR's
false trigger when using 3.7v.
I just removed the protection diode & directly connected it to 3.7v.
It works fine!!!!
+A B I D They do. It defeats the voltage regulation, so they constantly re-trip when they turn off and the voltage changes slightly. That diode does buy you an extra half volt of operating voltage.
hey clive, if you want to control a relay with this, can you just connect the pir output to the relay coil using a resistor? I don't know if the pir output current is too low or what but I've never seen anyone doing that.
thx.
It would require a transistor to switch the relay.