It is possible to have a guard at the entrance to your house to keep it safe, but this will cost you a lot of money! The best solution to this problem is to use a motion sensor called a PIR sensor. This sensor can easily detect when someone moves in front of it.
In this tutorial, we will use the PIR sensor to send a message to your computer when someone enters your house.
Connect the wires between the PIR motion sensor and the Arduino, as shown in the image below.
Connections from the Arduino to the PIR sensor:
• Arduino GND pin → PIR sensor GND pin (- pin)
• Arduino pin 2 → PIR sensor out pin
• Arduino VCC pin → PIR sensor VCC pin (+ pin)
Now access the serial monitor on your Arduino IDE by clicking on the magnifying glass icon at the top right corner.
Now, as we see in the following image, the serial monitor displays the security alert because the sensor was triggered, which means there is someone at your house!