Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
ENERGEN
Published

How to Use PIR Sensor module with Arduino

This tutorial for Arduino beginners.

BeginnerProtip1,289
How to Use PIR Sensor module with Arduino

Things used in this project

Story

Read more

Schematics

How to connect PIR Sensor

Code

PIR Sensor project code

Arduino
void setup() {
pinMode(2,INPUT);
pinMode(13,OUTPUT);

}

void loop() {
int val= digitalRead(2);
 if(val == 1){
  digitalWrite(13,HIGH);
 }
 else{
  digitalWrite(13,LOW);
 } 
}

Credits

ENERGEN
17 projects • 10 followers
Youtube creator

Comments