ENERGEN
Published

How to Use PIR Sensor module with Arduino

This tutorial for Arduino beginners.

BeginnerProtip1,287
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

ENERGEN

17 projects • 10 followers
Youtube creator

Comments