IR beam break barrier with 2 sensors

Pack containing one infrared emitter LED and one receiver

SKU 5980-IRBBSENSOREAN 8219671076890Item type: Assembled

Description

Package containing an infrared LED emitter and a receiver. Placed facing each other, at a maximum distance of 25 centimeters, they allow creating an infrared barrier capable of detecting interruption of the beam emitted by the transmitter. Compared to PIR sensors, beam interruption is much faster and allows better control. The receiver is a transistor with open collector output to which you can connect a relay, an LED, or another device that draws a maximum of 100 mA. They can also be used with Arduino or another microcontroller.

Example sketch for Arduino

/*
IR Breakbeam sensor demo!
*/

#define LEDPIN 13
// Pin 13: Arduino has an LED connected on pin 13
// Pin 11: Teensy 2.0 has the LED on pin 11
// Pin 6: Teensy++ 2.0 has the LED on pin 6
// Pin 13: Teensy 3.0 has the LED on pin 13

#define SENSORPIN 4

// variables will change:
int sensorState = 0, lastState=0; // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(LEDPIN, OUTPUT);
// initialize the sensor pin as an input:
pinMode(SENSORPIN, INPUT);
digitalWrite(SENSORPIN, HIGH); // turn on the pullup

Serial.begin(9600);
}

void loop(){
// read the state of the pushbutton value:
sensorState = digitalRead(SENSORPIN);

// check if the sensor beam is broken
// if it is, the sensorState is LOW:
if (sensorState == LOW) {
// turn LED on:
digitalWrite(LEDPIN, HIGH);
}
else {
// turn LED off:
digitalWrite(LEDPIN, LOW);
}

if (sensorState && !lastState) {
Serial.println("Unbroken");
}
if (!sensorState && lastState) {
Serial.println("Broken");
}
lastState = sensorState;
}

Documentation and useful links

Technical details

Distance about 25 cm
Power supply from 3.3 to 5.5 Vdc
Transmitter consumption 10 mA @ 3.3V, 20 mA @ 5V
Load applicable to receiver output 100 mA
Transmitter/Receiver LED angle 10°
Response time <2 ms
Dimensions (mm) 20x10x8
Cable length 234 mm
Weight 3 grams (single sensor)

About us

Open-Electronics.org is the brainchild of a world leader in hobby electronics Futura Group srl. Open-Electronics.org is devoted to support development, hacking and playing with electronics: we share exciting open projects and create amazing products!

Open-Electronics.org is not just a container of ideas: it is also a web site lead by a team of engineers and geeks who will take part in the discussions and give support.

Our mission is to become a reference Open Source hacking site with ideas and feedback aimed to enrich the community.