Let's Make Robots!

Sr.M Maze solving robot

solves line mazes

This is my maze solving robot. It uses a Arduino RBBB from wulfden.org. It has 2 30:1 micro gear motors. 

The robot has 5 reflectance sensors for sensing the line. Its 3 in front are for following and staying on the line. It does this by slowing down a certain motor depending on which way the robot has come off the line. The 2 sensors near the back of the robot on the left and right sides are for sensing the turns in the maze. The maze has many different intersections and it knows what to do at all of them.

 This is done using the left hand on the wall technique. This means that if it can turn left then it turns left, else if it can go straight it goes straight, else if it can turn right then it turns right and finally if it cant do any of those then it is at a dead end  and turns around. Here is a great pdf. that explains that  http://www.pololu.com/file/0J195/line-maze-algorithm.pdf


Thing left to do:

I have seen the 3pi robot a lot in videos and this is why i decided to build it. The 3pi goes back and refines the path and goes down the quickest and shortest path without the unneeded turns and dead ends. I got to thinking "i can do that!" so a few months later and only 2 days of building im at where i am. I have seen some people not do this awesome step with their maze robots but i want to. I have it using the left hand on the wall, well so what. I am working on the refining code, the cool part. It doesnt work YET but it will... it will. Give me a few more days and hopefully i will get it to work, if not give me more time.


Photo time:





Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I'm making a maze solver too, but it's round like the 3pi, but with 15cm diameter( so 5pi :D ), i was hoping to solve the maze with only 3 ''line sensors'' i'm sure it's possible, if not, i have a few more in the drawer, also using the pololu algorithm, of course it will need slight changes since i only have 3 sensors, no biggie(i think)


Any chance you could send me the code? i don't intend to steal it in any way, just to see what functions you used, etc, to see if it's the least bit like i think mine will be...


thanks (:



I was not able to get pololu's code to work on my robot. I tried but  a lot of it may not pertain to your certain robot, i found that out, and so its hard to change their code around. Plus they use some library that i did not want to deal with. I do not think, at least it wont be the least bit easy to do, you can solve a maze with only 3 sensors. I tried a few months before i did this robot. You need 3 sensors in the front alone for line following. Because you cant solve the maze if your not on the line. Then you need 2 more, one on the extreme left and one on the extreme right to detect turns and intersections. I put these sensors a bit farther back than front ones to make it easier to program. I will send the code, mind that it is not pretty and repeats itself. I had to do a lot to get my ugly coding to work. You will see in some spots of the code it says in a comment, "error checking". That is because in some situations the robot was not doing what is was suppose to, so i had to add code to get rid of that error instead of fix all the code. Oh and dont even get me started with the shortest path....ugh. 

hi sir!!

I would like to do a line maze solver using arduino uno and i found ur tutorial very helpful!!

please provide me ur code and help me out :)



Hey could i take a look at you code? Im having problems with the qre1113 digital sensor from sparkfun, http://www.sparkfun.com/commerce/product_info.php?products_id=9454. Im not sure how it works, especially with the coding part. Im using a pic btw. Anw, great job, im also attempting something like this as well. 

Sorry I do not have the code for this robot any longer. I made a new mae robot that might interest you http://letsmakerobots.com/node/25735 I chose to go analog on this second one. Was easier for me.