Digital Non-Adjustable Infrared Proximity Sensor (2cm - 10cm range)

This is an edge detection sensor. It will help your robot detect the edge of a precipice, preventing it from falling off a table or down the stairs to it's certain demise! This IR distance sensor is connected to an arduino digital pin.

Applications
Edge detection sensor
Intelligent Mobile Robotics Platforms
Home Cleaning Robots

Specification
Supply Voltage: 2.7~6.2v
Current: < 10mA
Range distance: 2~10cm (Low), <2cm or >10cm (High)
Interface:1 digital pin
Signal Voltage: Vcc-0.6V (High), 0.6V (Low)
Size: 36.0x10.0x15.0 mm
Weight: < 5g

desc1

void setup(){
 Serial.begin(9600);
}

void loop(){
  Serial.print("Digital Signal:");
  Serial.println(digitalRead(3),BIN);
  delay(50);
}


Digital Adjustable Infrared Proximity Sensor (3cm - 80cm range)

The Detecting distance can be adjusted according to the users specific demands. The detecting is small, easy to use, inexpensive, easy to assemble and The switching signal output differs in accordance to the obstacles that it detects. It remains high when no obstacles and remains low when there are obstacles. There is also a red led on its back to indicate the sensor status.

Specification
Power supply: 5V
Working Current: <100mA
Adjustable detection range: 3cm - 80cm
Dimension: 45x18mm

Pin description:
Brown - 5V
Blue - GND
Black- Signal

Digital output:
"0" - found barrier (~0V)
"1" - no barrier (~4V)

Tutorial

desc1


const int InfraredSensorPin = 4;//Connect the signal pin to the digital pin 4
const int LedDisp = 13;

void setup()
{
  Serial.begin(57600);
  Serial.println("Start!");
  pinMode(InfraredSensorPin,INPUT);
  pinMode(LedDisp,OUTPUT);
  digitalWrite(LedDisp,LOW);
}

void loop()
{
  if(digitalRead(InfraredSensorPin) == LOW)  digitalWrite(LedDisp,HIGH);
  else  digitalWrite(LedDisp,LOW);
  Serial.print("Infrared Switch Status:");
  Serial.println(digitalRead(InfraredSensorPin),BIN);
  delay(50);
}

Result
Cover the sensor head with your hand, the LED(Pin13) on board will light up, hold it toward an open area, the LED will be off. Open Arduino IDE serial monitor, you can also get the Infrared sensor status.

desc2


Analog Adjustable Infrared Proximity Sensor (3cm - 50cm range)

The adjustable infrared sensor features a high-sensitivity photoreflector to perform distance detection function,ranging from 3cm to 50cm. 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. With 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 (eg max 60cm), the sensor will output low flat within the effective distance (eg obstructions at 40cm & 10cm ) to the microcontroller.

Specification
Power supply: 5V
Control Outout: 100mA when supply 5V
Circuit consume: <25mA
Response time: <2ms
Direction: ≤15°
Range: 3~50cm adjustable for opacity and transparent objects
Shell marterial: plastic
A low voltage output will be given when a object is in its detecting scope
When connect to MCU pins, you need to add an 1~10K Ohm resistor for pull-up
Sharp: 30mm(length) x 20mm(wide) x 13mm(thickness) with a 45cm lead wire

desc1

RED--->VCC
YELLOW-->Signal
GREY-->GND

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);
}