PARKING SENSOR 

OVERVIEW

In this project, we will create a simple Arduino Car Reverse Parking Sensor Circuit using Arduino UNO, HC-SR04 Ultrasonic Sensor and buzzerParking a car in congested parking lots and tiny spaces is a tedious job and the important thing is that you must be very careful while reversing so that you do not damage the car (your car or the adjacent one). Almost all modern cars are equipped with reverse parking sensors that are activated when the car is put in reverse gear and beep at a variable rate depending on the gap between the car and the closest barrier.

 

DETAILS

As mentioned earlier, the Ultrasonic Sensor is the main unit (component) that is responsible for measuring the distance. Arduino UNO acts as the main controlling unit that will control the Ultrasonic Sensor, calculate the distance and activate the buzzer.
The principle of the circuit is as follows: The Ultrasonic Sensor sends acoustic pulses and the Arduino measures the interval of each reflected signal. Based on this time interval, Arduino then calculates the distance of the object.
Arduino then activates the Buzzer if the distance between the sensor and object is less than a certain range.
The Arduino Car Reversing Parking Sensor Circuit can be used:

  • Autonomous Vehicles
  • Obstacle Avoiding Robots
  • Distance Measurement
  • Proximity Detection
  • Human Detection
  • Drones, UAVs and Helicopters

When the circuit is powered ON, the Arduino will start measuring the distance of the objects in front of the Ultrasonic Sensor. If the calculated distance is less than 100cm, then Arduino activates the buzzer. If you are interested, you can modify the code to beep the buzzer so that the intensity of the beeps increases with a decrease in the distance (like in a real car).

 

COMPONENTS 

 

FRITZING DIAGRAM

 

CODE

const int trigPin = 11;
const int echoPin = 10;
const int buzzPin = 6;

long duration;
float distance;

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

void loop() 
{
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  duration = pulseIn(echoPin, HIGH);
  distance = 0.034*(duration/2);
  Serial.println(distance);
  Serial.println(duration);

  if (distance < 50)
  {
    digitalWrite(buzzPin,HIGH);
  }
  else 
  {
    digitalWrite(buzzPin,LOW);
  }
  delay(300);
}

FINAL SETUP


CONCLUSION

We hope you enjoyed the tutorial and this little lesson will purport you into great levels. Enjoy yourself in electronics. For more tutorials and questions, please leave your comments in the comment area. See other components on the site www.inventelectronics.com. Inspiring ingenuity.

1.5 2 votes
Article Rating
0
Would love your thoughts, please comment.x
()
x