How does Canandcolor work?¶
The Canandcolor contains two distinct sensors onboard: A IR Proximity sensor and a color sensor. These both work on similar principles, sending the intensity of reflected light, but operate in different wavelengths.
The onboard IR Proximity sensor works by pulsing an IR LED out and measuring the intensity of reflected IR light. This gives a value proportional to proximity, as farther away objects will reflect less IR back to the sensor. If an object is too far away, not enough IR light reflects back to the sensor for it to read, and if an object is too close then too much light can reflect back, leading to oversaturation. In practice, the sensor oversaturates in the <2cm range.
The color sensor works by measuring the intensity of different reflected wavelengths of light. Unlike the IR sensor, this does not emit its own light automatically, but rather lets the user control a built in LED if the lighting is insufficient for it to gain a proper reading. The color sensor can detect white light, which is effectively just the intensity of all emitted light, which is proportional to proximity at very close distances.