You can throw a Raspberry Pi camera and OpenCV at the problem and approach it through ... build this reflective RGB sensor from an LED and a photocell. The principle behind [TechMartian ...