Introduction: Maze Solver Robot
- this robot designed to solve a simple maze without any AI using this following techniques in the code :
1) PID
2) rotation equations
3) calibration
gitHub code link :
https://github.com/marwaMosafa/Maze-solver-algorithm-
Step 1: Get Your Component Ready
i used all the component listed above :
1- 2 geared dc motor
2- 2 wheels
3- 1 custer wheel
4- LCD
5- bread board and some wires ( male -male ) && (male - female )
6- 3 ultra sonic sensor
4- ultra sonic holder
5- Arduino UNO board
6- 2 battery 3.7 V with battery holder
7- L298N motor drive
8- wooden chasis for the robot body
9- switch
Step 2: First Layer
1- connect the motor ,wheels and the drive to the chasis
2- connect motors to motor drive using wires
3- pins of the drive to pins 3,12,13,5,2,7 in order to arduino
note that :
if the wheel of the right motor for example move in the opposite direction you gave just swap the wires of the motor that connected to the drive
Step 3: Second Layer
- put the arduino , sensors and breadboard layer on the second chasis and lets put some wires
please read the code file to know my connection but let's summarize :
1) VCC and GND of each sonar sensor to breadboard , Trigger and Echo will attached to pins A0,A1,A2,A3,A4,A5 for the 3 sensors
2) 5V and GND from arduino to supply the breadBoard
3) 5v out from drive to arduino input
4) GND from arduino to GND the drive
Step 4: Power It Up
place your battery holder with your batteries in and take the red wire connect it to the input pin to the drive and the black wire to the GND of the drive with the wire of the arduino
Step 5: Optional Step
this step for making some joy with your robot
1) place your lcd and make the connections to arduino like the code attached
2) connect the red wire of the battery holder to the ON pin of the switch and take a wire from the other pin to the input of the drive to control the power on of the robot with the switch
3) finally it's done and feel free to try it and let me know if you face any problems
16 Comments
3 years ago
where is the code please ???
3 years ago
where is the code i cant find him
Question 3 years ago
Could you please explain your code? As I am a bit confused.
Answer 3 years ago
which part made you confused ?
Reply 3 years ago
I want to know when it is taking right, Left or going straight and how is it using the PID?
Question 3 years ago
what would happen on a dead end of maze?
As there is no function for that.
Question 4 years ago
could you please clarify which is your first sensor front one or left one???
Answer 4 years ago
i used three sensors front,left and right and the front one is the base sensor in each condition with one of the two others
Question 4 years ago
Why are you using PID_v1.h instead of NewPing.h? What advantage does PID_v1 have over that? I am asking, because I have only used NewPing :)
Answer 4 years ago
i write the function of newPing myself i called it sonarSensor you can see it in the code and do the same job of the predefined library
PID_v1.h i used it for getting feedback to the dc motor to control the forward function as it's oscillate in the maze so it make it stable in the forward move with adjusting the pid parameters kp.ki and kd
Question 4 years ago
Oh, that's interesting. Who makes a decision about the left or right rule? You or the robot?
Answer 4 years ago
the robot
4 years ago
That's a really fun little robot :)
Reply 4 years ago
thanks and i'll be happy if you try it :)
Question 4 years ago
Does the robot use the right-hand rule?
Answer 4 years ago
it relies on it's idea but it can follow the right and the left rule to the middle of the maze then i apply the left rule on the red maze and the right in the blue after it reaches the middle