Can anybody recommend a good light/color sensor that accurately works with a range of 2"-3"? Thank you!
You’ll have good luck with a Diffuse IR photoelectric sensor. You can choose to have it “on” when it sees an object, or “off” depending on the model. Various voltages too - 10-30V work pretty well but I’d power most of them off the voltage regulator unless they’re good down to 5.5 with is rare with most industrial stuff.
You can also do it mechanically with micro switches, and in a pinch you can even substitute in something like a vex ultrasonice sensor.
We actually just bought some sensors today. We particularly like the Sick ZT2 type, and I got a couple from Ebay cheap. Sensing ranges vary from 5mm to 400mm depending on the sensor.
Here’s a nice Dark operate one with a 2 inch range:
Here’s a 4 inch range that you might be able to apply your automation direct pdv to purchase:
http://www.automationdirect.com/adc/Shopping/Catalog/Sensors_-z-Encoders/Photoelectric_Sensors/DC_Rectangular/Diffuse(QM-z-CX-z-FE_Series)/QMRB-0P-0A
Actually I take that back. I think you want an npn version for easy wiring to the roborio. So look for the npn versions of the above sensors.