USES-:


1. Your Car Will be 99.9% Crash Proof. 

2. Low Cost Easy Handle and will make your Car Modern Types.

3. You can Use Both On front Side and Back Side As per your Wish.


How to make a distance measuring device?



Requirements-:

1. Arduino Uno
                                     

2. 16x2 Lcd 


3. Jumper Wires


4. HC-SR04 Ulrasonic Sensor


5. Potentiometer


6. 9-volt Battery with Battery Cap and Arduino Input 


How Does HC-SR04 Works?


Distance=Time*speed

speed of sound=340 m/s  (*The Echo pin will output the time in microseconds the sound wave traveled.)

=3.4 cm/s
=0.034 cm/microsecond.

Time Will Be calculated by pulse In function through Arduino

Final Formula- 

Distance= Time*0.034/2 (divided by 2 because It will Calculate the Total time taken and We need Just One flow)


PROCEDURE-:


1. Lets Start With Connection Of LCD with Arduino

2. Now The Notes in the Pic Are Very Imp. Please read it twice and be Carefull.

3. Now The Connection Of HC-SR04 


4. Upload the Code- through PC and Have your First Trial


#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)

const int trigPin=8;

const int echoPin=9;



long duration;

int distance;



void setup()

{

lcd.begin(16,2);

pinMode(trigPin,OUTPUT);

pinMode(echoPin,INPUT);

Serial.begin(9600);

lcd.print("Hello World");





}



void loop()

{

digitalWrite(trigPin,LOW);

delayMicroseconds(2);

digitalWrite(trigPin,HIGH);

delayMicroseconds(10);



duration=pulseIn(echoPin,HIGH);

distance=duration*0.034/2;

Serial.println("Distance: ");

Serial.println(distance);

lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will be displayed

lcd.print("Distance: "); // Prints string "Distance" on the LCD

lcd.print(distance); // Prints the distance value from the sensor

lcd.print(" cm");

delay(10);

lcd.setCursor(0,1);

lcd.print("Congrats");

delay(10);

}


5. Now You can Make a Case and Provide Power Input through 9-volt your wish.

6. Use it Practically And Enjoy