How to Use a PIR Sensor with Arduino: Wiring & Code for Motion-activated Projects

preview_player
Показать описание
Dive into the exciting world of interactive projects with my beginner-friendly tutorial on how to use a PIR sensor with an Arduino! Whether you're looking to breathe life into your props, animatronics, or robot projects, this video is your perfect starting point. I break down the essentials of how to connect a PIR sensor to an Arduino, with clear and concise instructions on how to wire a PIR sensor to an Arduino so you get up and running without any hassle.

But I don't stop at just the basics; this tutorial also dives into practical PIR sensor and Arduino code examples, showing you step-by-step how to program your Arduino to respond to motion. From setting up your PIR sensor to writing your first lines of Arduino code, I've got you covered. By the end of this video, you'll have all the knowledge you need to add motion-activated elements to your projects, making them not only more interactive but also more captivating to your audience.

So, grab your Arduino and PIR sensor, and let's start making your projects move!

🎬 Video Chapters: PIR Sensor with Arduino Wiring and Code Examples
0:00 Welcome
0:21 How Do PIR Sensors Work?
0:56 Parts of a PIR Sensor
1:42 PIR Sensor Pinout
2:04 Time Delay Adjustment Potentiometer
2:32 Sensitivity Adjustment Potentiometer
2:57 Trigger Mode Jumper
4:23 How to Wire a PIR Sensor to an Arduino
4:59 Reading the Current State of the PIR Sensor Arduino Code
8:56 Reading the State Change of the PIR Sensor Arduino Code
13:16 Control an LED with PIR Sensor Arduino Code (using current state)
14:46 Effect of Time Delay Adjustment on LED
15:20 Control LED Blink using PIR Sensor Current State
17:50 Control LED Blink using PIR Sensor on State Change
19:05 LED Animation: Arduino Code Example 1
22:45 LED Animation: Arduino Code Example 2
29:19 Wrap Up
29:55 Read the Full Tutorial
30:03 Join the Community

Build Your Own PIR Sensor and Arduino LED Motion-activated Circuit:

💬 Have any questions or want to share your own experiences, tips and advice about using PIR sensors with Arduino? Drop a comment below – I love hearing from you!

🔔 If you find this video helpful, please hit that like button 👍 and consider subscribing to my channel for more props/animatronics/robot tutorials, tips, and tricks. Your support helps me create more content like this!

Some links included here are to affiliate sites. If you purchase something through them, I may earn a small commission — which costs you nothing! I am very grateful for your support when you use my links to make a purchase.

#arduino #pirsensor #arduinotutorial #arduinocode #props #animatronics
Рекомендации по теме
Комментарии
Автор

I love to tinker, so I bought one of those arduino project kits for my son and I to have fun with. It was such a pita to figure out. As a result, it's been collecting dust. You're really taking the mystery out of all of it, and I'm dusting it off and seeing what I can come up with right now. I'm so glad I stumbled across your channel. Thank you!

LordHolley
Автор

I've just found your channel. It's fantastic. Thank you for leaving the mistakes in.❤❤❤

lesliefoster
Автор

This is awesome, I am actually working on an animatronic that can use this. I'm just starting out on Arduino so this is very helpful!

anubin
Автор

Thanks for explaining things in an easy to understand way. I look forward to the rest of this series.

scubaken
Автор

I got a a Arduino Cogworth City kit from an add on Facebook.and after a few lessons I have a lot of questions that your Youtube channel has helped so much. Thanks!

LenProkop
Автор

I've got several Arduinos and haven't taken the time to learn to program them. I think this might get me doing it. I like this video format. No intimidation.

bwselectronic
Автор

This is great! Watching now. you and hackmakemod are my favorite channels!

CryptoRulz
Автор

So smart and talented plus absolutely gorgeous ❤

chvytom
Автор

Love your attitude. And the way you presented the material. Keep up the good work.

SailAway
Автор

Another super great awesome video!! Learned a ton of very useful information that actually stuck! You’re a superb teacher!! Thankies ❤😊

emmamarx
Автор

Such an informative and easy to watch channel! Love it! Thanks for sharing!

jeremydobb
Автор

Rite Rachel Dudess, It took me a while to get my brackets, semicolons and layout just right but it now works great. I have put two orange LED's in a rat skeletons eyes (not a real one, it's plastic)! I want to add sound, "peekaboo I see you" said in a slow scary voice, (got it of a website) for when the kids come to get their sweets/candy! I love your presenting style quirky but absobloodylutely spot on, keep up the great vids, stay safe n well. TFS, GB :)

graemebrumfitt
Автор

Love the info and how you explain. Simple for me to understand. I’d also like to see how to make random blinking eyes on a prop/mask animatronic. I’ve seen it on instagram but no clear explanation on how they did it on a mask. Thank you 🙏

behemoth
Автор

Great Videos and a fantastic style of explaining things!
I'm completely new to these topics but I really want to make my frontyard nice and spooky next Halloween. Could you please make a video at some point where you show how to make things weatherproof and how you would set up all the wiring in an outdoors enviroment? That would be awesome and highly appreciated.
Other than that: keep up the great work, you're doing an amazing job here
😌👌

rotorotto
Автор

Great video. I have been having trouble with my PIR sensor. Either the LED stays on too long or off too long. I try some of your code to see what went wrong.

I tried your code and it works better than anyone elses code. Great job.

One thing though in your 3rd example, the one using the led, you forgot to setup the ledPin as OUTPUT. Not a big deal really, easy to fix, but I thought you might want to know.

zk_
Автор

The world's best Queen teacher thanks

kabandajamir
Автор

Another great video and very beautiful, I just love your channel. From Jim 😊❤

JamesConway-sq
Автор

High! Hello, there! Hopefully, all is well! Love you intrest in electronics probably vary technical! Goodluck with all those components!

louiepauda
Автор

Rachel, have you ever used hall effect sensors to control a dc motor for movement of a prop to a specific location?

JDude-ujlk
Автор

Thank you for the great video! 

I have one question: What if I want the 3 second sound to repeat, if motion is still present? Meaning, if a person stays for longer than a few seconds the same sound bite loops. Right now, I see the option sensor is detecting that motion is still present, but the MP3 player automatically turns off after the 3 seconds of the sound bite as played.

donnadimitrova