Introduction

This is a simple to use motion sensor. Power it up and wait 1-2 seconds for the sensor to get a snapshot of the still room. If anything moves after that period, the 'alarm' pin will go low.

Specification

Application

Pinout

Infrared_Sensor_new1.jpg

Num Label
1 Digital Signal Out
2 VCC
3 GND
4 Jumper Selection: Repeatable trigger and unrepeatable trigger selection.
H: Repeatable trigger
L: Unrepeatable trigger
5 Potentiometer: To adjust trigger latency from 0.5s to 50s.

Tutorial

Connection Diagram

Motion sensor Connection diagram

Sample Code

 const int buttonPin = 2;
  const int ledPin =  13;
  void setup() {
    pinMode(ledPin, OUTPUT);
    pinMode(buttonPin, INPUT);
  }
  void loop()
  {
     if (digitalRead(buttonPin) == HIGH)
     {
       digitalWrite(ledPin, HIGH);
     }
     else {
       digitalWrite(ledPin, LOW);
     }
  }

Result

When sensors detect people closed, the light will be lighted.

Q&A Some general Arduino Problems/FAQ/Tips
A Please click the topic link on DFRobot Forum.
A For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents

DFshopping_car1.png Get Digital Infrared motion sensor_SKU SEN0018 from DFRobot Store or DFRobot Distributor.

Turn to the Top