Ad Code

Responsive Advertisement

Ticker

6/recent/ticker-posts

Ultrasonic Parking Assistant System Easy DIY Project

 Ultrasonic Parking Assistant System Easy DIY Project 

Let's create a Parking Assistant project using an ultrasonic sensor, Arduino, and a buzzer . Below is the idea, code, and circuit diagram for the project.

Project Description: Parking Assistant

This project will help drivers park their cars by providing audio feedback through a buzzer, which beeps at different rates depending on how close the car is to an obstacle. The system will use an ultrasonic sensor to measure the distance to an obstacle and will make the buzzer beep faster as the obstacle gets closer.

Components Required:

  • Arduino Uno
  • Ultrasonic sensor (HC-SR04)
  • Buzzer
  • Jumper wires
  • Breadboard
  • Power supply

Circuit Diagram:

Connections:

  • Ultrasonic Sensor:
    • VCC to Arduino 5V
    • GND to Arduino GND
    • TRIG to Arduino Pin 9
    • ECHO to Arduino Pin 8
  • Buzzer:
    • Positive lead to Arduino Pin 7
    • Negative lead to GND

Video Link: - Click Here For Video

Ultrasonic Parking Assistant System simple Circuit: -




Ultrasonic Parking Assistant System Arduino Programming: -

Arduino IDE Program

#define trigPin 9
#define echoPin 8
#define buzzerPin 7
#define LEDpin 6

void setup() {
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(buzzerPin, OUTPUT);
  pinMode(LEDpin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  long duration, distance;
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
 
  duration = pulseIn(echoPin, HIGH);
  distance = (duration / 2) / 29.1; // Convert to centimeters

  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");

  if (distance > 40) {
    noTone(buzzerPin);
  } else if (distance <= 40 && distance > 30) {
    tone(buzzerPin, 1000); // 1 kHz frequency
    digitalWrite(LEDpin, HIGH);
    delay(200);            // 1 sec delay
    noTone(buzzerPin);
    digitalWrite(LEDpin, LOW);
    delay(1000);

  } else if (distance <= 30 && distance > 20) {
    tone(buzzerPin, 1000);
    digitalWrite(LEDpin, HIGH);
    delay(200);             // 0.5 sec delay
    noTone(buzzerPin);
    digitalWrite(LEDpin, LOW);
    delay(500);
  } else if (distance <= 20 && distance > 10) {
    tone(buzzerPin, 1000);
    digitalWrite(LEDpin, HIGH);
    delay(200);             // 0.2 sec delay
    noTone(buzzerPin);
    digitalWrite(LEDpin, LOW);
    delay(200);
  } else if (distance <= 10) {
    tone(buzzerPin, 1000); // Continuous beep
    digitalWrite(LEDpin, HIGH);
  }
}


-----------------------------------------------------------------------------------------------------------------------------

Explanation:

  • The ultrasonic sensor continuously measures the distance to an obstacle.
  • Based on the distance, the buzzer will beep at different rates:
    • Above 40 cm: No beep.
    • 40 to 30 cm: Beep with a 1-second delay.
    • 30 to 20 cm: Beep with a 0.5-second delay.
    • 20 to 10 cm: Beep with a 0.2-second delay.
    • Below 10 cm: Continuous beep.

This simple parking assistant helps the driver know how close the car is to an obstacle, with the beeping rate increasing as the distance decreases.

You can now build the circuit on a breadboard, upload the code to your Arduino, and test it out. Let me know if you have any questions or need further assistance!

Share, Support, and Subscribe!!! 1. PRO KAM EXPLAINED 2. Knowledge KAM 3. PRO KAM Follow us on 1. Facebook 2. Instagram 3. Pinterest 4. Blogspot 5 Twitter If you have any other ideas to make me design, you can describe them in the comment section and if I can, I will make a designing video on it. So I am waiting #prokam #pro #IDM #Solutions #Hack

Post a Comment

0 Comments

Ad Code

Responsive Advertisement