Maze Solver Robot

4,379

19

16

Introduction: Maze Solver Robot

About: software engineering

- 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

Attachments

Be the First to Share

    Recommendations

    • The 1000th Contest

      The 1000th Contest
    • Battery Powered Contest

      Battery Powered Contest
    • Hand Tools Only Challenge

      Hand Tools Only Challenge

    16 Discussions

    0
    SayahiN
    SayahiN

    11 months ago

    where is the code please ???

    0
    hamzakj
    hamzakj

    1 year ago

    where is the code i cant find him

    1
    shubhamg140
    shubhamg140

    Question 1 year ago

    Could you please explain your code? As I am a bit confused.

    0
    marwa_rabie
    marwa_rabie

    Answer 1 year ago

    which part made you confused ?

    0
    shubhamg140
    shubhamg140

    Reply 1 year ago

    I want to know when it is taking right, Left or going straight and how is it using the PID?

    0
    shubhamg140
    shubhamg140

    Question 1 year ago

    what would happen on a dead end of maze?
    As there is no function for that.

    0
    yenikapatitatwik
    yenikapatitatwik

    Question 2 years ago

    could you please clarify which is your first sensor front one or left one???

    0
    marwa_rabie
    marwa_rabie

    Answer 2 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

    0
    pellejones
    pellejones

    Question 2 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 :)

    0
    marwa_rabie
    marwa_rabie

    Answer 2 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

    0
    Glumgad
    Glumgad

    Question 2 years ago

    Oh, that's interesting. Who makes a decision about the left or right rule? You or the robot?

    0
    marwa_rabie
    marwa_rabie

    Answer 2 years ago

    the robot

    0
    Penolopy Bulnick
    Penolopy Bulnick

    2 years ago

    That's a really fun little robot :)

    0
    marwa_rabie
    marwa_rabie

    Reply 2 years ago

    thanks and i'll be happy if you try it :)

    0
    Glumgad
    Glumgad

    Question 2 years ago

    Does the robot use the right-hand rule?

    0
    marwa_rabie
    marwa_rabie

    Answer 2 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