#include <Servo.h>
Servo myservo;
int servo_motor = 10; // SERVO motor to PIN no 10 
int led=11;// LED anode PIN no 11
int pir=12;//PIR Signal to PIN no 12


void setup()
{
  pinMode(pir,INPUT);
  pinMode(led,OUTPUT);
  myservo.attach(9); 
  Serial.begin(9600);

}

void loop()
{
  int value_of_pir = digitalRead(pir);// Get the Input from PIR to Processor

  if(value_of_pir==HIGH)
  {
    digitalWrite(led,HIGH);
    myservo.write(180);// angle of rotation of SERVO ARM
    Serial.println("Motion Detected");
  }

  else
  { 
    digitalWrite(led,LOW);
    myservo.write(0); // Initial Angle of SERVO ARM
    Serial.println("Motion Completed");
  }
}