Adjustable_Infrared_Sensor_Switch_SKU_SEN0164-DFRobot

Introduction

This adjustable infrared sensor features a high-sensitivity photoreflector to perform distance detection function,ranging from 3cm to 40cm. When the infrared light emitted by the emitter gets reflected on a surface that blocked it, the phototransistor can pick up the signal for distance calculation. Also a potentiometer for adjustment is arranged for easy and clear use. Compared with regular infrared sensor switch, it has advantages in distance, low interference by visible light, affordable, easy to assemble, easy to use, and can be widely used in robot obstacle avoidance, assembly lines and many other occasions.

The obstacle detection distance can be adjusted with a potentiometer in copper screw, once done adjusting (e.g. max 60cm), the sensor will output low flat within the effective distance (e.g. obstructions at 40cm & 10cm ) to the microcontroller.

Specification

Connecting Diagram

Adjustable Infrared Sensor Switch Dia

Notice: For making the sensor working more stable with your arduino processor, we use an external resistor(range from 1K to 10K) for pull-up!

However, it's also available to connect the signal pin directly to the Arduino digital pin for testing. Just take care of the pin mode initialization in your Arduino software. Set the "INPUT_PULLUP" mode for the digital detection. For more details, please check the official PinMode function description.

Sample code

void setup()
{
 pinMode(3,INPUT);
 Serial.begin(9600);
}
void loop()
{
  int val=digitalRead(3);
  Serial.println(val);
  delay(500);
}

More Documents