IR proximity sensor
Contents
Introduction
This is the ubiquitous IR proximity sensor connected to most obstacle avoidance robots. Our infrared transceiver modules contains an infrared transmitter and a receiver fit in a compact form on a tiny board. Transmitter emits infrared light and another receiver (photo-transistor) receives that IR light after reflection. The module has both analog and digital output. Analog output can be used to calculate the distance to the nearest object while digital sensor can be used to trigger an action when the module detects an obstacle.
Analog pin read the distance to the nearest obstacle and outputs analog values. The digital output can be connected to trigger an activity when the distance falls below a threshold value (set by the pot)
Features
- Outputs both analog and digital values
- Onboard LED indicates if the module is connected properly
- Another onboard LED indicates when threshold values are touched (turns on)
- Great for DIY projects and Arduino beginners
- M3 Mounting holes to mount the module on your desk or project
Specifications
| Model | IR - Proximity Sensor |
|---|---|
| Number of Pins | 4 (AO, DO, VCC, GND) |
| Output Type | Analog and/or Digital Output |
| Operating Voltage | 4.5V to 6V |
| Lead Pitch | 0.1th inch (2.54 mm) Breadboard compatible |
| Dimension | 0.6" x 1.3" x 0.5" inch (15.25 mm x 33mm x 12.7 mm) |
| Operating Temperature | 0C to 60C (± 10%) |
| Range | 0.5cm – 5 cm |
| LED Indicator | SIG (Orange or Red), PWR (Green) |
| Weight | 20 Grms |
Interface
Pin Definition
- AO : This is the analog output pin from the sensor and should be connected to Analog input pin of microcontroller. If you are using an Arduino, this can be connected to any of the analog pins A0 through A5 (on UNO for example). On a Draco board, this can be connected to any of the pins PC0 through PC5. If you are using LCD, then the module can be connected to PC4 or PC5 and sensor values can be displayed on LCD. Analog output from IR proximity sensor can be used to identify distance to the nearest obstacle (though it varies with change in color of different materials)
- DO : This is the digital output pin from the sensor. The pin is connected to a pull-up resistor and will read high. You can adjust the pot to set a threshold value. A comparator continuously checks if the analog pin has hit the threshold value. When it crosses the threshold, the pin goes low and signal LED turns on. This setup is very useful when you need to trigger an action when certain threshold is reached. For example, when the distance to nearest obstacle is less than 3cm, you can signal your robot to reverse and change direction. If it is more than 5cm, and there is no indicator, you can drive straight.
- VCC : Positive power pin and this should be connected to VCC (or +5V) of your microcontroller.
- GND: Ground pin and this should be connected to GND(or 0V) of your microcontroller.
Usage
Code for Arduino
/*
* Product: IR Proximity Senosr
* SKU : VEE00051
* Description: The example demonstrates usage of connecting an IR proximity sensor
* to an Arduino board. AO (Analog Output) from Sensor is connected to
* A0 (Analog 0) pin of Arduino. When sensor detects an obstacle, analog values
* are sent to Arduino's serial port and displayed on your serial monitor
* These values can be used to detect the distance to nearest obstacle
*/
void setup()
{
Serial.begin(9600); // initiate serial port
}
void loop()
{
int irSensorValue;
irSensorValue=analogRead(0); //connect proximity sensor to Analog 0
Serial.println(irSensorValue,DEC);// display analog values on serial port
delay(100);
}
Application Ideas
This sensor is used for following purposes:
- Obstacle Avoidance
- Line follower (when LEDs mounted facing the ground)
- Distance sensor (if the obstacle color is same across, then gives almost accurate readings)
Demonstration
- Coming soon...
Resources
- Schematic - Coming soon...
Support
If you have any questions or queries, contact us