Wednesday, January 16, 2008

KRC Line Tracer & Programming source

Let's see the Line Tracer using 2ea IR sensors and 2ea LEDs
If you click the image, then it will be enlarged for your reference.



Let's see the struction of KAI Line Tracer







Let's see the programming source


The map has a black line on white paper. I programmed 2ea IR sensor detect white paper : (IR > 150) means IR sensor detects more reflected light via white color.
If sensor value is over 150 (IR > 150), the IR sensor is on the white paper.
So 2ea IR sensors detect white paper, it will forward while 2ea LEDs are lighting up.
If IR sensor detects black line, LED will be off and make a turn to redetect white paper.

Due to the inertia, I didn't make left or right turn. I use difference of 2ea DC motors' speed to make a little turn via speed difference.
If KRC Line tracer gets out of black line far away, then it will just go forward because it will detect only white paper. According to the position of IR sensors and speed of DC motors, you should program differently. I will show you another sample with different design and programming source.

No comments: