Random Nerd Tutorials
Shares

Arduino with PIR Motion Sensor

Shares

In this project you’re going to create a simple circuit with an Arduino and PIR motion sensor that can detect movement. An LED will light up when movement is detected.

Watch the video below to see how it works


Introducing the PIR Motion Sensor

The PIR motion sensor is ideal to detect movement. PIR stand for “Passive Infrared”. Basically, the PIR motion sensor measures infrared light from objects in its field of view.

So, it can detect motion based on changes in infrared light in the environment. It is ideal to detect if a human has moved in or out of the sensor range.

pir

The sensor in the figure above has two built-in potentiometers to adjust the delay time (the potentiometer at the left) and the sensitivity (the potentiometer at the right).

Pinout

Wiring the PIR motion sensor to an Arduino is pretty straightforward – the sensor has only 3 pins.

  • GND – connect to ground
  • OUT – connect to an Arduino digital pin
  • 5V – connect to 5V

Parts required

1parts

Here’s the required parts for this project

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Schematics

Assemble all the parts by following the schematics below.

Arduino with PIR motion sensor schematics

 

Code

Upload the following code.

cloud-download

Wrapping Up

This post shows a simple example on how to use the PIR motion sensor with the Arduino. Now, you can use the PIR motion sensor in more advanced projects. For example, you can build a Night Security Light project.

If you’re an absolute beginner, and you’re just getting started, we recommend taking a look at our Free Arduino Mini Course.

Thanks for reading. If you like this post probably you might like our next ones, so please support us by subscribing our blog.


Learn ESP32 with Arduino IDE

This our complete guide to program the ESP32 with Arduino IDE, including projects, tips, and tricks! The registrations are open, so SIGN UP NOW »

Leave a Comment:

Add Your Reply

⏰ Registrations are open ⏰
Sign up for "Learn ESP32 with Arduino IDE" Course