This is one of the best steps by step simple tutorial of Technical PK about ai with Arduino, teaching to use ultrasonic sensor hc-sr04 and Arduino Uno, measuring distance using Arduino serial monitor. What happens is that the sensor sends ultrasonic sound waves which reflect back and the time after which the sound reflects back is noted and accordingly the distance from object and sensor is calculated using a formula. This technology is widely used in radar and sonar, even natural species like bats use the same method We also have tried to make one radar of our own and have uploaded the video on YouTube (link given below), We wish that it is your next project.
Moreover, we are planning to do some more videos soon, but we also want you all to put your ideas and suggestion in the comment box. So that we don’t run out of ideas and get ourself the best opportunity to serve you. It will be great if you share our videos at your best and smash the like and subscribe button on your screen.
We will also like to hear your learning experience in the comment section.
Your learning outcomes from this video: -
1) Vast information of this technology and its uses.
2) Now you know to use HC-SR04 sensor with Arduino
3) You know to connect the sensor properly with the Arduino board.
4) You have the code provided by us on your fingertips.
copy this Code in the ide for the project
//code by Technical PK
// for educational purpose only
const int trigPin = 12;
const int echoPin = 13;
long duration;
int distance;
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(10);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance= duration*0.034/2;
Serial.print("Distance in centimetre: ");
Serial.println(distance);
}
Material you need for the project-
1) HC-SR04 ultrasonic sensor
2) Arduino uno board
3) 4 jumper wires
4) A cable to connect Arduino to your computer.
5) A computer
What to do next after this Video: -
You can learn to make a radar sonar using Arduino uno, HC-sro4 sensor, sg-90 servo a computer (hardware) and Arduino ide, Processing 3 app (software) with the link
• How to do it yourself ! military Radar Son...
learn to use relay using 5v relay module, Arduino Uno. This demonstration was done using a led the link- • How to use, control and drive 5v relay mod...
learn to use a Sg90 servo motor using Arduino and motor-shield module- • AI with Arduino: servo motor control using...
learn to use a Sg90 servo motor only using Arduino- • | AI with Arduino| Toturial: Servo control...
learn to write something of your own on a lcd screen-
• Learn how to compile LCD with Arduino in o...
Play jingle bell and happy birthday tune on buzzer using Arduino- • How to make Arduino Play happy birthday an...