Detecting motion with a PIR sensor
We will build a project with a common home automation sensor: a motion sensor (PIR). Have you ever noticed those little white plastic modules that are in the top corners in some rooms of the houses, the modules that change color to red when someone walks in front of them? That's exactly what we will do in this project.
The motion sensor must have three pins: two for the power supply and one for the signal. You should also use a 5V voltage level to be compatible with the Arduino card, which also operates at 5V. The following image shows a simple motion sensor:
For practical purposes, we will use the signal input 8 for connecting the motion sensor, the signal voltage of 5 volts and ground GND.
PIR sensor interfaced with Arduino
PIR sensors detect body heat (infrared energy). Passive infrared sensors are the most widely used motion detectors in home security systems. Once the sensor warms up, it can detect heat and movement in the surrounding areas, creating a...