Digital Laser Proximity Sensor (1-400cm) Wiki - DFRobot

Introduction

This digital laser proximity sensor, the advanced version of SEN0381, offers a longer sensing distance and comes with an indicator for showing real-time sensor status. Keep pressing down the on-board button for 3 seconds, then the indicator starts to flash and the detection distance can be adjusted within 1 to 400cm as per your need. The sensor can automatically detect and save the distance between it and the obstacle ahead.
In addition, the sensor features digital signal output, which works well with Arduino IO expansion board. It can be widely used in applications like smart home, house security, intelligent detection and control, robot obstacle, and so on.
The sensor is based on the principle of diffuse reflection of laser on the object. When a person or object enters the sensing range in front of the sensor, the sensor immediately determines that there is induction, so as to control to output signal; after the person or object leaves the sensing range, it will judge that there is no induction, and stop signal output, by which intelligent control can be achieved.

Specification

Pinout

Num Label Description
Yellow OUT Signal output
Brown VCC Power positive 5-24V
Blue GND Power negative
Black Floating

Dimension Diagram

Tutorial

Requirements

Connection Diagram

How to adjust detection distance
Keep the sensor powered on and in the normal operating status, and place a roughly 80x80cm of kraft paperboard (or other objects) in front of the sensor at 70cm. The distance adjustment steps are as shown in the diagram, enter the distance adjustment mode: hold on the adjustment button, when the red LED indicator flashes, enter the automatic distance adjustment mode; don't move the sensor and paperboard when the LED flashes, when the LED indicator stops flashing, the distance adjustment is done.

Sample Code

/*!
 * @File  Infrared_Approach_Sensor.ino
 * @brief  Detect the status of IO4 and print it in serial port
 * @copyright  Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
 * @licence  The MIT License (MIT)
 * @version  V1.0
 * @date  2020-08-20
 */
int  OUT = 4;
int  i = 0;
void setup()
{
  Serial.begin(9600);
  pinMode(OUT, INPUT);
}
void loop()
{
   i = digitalRead (OUT);
   Serial.println(i);
   delay(1000);
}

Achieve function: read real-time status of IO4, when the sensor detects an object, serial prints 1; when no object is detected, serial prints 0.

FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents