The Pololu 38 kHz IR Infrared Proximity Sensor can sense objects up to one foot way (30cm).
This sensor uses IR Infrared light to detect objects by measuring the reflection of an invisible beam of light. The Infrared light is modulated at a frequency of 38 kHz to improve performance. This tiny sensor can be used with both 3.3V and 5V systems and draws only about 8mA of current.
Connect the ground (GND) and voltage (VDD) pins to a 3.3-5V power supply. Connect the digital detection indicator (OUT*) to a digital input on your microcontroller. Connect the IR LED output enable (ENABLE) pin to a digital output or leave it disconnected for continuous operation. Set the ENABLE pin HIGH while performing a read operation. The detection indicator on the OUT* pin will be LOW when an object is detected or HIGH otherwise.
To assist with debugging, a green LED will light up when the IR LED is enabled and a red LED with light when the sensor detects something.
This sensor comes with two optional headers that require soldering.