I hope to design a project that can detect and object placed 1/2 inch in front of it. The object is a small brown box and I was thinking of using this reflective optical sensor: OPB733TR TT Electronics/Optek Technology | Sensors, Transducers | DigiKey
The sensor output could be connected to the A2D pin of an Arduino. When the brown object is placed in front, a threshold level is reached and the object is detected.
Problems I may see are:
-the brown box might absorb the light so nothing is ever detected. Is another type of reflective sensor recommended? It has to be small an inexpensive.
-direct sunlight on the sensor could disable it. Possibly pulsing the transmitted light and looking only for the pulsed reflected light would work?
Any feedback would be helpful.