Picture of Arduino Basics: PIR Sensors
Welcome to the next installment of Arduino Basics!

This instructable will teach you how to use a PIR sensors with the arduino, and we wil build a simple motion detector!

Step 1: Supplies

Picture of Supplies
For this instructable you will need the following:

1 arduino (with protoshield to make life easy)
1 LED of any color
1 PIR sensor from Parallax (you can find these at most radio shacks)
Solid wire to hook it up
1-40 of 44Next »



i have made according to your instruction but afer the callibrating process it automatically says motion is dected even if there is no motion plz help.

CraigC5 made it!1 month ago

Simple. Fun. I like the buzzer idea.

Photo Jul 21, 6 30 42 PM.jpg
KomeylD made it!1 month ago

I made it, so easy and so usable. I've an idea to add a buzzer.

sasaakra6 months ago
I want a code to activate the PIR sensor just if a motion exists for 25 secs continuously
GregM8 sasaakra6 months ago

Usually on PIR sensors (like the one in the link) there are trim pots, so you can adjust the amount of time you want to keep something on (25 seconds) by turning the trim pot clockwise or counterclockwise.


what happen when we turning the trim pot to clockwise? what about counterclockwise ? can i have a coding to make the led stay high when there is a movement and low when the pir detects no motion at all.

AllenP32 months ago

Hello Frenzy,

What did you use for a sketch in the Arduino.


Allen in Dallas

gbraid2 months ago
ibenkos7 months ago

how do i change the led to an 5v relay? so that when its movement the relay is high. and good project :)

GregM8 ibenkos6 months ago

It's simple. On a 5 volt relay (and any relay for that matter) there are typically 3 pins: VCC, IN and Ground. Connect the "In" pin on your relay (signal) to whatever output pin you selected on your Arduino . In this demonstration, it's pin 13. Done and done! :-)

ibenkos GregM85 months ago
yhanks ;)
asachs01 made it!7 months ago

Franzy, just wanted to say that this was great, quick, and easy to use. I managed to get this working on a Spark core. Used your code (just changed the pin #'s to pirPin 0, ledPin 1), and worked like a charm. Thanks a ton!

Photo on 1-28-15 at 11.02 PM.jpgPhoto on 1-28-15 at 11.02 PM #2.jpgPhoto on 1-28-15 at 11.02 PM #3.jpg
AsadB9 months ago

Hi, If there is complete darkness will the PIR still work?

StraydogEOD AsadB8 months ago

Yes, PIRs work off of an infrared grid setup. Think of it like looking for changes in "heat" across a bunch of zones (not 100% accurate but close enough to get the point of how it works). Light is irrelevant.

JahFyahh8 months ago
I like to move it move it
pengocha9 months ago
Very good tutorial, made it and also added smoke alarm. Now it's time for the next step in my project, getting notification when triggered. Any links to tutorials to do this? I've read in the comments something about pushing box. Any examples or instructions maybe?
Fission Chips10 months ago

Thanks for sharing this! Very helpful for me.

pcame10 months ago
Yo utilice un sensor PIR como interruptor para el baño. Las manos húmedas son peligrosas, cuando no se tiene interruptor diferencial. Tiene una aprobación de 8/10 en mi casa, se resisten al cambio. Saludos
how do you get this to send a txt message?
I have made a motion activate camera and I am looking to get it to send me a text message or email when a picture is taken...any thoughts?

I know this was posted quite some time ago, but in case you are still wondering about how to get a txt or email, you will need an ethernet controller. With an ethernet controller, you can utilize the internet and send either an email or a txt message. This is done with the arduino, the ethernet shield, the sensor for triggered input, and an external program to interface with the signal from the arduino. I use pushing box. Hope this helps.

android adk is your friend. if you are into getting into app design you can do it very cheap with a bluetooth adapter
Praveens1 year ago


robmawe911 year ago
Oliverhall1 year ago

Nice tutorial!

You can get the hc-sr501 PIR motion sensor for cheap here: http://voltatek.com/en/sensors/69-motion-sensor-m...

cityboy12 years ago
What should the output voltage for the LED be. My LED has about 1Volt, not enough to turn it on, anybody with thoughts.
its a nice project sir and very impresive. but sir' i have a question ahm im working with a project that uses wireless senors for security systems with an addressable alarm. can you tech me how these things well be built?
As frenzy has not replied yet, I am already going to ask you to be a bit more specific. Are you interested in just connecting wireless sensors or in building the entire system. In that case, what do you mean with 'adressable alarm'.

Just a question out of interest (forgive me if I am completely off): are you by any chance Filipino? :-)
Going to do that on my pc. Just have to try it.
bertus52x114 years ago
Did you get a new identity recently, or is this your standard Arduino outfit?
Anyway, always good to read the basics...
No you got it wrong you see he was trying to make arduinos less nerdy but.........it had the opposite affect :I
frenzy (author)  Ghost Wolf4 years ago
>.> that's was she said

(see i can come up with great comments too)
frenzy (author)  Ghost Wolf4 years ago
Sooooooooooo you like driving people crazy?
Mmm, on second thoughts, I guess you're right!
It's a great project if you can make light up sunglasses though
account3r24 years ago
if you are using fritzing, can you send me the download for the pir sensor?
frenzy (author)  account3r24 years ago
there is no download although adafruit has one in her fritzing tutorials.

i just used the basic component with 3 pins and labeled it
lynne1234 years ago
Hey frenzy,
Great tutorial - very well explained.
I could see how a heat sensor and arduino could be used for a project I have been working on. I got the parts but am woefully underexperienced to put it together. I am trying to get a thermal array sensor to run a small motor.
I'm stuck. Got any suggestions on where to go for help?
account3r24 years ago
are you using fritzing?
1-40 of 44Next »