This little infrared emitter and detector combo can be used a few different ways, when hooked up to an Arduino. Each of the IR emitters are housed in copper tubes, so the detector (located in the center of the board), should only pick up infrared light after it’s bounced off an object.
Not surprisingly, it can detect whether an object is in front of it (up to a distance of approximately 10 inches.) In addition to this Z axis information, the sensor can also determine an obstacle’s X axis, relative to the sensor itself.
What’s really cool about this sensor, however, is the gesture recognition. When the correct library is added to your Arduino, the sensor can identify a few simple gestures: a swipe to the right, a swipe to the left, and an upward swipe.
The ZX Distance and Gesture Sensor can be purchased from Sparkfun for $24.95.