This sketch reads data from a PIR sensor, lights an LED and writes to Arduino IDE's Serial Monitor when motion is detected.
In order for this to work, follow these steps:
- connect the PIR wires to a breadboard
- connect jumper wire on breadboard parallel to gnd wire from PIR, connect other end to gnd on arduino
- connect jumper wire parallel to "out" from arduino on breadboard and to pin 8 on arduino
- connect jumper wire parallel to +5v from arduino on breadboard to 5v on arduino
- connect led negative side parallel to gnd on breadboard, positive not parallel to anything
- connect wire not parallel to anything on breadboard and in pin 3 on arduino
- connect 220 ohm resistor parallel to positive led and parallel to wire connected to pin 3
- download arduino IDE
- create a sketch
- paste code
- upload sketch
- open serial monitor (top right icon in IDE)