The sensor contains 2 elements: an infrared LED that emits light in the infrared range, and a sensitive photocell. If there is a reflective surface near the sensor, part of the light returns to the photocell. The closer the surface and the “whiter” it is, the more light returns to the receiver, the higher the sensor readings. The sensor transmits a value between 0 and 1023.
The IR sensor A is Lego- and Arduino-compatible.