Step 1: Connect the PIR Sensor

Connect the PIR sensor with cables. We use the following colors:

red... +5V
black... GND (ground)
yellow... OUT (signal)

pir-sensor-1

Step 2: Connect the Breadboard

Have a look here on how to connect the breadboard. Make sure to shutdown and disconnect your Pi before you do any cabling.

Step 3: Connect Sensor and Breadboard

Connect the three cables from the sensor to the following pins of the connector:

red...   +5V
  black... GND
  yellow... GPIO Pin 22

pir-sensor-2

Step 4: Logic in Reactive Blocks

Import the library Raspberry Pi PIR Motion Sensor . It is shared in the team NTNU IOT Recipes.

Reactive_Blocks_-_PIR_Test_-_Eclipse_-__Users_kraemer_Workspaces_workspace-ntnu-iot

The block produces an output each time a motion is detected.

Leave a Reply