Skip to content
Related Articles

Related Articles

How to make Motion Detection System using Arduino?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 22 Jun, 2022

Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards can read digital & analog inputs from the sensors and The PIR sensor is a special type of sensor which is usually used for security purposes. It detects the objects by reading the Infrared radiations emitted by the objects. Any object whose temperature is above absolute zero emits radiation. This radiation is not visible to human eyes. The PIR sensor is designed to detect this Infrared radiation.

In this article, We will learn how can we make a Motion Detection System using Arduino. When the PIR Sensor will detect any motion, it will show that on the Serial Monitor and the buzzer will start.

Components Required

  • Arduino UNO -> A microcontroller board based on the ATmega328P
  • PIR Sensor -> Which detects the motion
  • Buzzer -> A device that produces sound or alarm
  • Jumper Wires -> For connecting the elements of the circuit

Circuit Diagram

 

In this circuit, the PIR sensor detects the motion and sends the digital value to the Arduino and Arduino sends the signal to the Serial Monitor and the buzzer will be started. otherwise, it will be off.

Pins Connection

  • Arduino Digital pin 9 is connected with the (+ve) pin of Buzzer
  • Arduino GND pin is connected with (-ve) pin of Buzzer
  • Arduino Digital pin 2  is connected with the Signal pin of the PIR Sensor
  • Arduino 5V pin  is connected with the Power pin of the PIR Sensor
  • Arduino GND pin is connected with the GND pin of the PIR Sensor

Arduino Code

//Defining pins

int buzz = 9;
int pir = 2;

void setup()
{

  // Sets the buzzer as an OUTPUT & PIR sensor as an INPUT
  pinMode(buzz, OUTPUT);
  pinMode(pir, INPUT);
  
  
// Serial Communication is starting with 9600 of baudrate speed
  Serial.begin(9600);
}

void loop()
{
  //Read data from the sensor
  int status = digitalRead(pir);
  
  
// check data from sensor if there is motion,
// if will execute otherwise else will execute
  if(status == HIGH)
  {
    Serial.println("Motion Detected");
    tone(buzz,1000,700);
    delay(2000);
  }
  else
  {
    Serial.println("No one is there");
    delay(1000);
  }
 
}

Output:

simulator

My Personal Notes arrow_drop_up

Start Your Coding Journey Now!