Arduino Self Parking Car Beta

3,998

26

6

Posted in TechnologyArduino

Introduction: Arduino Self Parking Car Beta

About: BIG THINKS, BIG THINGS! FOLLOW US ON YOUTUBE: https://www.youtube.com/channel/UCODcdPwhBerlNMSHB_ATEow

Hi guys! Today, we are going to make a Self Parking Car with Arduino. Let's start!

Step 1: What We Need?

We will use;

1 - l298n Motor Driver

2 - 1 x Hc-sr04

3 - Arduino

4 - Car Chassis (two motored)

Step 2: Connections;

Arduino to l298n;

D5 = in5

D6 = in6

D9 = in3

D10 = in4

Other Energy Source = l298n s 12v

WARNING; IF YOU WANT L298N WORK, YOU MUST CONNECT GND PINS EAC OTHER WİTH ARDUINO.

Arduino to Hc-sr04;

5v = Vcc

Echo = 12

Trig = 13

GND = GND

Step 3: Connect L298n to Car

We use out3 and out4 for forward and backward

We use out1 and out2 for right and left.

Step 4: How It Will Work?

When car is looking for a parking space, actually it is looking for a parking space bigger than 7cm. If it see smaller than 7cm space, it will continue to looking for bigger than 7cm parking space. Then, when it find a convenient park space, it will go right-forward 5cm and stop,than go backward and steering to left. It will be a perfect car.

Don't forget it is a Beta Version and it can park only left side park spaces. If you have an idea , I will be happy to hear this. Code variables can changeable from car to car. You should organize the numbers. Thanks..:)

Step 5: Code

https://drive.google.com/open?id=0B6EUM2JQFzOhT2VXckxrempqOFU

You can get the Arduino code there.. I'm waiting for your comments..:)

Share

    Recommendations

    • Casting Contest

      Casting Contest
    • Woodworking Contest

      Woodworking Contest
    • Make it Move Contest

      Make it Move Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    6 Comments

    the .uno file cant open bro. the error message is could not create the sketch. can u help me to solve this. thx before

    1 reply

    #define trigPin 13

    #define echoPin 12

    void setup() {

    pinMode(trigPin, OUTPUT);

    pinMode(echoPin, INPUT);

    pinMode(5, OUTPUT);

    pinMode(6, OUTPUT);

    pinMode(9, OUTPUT);

    pinMode(10, OUTPUT);

    }

    void loop() {

    long duration, distance;

    digitalWrite(trigPin, LOW); // Added this line

    delayMicroseconds(2); // Added this line

    digitalWrite(trigPin, HIGH);

    // delayMicroseconds(1000); - Removed this line

    delayMicroseconds(10); // Added this line

    digitalWrite(trigPin, LOW);

    duration = pulseIn(echoPin, HIGH);

    distance = (duration/2) / 29.1;

    if (distance < 7) { // This is where the LED On/Off happens

    digitalWrite(6,HIGH);

    digitalWrite(5,LOW);

    }

    else {

    digitalWrite(9,LOW);

    digitalWrite(10,HIGH);

    analogWrite(6, 110);

    analogWrite(5, LOW);

    delay(50);

    digitalWrite(10,LOW);

    digitalWrite(9,HIGH);

    analogWrite(5, 110);

    analogWrite(6, LOW);

    delay(100);

    digitalWrite(9,LOW);

    digitalWrite(10,HIGH);

    analogWrite(5, 110);

    analogWrite(6, LOW);

    delay(100);

    digitalWrite(10,LOW);

    digitalWrite(9,LOW);

    analogWrite(5, LOW);

    analogWrite(6, LOW);

    delay(10000);

    }

    }

    looks nice, i would like to see a video of how well it works

    please post a video

    A video of it parking, please!

    Great effort. Please post a video.