Five Infrared Sensors: Sensors helps robot to find its path and keeps it updated about the line on the floor.With five sensors their are 32 combination possible but many of them are unlikely to occur in our experiment.For ex. 11111(All indicating black) will never occur because their is only one line and this pattern is showing that line on both side of robot including line on which it is moving.
Deciding some rules:
Before implementing this project, you should decide some basic rules which robot must follow. For example if robot face a situation of T or Four Way , in which direction it should turn? Some students go for right hand rule where robot always give preference to right hand side and some go for left hand rule, though both rules are correct, you need to select one of them and teach robot accordingly.
Define intersections ( turns except only right and only left) where robot needs to take decisions.
Robot should store information about Dead ends(180 degree turns where pattern is five zeroes 00000) and Bad turns.
Step 1). Robot will start from first end and move straight as their is only one line.
Step 2). It will move Left because their is only left direction( no intersection so no storage) where it can move.
Step 3). Move Left again(no intersection therefore no storage)
Step 4). Move Left ( Intersection and we apply Left hand Rule) Store L
Step 5). Take U Turn ( Reached Dead End) Store value becomes LU
Step 6). Take Left Again ( Intersection and applies left hand rule) Store value becomes LUL . We move Left but because we took U turn in fifth step we now know that we should not have taken Step 4) .To avoid this mistake for future we will replace LUL to S.
Step 7). Move Straight ( Intersection again but as we are following left hand rule, we will not turn towards right,instead we will follow straight Path) and stored value becomes SS
Step 8). Turn right ( Only right available therefore no intersection)
Step 9.) Reach Target.
So SS will correctly guide robot in next run.