I played around with the 2Ya21 Sharp Infrared Proximity Sensor and found that it was simple to set up and use thanks to this tutorial by Bildr! The way the sensor works is that it outputs a reading depending on how far an object is away from it.
The effective range of operation of this sensor is approximately 3 feet. When an object is greater than 3 feet away from the sensor, the reading output is 0. As an object gets closer, the voltage output increases until about 4 inches, the shortest distance, where the Arduino reads 630. Within 4 inches, the reading starts to dip again.
I placed an object at 20, 40, 60, and 80 cm from the sensor and got output values of around 260, 130, 110, and 80, respectively.
Problems
The sensor has stranded wire at the end, so I soldered solid core to it in order to hook it up to the Arduino.
Comments