Yun Jin Yonggledel임동교
Published © GPL3+

Innovation Lab #11: PIR Motion Sensor with LED

A Bongilcheon High School Innovation Lab project.

BeginnerShowcase (no instructions)10 minutes21,366
Innovation Lab #11: PIR Motion Sensor with LED

Things used in this project

Story

Read more

Schematics

PIR (Motion Sensor)

PIR (Motion Sensor)

Code

PIR (Motion Sensor)

Arduino
PIR (Motion Sensor) LED turn on or turn off.
int led = 13;
int sensor = 2;

void setup() {
  pinMode(led, OUTPUT);
  pinMode(sensor, INPUT);
  Serial.begin(9600);
}

void loop() {
  int sensorval = digitalRead(sensor);
  Serial.println(sensorval);
  
  if (sensorval == HIGH) {
    digitalWrite(led, HIGH);
  }
  else {
    digitalWrite(led, LOW);
  }
}

Credits

Yun Jin Yong
6 projects • 10 followers
Contact
gledel
100 projects • 116 followers
Looking back on my childhood, I was happy when I was making something and I was proud of myself. "Making is instinct!"
Contact
임동교
0 projects • 12 followers
Contact

Comments

Please log in or sign up to comment.