Multi colored line follower

I saw a problem statement of some robotics event, in which we have to follow a line on a white surface. The color of the line changes from black to red in between.

Also the lines run over each other, picture attached.

I cant figure out, how to get it to follow the line...can you suggest something.

Also will normal IR sensors be able to distinguish both black and red from white?

An IR sensor detects how much light it receives. More light is reflected by the white surface than is reflected by the black line. The red line should reflect an amount somewhere in between. The black changing to red which then crosses the black is an opportunity for your robot to demonstrate that is knows better than to always try to keep the darkest portion centered.

heyy, thanxs for the reply....

You are correct, i'll use the ir sensors to determine the darkest region and keep it in center...

Has something like this been done before, or has anyone got a code for it?

Has something like this been done before

Google "line following robot".

About 452,000 results (0.22 seconds)

But, they are all fake. You are the first person ever to build a line following robot.

hehe, :smiley:

i was talking about a "multi-colored" line follower...has someone tried it with arduino?

The only difference between following a single color line and following multiple color lines will be in the values returned by the IR sensors. You will need to experiment with your robot to see what values you get.

The challenge with the multi-color course is that typically, the robot wants to keep the highest (or lowest) values centered. In the multi-color situation, you need to change your thinking when the color you are following changes from black to red.

If I wrote the code for you, what would you have learned? Would you be competing fairly?