No video

How to Use a PIR Motion Sensor with Raspberry Pi

  Рет қаралды 112,958

Tech With Tim

Tech With Tim

5 жыл бұрын

This raspberry pi tutorial shows how to use a PIR sensor on the raspberry pi model B+. It explains how to wire the sensor into a breadboard using the raspberry pi's GPIO pins. It then shows how to use python code to toggle a green LED on and off based on detected motion.
Playlist: • Raspberry Pi Tutorial ...
Parts Used:
PIR Sensor: www.amazon.ca/...
Supply Kit (Everything you Need): www.amazon.ca/....
Jumper Wires: amzn.to/2WxlSsx
Bread Board:amzn.to/2WuWzYd
LED: amzn.to/2MQ1u1J
Resistor: amzn.to/2XyUneF
Raspberry Pi B+: amzn.to/2Wt0QeR
◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
tech-with-tim.....
📸 Instagram: / tech_with_tim
🌎 Website techwithtim.net
📱 Twitter: / techwithtimm
⭐ Discord: / discord
📝 LinkedIn: / tim-rusci. .
📂 GitHub: github.com/tec...
🔊 Podcast: anchor.fm/tech...
💵 One-Time Donations: www.paypal.com....
💰 Patreon: / techwithtim
◾◾◾◾◾◾
⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡
Tags:
- Tech With Tim
- Raspberry Pi Tutorial
- Raspberry pi motion sensor
- Pir sensor raspberry pi
#raspberrypi #rasberrypipython

