Arduino IDE (If Arduino is used): Download Here
Construction of the circuit
With the help of double sided tape stick the servo motor and the PIR together as shown below. Make sure the shaft of the motor rotates without any external disturbances.
Next we do the circuit connections as shown below. Connect the circuit carefully to avoid errors.
After connecting the circuit. Your prototype will look like as shown.
Now it’s time to Rock and Roll. Open your Arduino IDE and paste the code from here. You can directly upload to it to your board as well.