0

Line Robot - Basic lessons - Silver

Reflective sensors' primary task is to distinguish between black and white surface. However, ML-R sensors, like MRMS reflectance sensors 9x, CAN, analog, I2C (mrm-ref-can), ML-R Reflectance Sensor A (mrm-ref-a), and other are constructed in a way to be able to detect a highly reflective surface, like metal foil. Black reflects light poorest, white much better, but a metal foil even better. The key to success is to have a right transistor, and at a right distance, so that light reflected from a white surface doesn't saturate the transistor. For example, if the readings upper limit is 1023, and we have the following results, that will indicate saturated white:
  • Black: 100
  • White: 900
  • Foil: 910
In this case, it is not possible to reliably distinguish between white and foil. However, the next example is much better:
  • Black: 100
  • White: 600
  • Foil: 900
The window is much bigger and here silver can be easily detected. How to achieve the second readings?
  • Move the sensor higher.
  • Transistors are not the same, neither illumination is. Find the one with the lowest readings. Most probably one of the 2 edge transistors as they have only 1 LED illuminating them, instead of 2, like all the rest.
  • Use a separate sensor that is put higher. This options has advantage of reading analog values constantly. If You have a sensor like MRMS reflectance sensors 9x, CAN, analog, I2C (mrm-ref-can), You can use it either as digital or analog. It is possible to read digital and analog values at the same time, though the sensor's response time will increase.
There is another way to detect silver: use ML-R 6-channel color sensor CAN Bus (mrm-col-can) and its function value(), if available in Your robot. You may get even better results.

Task: read silver reflective foil.

No code here. Just put the sensor on the right distance and locate the transistor with lowest value.