Пікірлер: 87
@TechWithTim
@TechWithTim 5 жыл бұрын
Pick up a PIR Sensor here: kzfaq.info?v=Tw0mG4YtsZk&event=video_description&redir_token=95KdJupB9A12BXjHC4NTc-fQL7h8MTU2MDQ2ODM3N0AxNTYwMzgxOTc3&q=https%3A%2F%2Fwww.amazon.ca%2FOSEPP-Passive-Infrared-Components-PIR-01%2Fdp%2FB01ISMW0TU%2Fref%3Dsr_1_14%3Fkeywords%3Draspberry%2Bpi%2Bpir%26qid%3D1560298881%26s%3Delectronics%26sr%3D1-14%26_encoding%3DUTF8%26tag%3Dtechwithtim08-20%26linkCode%3Dur2%26linkId%3D0888f8635ee901445b780beb7ca96088%26camp%3D15121%26creative%3D330641
@OnleySkyeAlt
@OnleySkyeAlt 3 жыл бұрын
this helped me with my school project. i made a motion sensor that says bruh out of a speaker when it detects motion
@lizardking4944
@lizardking4944 2 жыл бұрын
did u share this on your github account dude?
@alex59292
@alex59292 Жыл бұрын
@@lizardking4944 bro this is simple to do
@lizardking4944
@lizardking4944 Жыл бұрын
@@alex59292 this is none of your business bro
@alex59292
@alex59292 Жыл бұрын
@@lizardking4944 the video shows the hardest part of his project all it is is simple code
@MohsinKhan-rv7jj
@MohsinKhan-rv7jj 3 жыл бұрын
One of the best videos you will find on Internet for PIR sensor
@julyapetrenchuk7866
@julyapetrenchuk7866 5 жыл бұрын
Awesome that you are using python for it
@agyeirichmondowusu9670
@agyeirichmondowusu9670 4 ай бұрын
Your tutorial is the best. Please do more of these
@wuyanchu
@wuyanchu 7 ай бұрын
very nice tutorial, thx and god bless you and the world.. 來自香港的祝福, regards from hong kong ^_^
@nguyenmax277
@nguyenmax277 4 жыл бұрын
how can we add a speaker instead of an LED
@brentrusche2056
@brentrusche2056 8 ай бұрын
@TechWithTim Great tutorial. I too want to make a surveillance system using an RPi and multiple PIR sensors. However, I am not quite certain as to the wiring and code for using multiple PIR sensors. I would really appreciate an expanded tutorial on using multiple PIR sensors on a single RPi. Thanks in advance!
@kyleanderson3633
@kyleanderson3633 5 жыл бұрын
Great video! Very clear and well explained.
@TechWithTim
@TechWithTim 5 жыл бұрын
Thanks!
@Beeckey
@Beeckey 2 жыл бұрын
This is the best explanation ever! Thank you soo muchhh!!!
@jhred3315
@jhred3315 2 жыл бұрын
Hey Tim. I really like your tutorials. Can you make more about raspberry pi since yours are most easy to understand especially the plugging part.
@YouKnowMeDuh
@YouKnowMeDuh 2 жыл бұрын
Great tutorial. You're very clear and to the point. Thanks a ton.
@patrykperwenis4348
@patrykperwenis4348 2 жыл бұрын
very good tutorial
@mrlevo27
@mrlevo27 Жыл бұрын
Hallo I get a montion startet sensor when I pulled of the sensor cable by accident. What could be the problem
@nickaf4204
@nickaf4204 4 жыл бұрын
Is there a way to connect this to pi without the use of a breadboard?
@crownz936
@crownz936 4 жыл бұрын
I knw I’m late but my sensor picks it up but doesn’t stop the led light. Pls reply
@owenyu1261
@owenyu1261 4 жыл бұрын
me too
@BlackB0lt_
@BlackB0lt_ 3 жыл бұрын
same
@hoangquyla4516
@hoangquyla4516 4 жыл бұрын
Hi Tim can you make a video on how to use raspberry pi in order to detect the temperature and humidity
@ernestoloredo2618
@ernestoloredo2618 4 жыл бұрын
just use a SenseHAT ;)
@jungleviper
@jungleviper Жыл бұрын
Can I use this to turn some led lights on and off
@dimitardimitrov6936
@dimitardimitrov6936 4 жыл бұрын
Thanks for the nice and understandable video! My question is (and maybe it's a good topic for your next video) how can I get information over internet about the pir status and/or history? i.e. "current status", "last time and date it was triggered", "count of the triggers over a period" , " where the pir status history is to be stored, and auto overwritten every 2 months (for example)", etc... The idea is to know the activity at home, when I'm faaaar far away. Is there a mobile app that you know will work?
@motzs1016
@motzs1016 5 жыл бұрын
Thanks for this tutorial
@PhilinQQ
@PhilinQQ 5 жыл бұрын
Really interesting and cool tutorial
@AnkitaMalusare-nd8xv
@AnkitaMalusare-nd8xv 11 ай бұрын
Nice Video But I have a doubt our LEDs Motion Detected but Motion Does Not Stopped
@matiu7276
@matiu7276 5 жыл бұрын
Can you use regular phone charger that has 5V and 2A to power this raspberry? It's a fast charger too so it has 9V and 1.7A written in upper bar. I'm about to buy Raspberry 3 A+ so I don't want to destroy it too fast :)
@bernielovell2197
@bernielovell2197 3 жыл бұрын
I bought a power trigger water spray hoping to detect the crapping cat who visits my garden. It worked fine with a cheap air-freshener detector but, to was so weak that I really needed a PIR sensor. This was much more difficult to make work. It either never worked or It worked with no stopping. How about making one on this problem?
@SuperAn0nymus
@SuperAn0nymus 3 жыл бұрын
Wow!! amazing explanation!! ..could you tell why did you use resistor instead of a jumper cable?
@krypton1142
@krypton1142 2 жыл бұрын
the resistor is there to make sure not too much current passes through the LED and explodes it.
@cosming940
@cosming940 5 жыл бұрын
The Resistor that you use is 100 Ohm ?
@Duriel1000
@Duriel1000 4 жыл бұрын
is the function "wait_for_motion()" a built in function from the Sensor import?
@Ghillis_Peyton
@Ghillis_Peyton Жыл бұрын
yeah, its a method of the MotionSensor Class
@Enigmaafk
@Enigmaafk 3 жыл бұрын
i like this method, can you link this to an lcd and let it display motion detected. thanks
@loicsigni1613
@loicsigni1613 3 жыл бұрын
Great video. I wanna use the same PIR sensor for this small door greeting robot I'm building,. My question is: If I program the Raspberry Pi and disconnect it from my computer would it still work as long as I am feeding it with electrical power?
@seth8811
@seth8811 3 жыл бұрын
You need to connect batteries then
@budgetpresents802
@budgetpresents802 4 жыл бұрын
Can u use other models of rasberry pi and if yes what others?
@ernestoloredo2618
@ernestoloredo2618 4 жыл бұрын
Thank you so much!!! God bless
@bshara83
@bshara83 Жыл бұрын
Hello, could you help me write code for bi-deractional people counter using 2 sensors where when objects pass first then the second sensor will count+1, or the second then the first sensor will count -1. And record the In and Out and current occupies the room to SQL DB, please 👏
@raidsagr3263
@raidsagr3263 4 жыл бұрын
How can i programme this to find out the total duration of the light was turned on the last 6hrs for example? Thank you very much
@grog8164
@grog8164 3 жыл бұрын
the light is on during motion detected until motion stop so you could basically have a top variable `light_on_duration_sec` in which you add the time elapse between motion detected until motion stop. Your `light_on_duration_sec` is your only critical data so either you count on your pie to stay alive during the day either your persist the information on the disc. For your "on the last 6hrs" then it's up to you to program it using your pie datetime and `ìf` condition
@darrenstorey4558
@darrenstorey4558 4 жыл бұрын
With the pi4 having a 5v output, using this tutorial as an example, is it possible for it to power an LED strip instead of an LED bulb? I am wanting to use the PIR in a magic mirror where whenever someone stands in front of the mirror, the PIR triggers and lights up the LED strips to act as a mood light around the mirror itself. ps I am a total NOOB so any help is much appreciated
@chrismunson5513
@chrismunson5513 3 жыл бұрын
I want to run this exact setup, but have it with a photo slideshow, so it will only play when someone is present? Anyone with exp please help. Brand new to pi OS and lineage. First project with pi zero
@James-sh1lw
@James-sh1lw 3 жыл бұрын
Hey Tim I know this video is kinda old now but hopefully you're checking comments. Do you think this will be ok opposite my window? I'm building a magic mirror with my raspberry pi and an LED monitor but dont want the monitor constantly running, so I want it to turn on with motion detection. From the angle it wont see anything moving outside but the sun moving around during the day does changed the light levels in the room. What do you reckon? Do you also know how to turn on/off the HDMI port with a motion sensor?
@SprocketN
@SprocketN 3 жыл бұрын
I believe the detector can’t ‘see’ through glass, so it shouldn’t detect anything moving outside. They’re not expensive so buy one and try it 😀
@James-sh1lw
@James-sh1lw 3 жыл бұрын
@@SprocketN thank you!
@itzkeyz2526
@itzkeyz2526 3 жыл бұрын
Is there a way to display the time motion is detected
@bigbad123321
@bigbad123321 Жыл бұрын
I've got a question. Can you run this while simultaneously running a temperature reading with a temp sensor and get the programme to print out both "motion detected/motion stopped" and also have it printing the temperature every X amount of seconds aswell?
@Ghillis_Peyton
@Ghillis_Peyton Жыл бұрын
yes, but you would need to use asyncio or threading to run both at once
@katefernandez240
@katefernandez240 4 жыл бұрын
Hi! Do you know how to connect multiple PIR? Thanks
@brighterryu2465
@brighterryu2465 2 жыл бұрын
good example
@funkygetaways
@funkygetaways 3 жыл бұрын
Is a breadboard required for this?
@Randy2747
@Randy2747 4 жыл бұрын
Could you please help me out and make a code that I can use the relay, PIR, and raspberry pi but have the light (or anything else that is plugged in to the relays) set on a timer? I woukd like to put lasers in my game room and when someone walks into the room the lasers will be by the ceiling and come on for a duration of the time I set. Could you please help me out and either make a video of the timer added or post the code here? Please 😉😁
@ayy.mp4
@ayy.mp4 3 жыл бұрын
How do I close the script properly?
@rishivinukonda
@rishivinukonda 3 жыл бұрын
Do you think you do it with java? Cause I don’t know python
@sainco3036
@sainco3036 5 жыл бұрын
thanks.
@ProgrammerSheep
@ProgrammerSheep 5 жыл бұрын
How are you screen recording?!?!
@TechWithTim
@TechWithTim 5 жыл бұрын
secret... ;)
@ProgrammerSheep
@ProgrammerSheep 5 жыл бұрын
@@TechWithTim reeeeeeee
@--Jonathan09--
@--Jonathan09-- 2 жыл бұрын
awesome👍
@sahilhadke
@sahilhadke 3 жыл бұрын
I'm here to stop a freaking cat from pooping in our balcony.
@AnkitaMalusare-nd8xv
@AnkitaMalusare-nd8xv 11 ай бұрын
LEDs Motion Not Detect Exactly
@mandeepubhi4744
@mandeepubhi4744 5 жыл бұрын
Awesome
@ProgrammerSheep
@ProgrammerSheep 5 жыл бұрын
Yeah just take out the resistor LOL
@dharmareddy3636
@dharmareddy3636 4 жыл бұрын
Can I have the link of raspberry is that you are using
@anghel332
@anghel332 4 жыл бұрын
Search for raspberry pi 4 model b
@sainco3036
@sainco3036 5 жыл бұрын
perhaps at this rate we will reach robotics and the study grew (by the way there is a lot of Python).
@ProgrammerSheep
@ProgrammerSheep 5 жыл бұрын
Why not Arduino
@abhichoudhary4518
@abhichoudhary4518 3 жыл бұрын
Arduino can be used for this project, and in my opinion, would be faster, but this video can be for someone who doesn't have an Arduino, or if someone wants to incorporate a PIR sensor in their Raspberry pi project but don't know how to
@heinzbeckenbauer243
@heinzbeckenbauer243 5 жыл бұрын
Very good video but can you turn off the auto focus. Thank you :)
@TechWithTim
@TechWithTim 5 жыл бұрын
Why would I turn it off? Then you wouldn’t be able to see anything
@heinzbeckenbauer243
@heinzbeckenbauer243 5 жыл бұрын
@@TechWithTim I meant you may could do manuell focus so it doesnt swich all the time.
@TechWithTim
@TechWithTim 5 жыл бұрын
Ya no that would not be possible 😂 constantly spinning the wheel, no thanks
@heinzbeckenbauer243
@heinzbeckenbauer243 5 жыл бұрын
@@TechWithTim ok I understand. But still great video
@Randy2747
@Randy2747 4 жыл бұрын
this was a FAIL for me..I figured i would try my first script with my new raspberry pi 3 and i got a error cannot import name 'led' from gpiozero...why? Edited..I figured it out.......I didnt have capital letter :-)
@sm-vr6kn
@sm-vr6kn 2 жыл бұрын
What all things are included in the supply kit?
@wuyanchu
@wuyanchu 7 ай бұрын
very nice tutorial, thx and god bless you and the world.. 來自香港的祝福, regards from hong kong ^_^
@budgetpresents802
@budgetpresents802 4 жыл бұрын
Can u use other models of rasberry pi and if yes what others?
@budgetpresents802
@budgetpresents802 4 жыл бұрын
Can u use other models of rasberry pi and if yes what others?
@budgetpresents802
@budgetpresents802 4 жыл бұрын
Can u use other models of rasberry pi and if yes what others?
@budgetpresents802
@budgetpresents802 4 жыл бұрын
Can u use other models of rasberry pi and if yes what others?
@SprocketN
@SprocketN 3 жыл бұрын
Yes, it will work with all Pi models.
Sensors - which one to use
17:06
Electronoobs
Рет қаралды 1,3 МЛН
Викторина от МАМЫ 🆘 | WICSUR #shorts
00:58
Бискас
Рет қаралды 6 МЛН
ПОМОГЛА НАЗЫВАЕТСЯ😂
00:20
Chapitosiki
Рет қаралды 25 МЛН
How I Did The SELF BENDING Spoon 😱🥄 #shorts
00:19
Wian
Рет қаралды 35 МЛН
Horrific LED tester that can literally kill you - (with scary schematic)
15:48
How to Take Photos and Videos with Raspberry Pi Camera Module
11:13
Tech With Tim
Рет қаралды 81 М.
The search for the biggest shape in the universe.
18:49
Stand-up Maths
Рет қаралды 42 М.
Your USB-C Cable probably SUCKS! Sooo is that Bad?
10:54
GreatScott!
Рет қаралды 707 М.
You can learn Arduino in 15 minutes.
16:34
Afrotechmods
Рет қаралды 10 МЛН
Effective Ways To Detect People With Common Sensors
7:43
Core Electronics
Рет қаралды 68 М.
Build a DIGITAL MAGIC MIRROR - Full Tutorial
24:26
DIY Machines
Рет қаралды 197 М.
How To Safely Connect a Breadboard to Raspberry Pi
11:21
M Heidenreich
Рет қаралды 30 М.
The Raspberry Pi Pico WAS Overrated! But that changed!
10:18
GreatScott!
Рет қаралды 603 М.
Викторина от МАМЫ 🆘 | WICSUR #shorts
00:58
Бискас
Рет қаралды 6 МЛН