September 2016
Intermediate to advanced
495 pages
9h 37m
English
Let's get started. We are going to create a setup in which an LED flashes when motion is detected by the PIR sensor. This is what the setup should look like when connecting the Arduino to the PIR Sensor:

Basically, the connections are as follows:
Digital pins are denoted using D and analog pins are denoted by A. So digital pin 13 is D13 and analog pin 2 is A02.
Open Arduino and load the sketch called PIR_LED.ino, or copy this:
int ledPin = 13; // use the onboard LED int pirPin = 2; // 'out' of PIR connected to digital pin 2 int pirState = LOW; // start the state of the PIR to be ...
Read now
Unlock full access