Circuit to sense the motion using PIR motion sensor and arduino uno

<<< Previous : Temperature measured on seven segment display by LM35 and arduino

Motion sensing is important to make automatic room lights and anti-theft systems. Automatic room lights will sense the presence of humans by motion and will turn on lights if there is human motion in the room. Similarly anti-theft system will turn on siren if someone moves in the room.

Images of the motion sensor is given below. 1st pin is VCC. 2nd pin is OUT and 3rd pin is Gnd. Here, we will see the circuit to sense the motion using arduino board.

Screenshot from 2015-08-22 16:31:04

Front view of motion sensing module

Front view of motion sensing module with a dome shaped fresnel lens over sensor

Front view of motion sensing module with a dome shaped fresnel lens over sensor

Screenshot from 2015-08-22 16:38:05

Back view of motion sensing module

Circuit to sense the motion using arduino uno is given below. Connections can be summarized as :

  • VCC (pin 1) of motion sensor is connected to the 5V pin of arduino uno.
  • GND (pin 3) of motion sensor is connected to the Gnd terminal of arduino uno.
  • OUT (pin 2) of motion sensor is connected to the digital pin 9 of arduino uno.

1 74165 using Arduino

After completing the circuit, upload the following program to your arduino board. If uploading is successful, open your serial monitor. Serial monitor will print 1 if somebody moves in front of sensor. Otherwise, serial monitor will print 0.

int inPin = 9;   // motion sensor connected to digital pin 9
int val = 0;     // variable to store the read value

void setup()
{
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  pinMode(inPin, INPUT);      // sets the digital pin 7 as input
}

void loop()
{
  val = digitalRead(inPin);   // read the input pin
  // print out the state of the button:
  Serial.println(val);
  delay(1);        // delay in between reads for stability
}

Next : Circuit to interface a 16 * 2 LCD display to arduino uno >>>

(Visited 559 times, 1 visits today)
paulpp644
A deep electronic enthusiast who spent most of my time for electronic experiments. I am also interested in publishing my experiments in my blog for helping other electronics enthusiasts.