Color Sensor

Introduction

We did a mini-project on the 29th of September. Our work had to do with the colour sensor, more specifically the TCS 3200 colour sensor from DF-ROBOT. Unfortunately, we had a lot of problems and didn't manage to fix them, for example: we changed all the wires in case one of them didn't work and we tested it with 5V and 3,3 V from the Arduino. As a consequence of not solving the problems we have not made an explanatory video.

Materials

To make this project, we have used different materials such as the Arduino Uno, the colour sensor and different cables to connect all of them together.

TCS3200 Colour Sensor Features

How does it work?

The light hits the different photodiodes (16 red, 16 green, 16 blue and 16 without filters) and is directed to an electronic circuit that converts the current variation into frequency variation and then in the output (OUTPUT) we will have the frequency of a colour.

All the pins of the colour sensor:

Colour sensor code:

Problems and Conclusions

The TCS3200 colour sensor is very inaccurate and very likely to be wrong. We pass three objects of red, green and blue colours, in none of them the colour matches, the Red channel ALWAYS has the lowest value, while the green channel ALWAYS has the highest value, even if we put coloured objects underneath or not. The sensor does not light up any of the 4 leds around it, and therefore the surface we are analysing may have the shadow factor, another solution that occurred to us in this long problem is that we have analysed the surfaces at different heights although we were always within the limit set by the light sensor. The first code told us the value of each colour but it went very wrong as it told us all the time a colour or Unknown. Seeing that with the first code there were many errors, then we used the code that was on the DF-ROBOT page, but it gave us many errors and we decided to make another one which gave us a value for each primary colour, the values were above 600 and we thought that we had made a mistake because the maximum intensity of a colour is 255, and we tried to map it but it didn't work very well. And we decided to go ahead, we put a red object and we observed how the green value was higher but we realised that what mattered was the variation and we made different approximate scales of values for each colour and that tells us the colour, and so we realised that the number was not really the intensity of the colour, but every time we tried to calculate the scales of values we got very different data and we didn't know how to make the scales well. Because of the shade etc.