Step 2: The Theory Part 2

Ok so now you have a path. In this case it is "LBLLBSR", but how does the robot change that into the correct path? Well lets take a look at what the correct path would be. Look at the photos for the correct path.

Final correct path = SRR

So we need our path to go from LBLLBSR to the right path that is SRR. To start off we look at where we went wrong. A "B" indicates the robot turned around meaning it went down the wrong path. To optimize the path we have to get rid of the "B" by using some substitution. 
<p>Got code?</p>
<p>i want to know how would i convert the long path &quot;LLLBSR.....&quot;</p><p>into the direct path in coding</p><p>and thanks for this great post</p>
<p>Now make it so you can place the robot on any point of the maze after it has found the end and it works out where in the maze it is (drives around until it finds a bit it recognizes) then drives straight to the exit once it has got its bearings.</p>
Hii sir can you send me the full code because I'm trying to making this my email id is pratikjaiswal.pj28@gmail.com<br>Thanks in advance
<p>well, the instructions were pretty useful but i am facing a problem with this.</p><p>what should i do if a maze have a single solution(exit) but multiple paths. my bot used two different paths when i used right and left in different runs.</p><p>and definitely the both the paths are of different lengths hence not traversing the shortest one.</p>
<p>if there are white lines and black background instead of black lines and white background where i have to make changes in program..</p>
<p>i wanted use arudino cc intstead of arduino RBB</p><p>will it work if i use external IR sensors </p>
<p>Hey man. I think I found a way to solve (some) looping mazes as well. If the robot has turned left/right (depending on the rule) more than 4 times in a row (which would be the case in a loop), then switch the rule. If it was left-hand rule, switch to right-hand rule and vice versa. This would enable certain looping mazes to be solved.</p>
<p>Please someone mail me the code, please i cant get it dominguezfernandez94@gmail.com please i will apreciate that</p>
<p>Could you repost the code. </p>
<p>Sir,I had tried working Hard to make this BOT and it turned out pretty well.It took more than a month and a half to make it.Finally made it.I just made minute changes in the code.The results were actually amazing.....here is the link of the vid.....Sorry about the middle finger in the video.Those were for my friends they thought that I couldn't make it.....Would soon write Instructable on it....Thank you for this....</p><p><a href="https://drive.google.com/open?id=0B-f1xWTJwulda2QwQVYwMm1scXM&authuser=0" rel="nofollow">https://drive.google.com/open?id=0B-f1xWTJwulda2Qw...</a></p>
<p>BTW Ajay, where did you find those sensor arrays?</p>
<p>pololu.com qtr-8ra I think is the model number for the analog sensors.</p>
<p>Nice job!</p>
<p>brilliant work you have done.. can this project use only 5 sensor.. help is needed..</p>
<p>urgent help... can i use arduino mega, and digital line sensor instead of analog line sensor, also can i use 12v dcmotor for for this project .. i provide link of component that i want to use and need your advice does it can be use..</p><p><a href="http://cytron.com.my/p-mdd10a" rel="nofollow">http://cytron.com.my/p-mdd10a</a></p><p><a href="http://cytron.com.my/p-lss05" rel="nofollow">http://cytron.com.my/p-lss05</a></p>
hi. I dont get the exact parts which you used. firstly, can i use a arduino uno instead of the one which you used?<br><br>can i use regular DC motors? (http://www.rhydolabz.com/index.php?main_page=product_info&amp;cPath=121&amp;products_id=815)<br><br>and can i use a motor driver (http://www.rhydolabz.com/index.php?main_page=product_info&amp;cPath=108&amp;products_id=858)<br><br>if yes, could you please guide me through the process, it would be of great help.<br>thanks
<p>dear can you send me its complete codes ?</p>
That motor driver will work, but you do not want that motor. That motor operates at 12 volts. You would have to get a 12v battery pack and regulate it down to 5v for the other parts. I would find a 5v motor.
<p>need its complete codding please .</p>
<p>I can't get the code. Can somebody reupload it please.</p>
<p>To which pin in arduino should we connect the 2nd pin right next to VCC </p>
<p>Sir,you didn't mentioned the value of the Cap on the Motor Controller Ckt.Also you have not included that in your PCB.Is is not necessary??</p>
<p>Plz give me code with atmega avr 16/32..if it's teotorial i'll highly appreciate that.</p>
<p>Hey Patrick, the link for the code has expired. Do you think we can get an updated one?</p>
<p>the code not download, please help me!!</p>
<p>Mate can u explain the this value for me ? because im not using the same sensor </p><p>(leftCenterReading&gt;200 || <br>rightCenterReading&gt;200 <br>why is 200? </p>
<p>Well done. Honestly I have to say that was the best tutorial I could find on a line solving robot but I have one question. Where can I get the code because the code no longer exist anymore. Can you help me out there. Thanks. :)</p>
<p>Nevermind I found the code I believe something must be wrong with my internet. Wish me good luck improving it. :)</p>
<p>Great Work...<br>Can i use EEPROM library to store the path?<br>U didn't used an LCD... So, were u testing the path and storing the character using serial monitor all the time?</p>
<p>A question:</p><p>how is your PWM pin?</p>
<p>A question:</p><p>I have a l298 driver and Arduino Uno V3</p><p>can you help me to change the code for my robot?</p>
<p>Hi, </p><p>Did you use the 30:1 motor or a different ratio? mMy robot is extremely fast (almost out of control)</p><p>Thanks</p>
<p>Hello,</p><p>The robot I have built does not move in a straight line i.e. it keeps getting off the black line always. </p><p>Can you provide me a solution for this?</p>
hey <br>i also wannna do a similar stuff. i want to design a robot for surveillance where the robot will be fully autonomous and it wil move for point A to point B autonomously. <br>i want u to help me in designing the autonomous motion planning system to go form one given place to the other using sensors n stuff...i m stuck pls help <br> <br>i have bought the rover system from here just for making prototype of the actual system since i got it at a good price... <br>http://danuc.com/index.php?main_page=index&amp;cPath=6 <br>http://danuc.com/index.php?main_page=index&amp;cPath=4 <br>http://danuc.com/index.php?main_page=index&amp;cPath=1 <br>http://danuc.com/index.php?main_page=index&amp;cPath=7 <br>http://danuc.com/index.php?main_page=product_info&amp;cPath=8&amp;products_id=52 <br> <br>pls reply
Hey, nice work. I'm building a maze solver myself but I have one question if I leave the start point and have a L shaped turn to the right, according to the algorithm I can't make left so leaves my 2 options go straight or turn right, my issue is how do I detect if I can go straight or not, since all the sensor are on the same line, they will be both true for right and straight even if in fact i can't go straight because it's a turn. I tought using another sensor ahead, offseted forward from the line sensors array. Waiting for an answer. Thanks :)
You have to drive forward some to see if the line continues on (i.e. you can go straight) only then does the robot make the decision. This motion is kind of disguised because the robot has to drive forward anyway in order to turn in place and end up centered on the line.
Good ideea, will try that. Thank's for the input. :)
Can u give the PCB layout of ine sensor array?
I did not make the line sensor array. You should be able to get more information about it by visiting the Pololu website.
Hi. .do you have a &quot;C&quot; program for this? I need it for my school project. We're using ATmega32u4 as our microprocessor. I would be very thankful of you. :)
can i use a arduino uno to do this project..<br>and could you plz tell more specifically how to make the motor controller?
Any Arduino should work. The motor controller is outlined on step 8. I provided the schematic in the photos. A schematic is about as clear as I can make it. You can also google for L293D or SN754410, both have the same pinout and are pretty common so there are probably other articles on them.
how to get motor controller from dorkbot..? <br>plz help me.! <br>
Great work!!!! i had a query... Do i have to make changes in your coding When i use Arduino UNO?
can i use cny 70 sensors for this project ?
So I wrote some code to test the sensors and I realized that the sensors are not sending any signal back to the microcontroller. So I removed the sensor from the design and I put on 5V from the board and the ground from the board and put the entire senor on a piece of black tape (for it to set all of the outputs to around 5V) then I put an led on each hole and realized that it isnt lighting up at all. Is it an adequate conclusion to come to that the sensor is defective? Thanks again for all the help.
I have finished building the design with the same motors and chips you have used except I used an arduino uno. but I am running into issues when I first put in the power both motors go forward about an inch and then stop. I am not sure what to do to solve this issue I have it on a straight black tape maze right now just to see if it is working but I am not sure what could be the issue, is there any way to test if the sensors are working or any way to isolate the problem, and as always thank you for your help.
You can write some code to see if the sensor readings are correct. A common issue I have seen is that people do not put their sensors close enough to the ground. How high off the ground is your line sensor? The optimal distance is 0.125&quot; (3 mm)
thank you for this posting first and foremost, I was wondering do I have to have the same gear ratio or will any two motors work (i want to maintain your code to be consistent), also will the same code work on a arduino uno...Thank you very much for your time :)

About This Instructable


172 favorites


More by patrickmccb: Maze Solving Robot Pong
Add instructable to: