I am working on a project where my bot has to detect whether a wall is colored white or not.The wall will be at least be 8cm away from the bot.Which sensor can be used for this purpose which can detect color at this distance?
To be a little bit picky: white is not a color but the absence of any color.
What colors can the wall have if it's not white? Don't tell us "black" or "grey" because that also are not colors but different brightness levels of white.
Does the wall emit light itself? If not, how do you enforce that the bot won't be tricked by shadows?
You need multiple sensors and filters to derive at white. I believe it's possible with Red Blue and Yellow filters. This seems rather challenging because your filters have to be perfect.
The Arduino-compatible Pixy camera can be taught to recognize colors.
The TCS34725 color sensor will also work.
pylon:
To be a little bit picky: white is not a color but the absence of any color.
To be picky, it's the presence of all colours.
Black would be the absence of colour.
exactly the pretense of R G B at high saturation could indicate white.
There are "line tracking sensors".
Probably, to make it reliable works at 8cm distance somekind of tube has to be attached, to narrow field of vision.
Than, having two sensors installed on the robot , procedure to detect black stripe is the same as any line-tracking robot follows. Only one little difference, since the wall would not have a black line on it, you need to attach a black cardboard to the robot and position it right on front of the first sensor at 8cm distance. Thats it, "contrast sensor". The necessity for black eye-ed sensor is to have a reference for different lighting/ temperature environment.