i need a tutorial to program an IR sensor (not ic) for differentiating colors ..for my line-following bot
i need a tutorial to program an IR sensor (not ic) for differentiating colors ..for my line-following bot
Personally I wouldn`t bother with IR for Colors, a simple Cadmium Disulphide photo resistor will do the job for you much easier.
although it Will be possible with IR, you Will get strange readings from different inks, that Look to be the same color to the naked eye, for instance Plants (yes the green growing things) will look perfectly White in IR and not Green at all.
so use something that responds in the Visible spectrum.
then it`s a case of outputting this sensor reading to an analog port of some description and using a Bounce-Back light to measure the reflectivity of the ink surface.
red will reflect red and give a high reading, but green will not reflect it and so it`ll give a low reading.
color opposites will be red-green, yellow-blue etc...
you`ll need to iluminate the line for the robot to follow anyway, so using an RGB LED will be a good choice.
the s/ware is fairly simple, light up Red and take a reading, then the same for Green, and then Blue, which ever gives the best reading is likely to be the color it`s seeing.
Personally I wouldn`t bother with IR for Colors, a simple Cadmium Disulphide photo resistor will do the job for you much easier.
although it Will be possible with IR, you Will get strange readings from different inks, that Look to be the same color to the naked eye, for instance Plants (yes the green growing things) will look perfectly White in IR and not Green at all.
so use something that responds in the Visible spectrum.
then it`s a case of outputting this sensor reading to an analog port of some description and using a Bounce-Back light to measure the reflectivity of the ink surface.
red will reflect red and give a high reading, but green will not reflect it and so it`ll give a low reading.
color opposites will be red-green, yellow-blue etc...
you`ll need to iluminate the line for the robot to follow anyway, so using an RGB LED will be a good choice.
the s/ware is fairly simple, light up Red and take a reading, then the same for Green, and then Blue, which ever gives the best reading is likely to be the color it`s seeing.