Distance Measuring Device without LCD screen, jumper wire, breadBoard
DISTANCE MEASURING DEVICE
(Arduino based)
Hello! I am Shlok Jain. I have made here a distance measuring device with only ultrasonic sensor and arduino uno board. It's a very easy task to make this.
I have not used jumper wire or breadboard or LCD screen here.
If you have not viewed my youtube video then go and view it. Here it is.
Also don't forget to like, share, and subscribe my channel.
MATERIALS REQUIRED
- Arduino UNO board
STEPS TO MAKE IT
STEP 1: Connect ultrasonic sensor with arduino uno board.
as shown in figure. Leave first three pins and apply sensor directly to board.
STEP 2: Connect arduino board with computer with cable that comes with arduino uno
Download Arduino IDE and paste given code in that application.
Now upload the given code by clicking the arrow symbol at upper left of computer screen.
int trig=12;
int echo=13;
void setup()
{
pinMode(trig,OUTPUT);
pinMode(echo,INPUT);
pinMode(11,OUTPUT);
digitalWrite(11,HIGH);
Serial.begin(9600);
}
void loop()
{
long samay,dist;
digitalWrite(trig,LOW);
delay(2);
digitalWrite(trig,HIGH);
delay(10);
digitalWrite(trig,LOW);
samay=pulseIn(echo,HIGH);
dist= samay*0.034/2;
Serial.println("distance:");
Serial.print(dist);
Serial.println("cm");
delay(3000);
}
STEP 3: Now click on Tools on
Now open Serial Monitor.
Now a new window will open
First time it will show wrong reading then correct reading.
So we are done !!!!!
Thank you for watching
MY OTHER PROJECTS
Thief detecting robot - https://arduinoprojectswithshlok.blogspot.com/p/detecting-device-arduino-hello-i-am.html
Comments
Post a Comment