An Arduino micro controller based robot which first analyzes the maze in the dry run by following lines through IR sensors and then calculates the shortest path from the source to the destination.
The new array of now 6 sensors is mounted out of which only 5 sensors are used for better precision. If one sensor is centered with relation to the black line, only that specific sensor will produce a HIGH. The possible 5 original sensor array output when following a line are: [1 1 1 1 1, 0 0 0 0 0, 0 0 0 0 1, 0 0 0 1 1, 0 0 0 1 0, 0 0 1 1 0, 0 0 1 0 0 , 0 1 1 0 0 , 0 1 0 0 0, 1 1 0 0 0, 1 0 0 0 0]
The maze solver bot code is split in two parts:
- (First Part): The robot finds its way out from a "non-known perfect maze". Does not matter where you put it inside the maze, it will find a "solution".
- (Second Part): Once the robot found a possible maze solution, it should optimize its solution finding the "shortest path from start to finish".
To find the solution of the maze, the bot uses "Right Hand Rule". If in the maze all its walls are connected together maze's outer boundary, then by keeping one hand in contact with one wall of the maze, the solver will not to get lost and will reach the exit. Steps in Right Hand Rule are:
- At "Cross": Go to Right
- At "T": Go to Right
- At "Right Only": Go to Right
- At "Left Only": Go to Left
- At "Straight or Left": Go Straight
- At "Straight or Right": Go Right
- At "Dead End": Go back ("U turn")
- At the "End of Maze": Stop