CNY70 is a sensor commonly used in many robotics applications. It features an infrared transmitter and receiver. This sensor is used to distinguish between black and white colors at a distance of 2-3 cm.
The infrared beam emitted by the transmitter reflects off a surface and returns to the receiver. Based on the value we read from the receiver, we obtain information about the surface it reflected from.
We can measure the distance to a surface. By keeping the distance constant, we can also estimate the color of the surface based on the surface's reflectance rate.
CNY70 has two LEDs. One of these LEDs emits infrared light, and the infrared light that hits the surface is collected by the other LED on the sensor.
The intensity of the collected infrared light is measured by the sensor.
Since black and white colors have different reflectance coefficients for infrared light, the sensor reads different light intensities, which are interpreted by Arduino as black and white colors.
The sensor provides an analog output based on the intensity of the collected infrared light. Therefore, the CNY70 sensor is connected to Arduino's analog inputs.
Applications: