|
1 | | -# Passive Infrared Motion Sensor (PIR) |
| 1 | +# Passive infrared motion sensor (PIR) |
2 | 2 |
|
3 | | -Humans and other animals emit radiation all the time. This is nothing to be concerned about though, as the type of radiation we emit is called Infrared radiation (IR), which is pretty harmless at the levels emitted by humans. Infact, all objects above absolute zero (-273.15C) emit IR radiation. |
| 3 | +Humans and other animals emit radiation all the time. This is nothing to be concerned about, though, as the type of radiation we emit is infrared radiation (IR), which is pretty harmless at the levels emitted by humans. In fact, all objects above absolute zero (-273.15C) emit IR radiation. |
4 | 4 |
|
5 | | -A PIR sensor detects changes in the amount of IR radiation it receives. When there is a significant change in the amount of IR radiation it detects, then a pulse is triggered. This means that a PIR sensor can detect when a human moves infront of it (or indeed any animal). |
| 5 | +A PIR sensor detects changes in the amount of IR radiation it receives. When there is a significant change in the amount of IR radiation it detects, then a pulse is triggered. This means that a PIR sensor can detect when a human (or any animal) moves in front of it. |
6 | 6 |
|
7 | 7 |  |
8 | 8 |
|
9 | | -## Wiring a PIR sensor. |
| 9 | +## Wiring a PIR sensor |
10 | 10 |
|
11 | | -The pulse emitted when a PIR detects motion needs to be amplified, and so it needs to be powered. There are three pins on the PIR, and they should be labled `Vcc`, `Gnd` and `Out`. If these labels aren't clear, they are sometimes concealed beneath the fresnel lens (the white cap), which you can temporarily remove to see the pin labels. |
| 11 | +The pulse emitted when a PIR detects motion needs to be amplified, and so it needs to be powered. There are three pins on the PIR; they should be labelled `Vcc`, `Gnd`, and `Out`. If these labels aren't clear, they are sometimes concealed beneath the Fresnel lens (the white cap), which you can temporarily remove to see the pin labels. |
12 | 12 |
|
13 | 13 |  |
14 | 14 |
|
15 | 15 | 1. As shown above, the `Vcc` pin needs attaching to a `5V` pin on the Raspberry Pi. |
16 | | -2. The `Gnd` pin on the PIR sensor can be attached to *any* ground pin on the Raspberry Pi. |
17 | | -3. Lastly the `Out` pin needs to be connected to any of the GPIO pins. |
| 16 | +1. The `Gnd` pin on the PIR sensor can be attached to *any* ground pin on the Raspberry Pi. |
| 17 | +1. Lastly, the `Out` pin needs to be connected to any of the GPIO pins. |
18 | 18 |
|
19 | | -## Detecting Motion |
| 19 | +## Detecting motion |
20 | 20 |
|
21 | | -You can detect motion with the PIR using the code below. |
| 21 | +You can detect motion with the PIR using the code below: |
22 | 22 |
|
23 | 23 | ```python |
24 | 24 | from gpiozero import MotionSensor |
|
0 commit comments