SlideShare a Scribd company logo
1 of 11
Ultrasonic
sensor
The purpose
of the lesson
To form the concept of an ultrasound sensor,
skills and abilities to work with a robotic
constructor and EV3 software
An ultrasonic sensor (also often called a sonar or
ultrasonic rangefinder) determines the distance to an
object in the same way as bats or dolphins do.
The HC-SR04 sensor generates a highly directional
signal at a frequency of 40 kHz and catches the reflected
signal (echo). Based on the time it takes sound to travel
to an object and back, you can quite accurately
determine the distance to it.
Ultrasonic sensor
Arduino HC-SR04
It is based on the well-known phenomenon of echolocation. The HC-SR04 ultrasonic sensor emits
sound pulses (ping) at a frequency of 40 kHz and catches the reflected signal (echo). The range is
determined by the time of transmission of the pulse and its return. That is,
in all of these devices they emit a narrowly directed ultrasonic signal and receive a reflected signal
back.
Operating principle of ultrasonic sensor
How the HC-SR04 Ultrasonic Distance Sensor Works?
It emits an ultrasound at 40 000 Hz which travels through the air and if there is an
object or obstacle on its path It will bounce back to the module. Considering the
travel time and the speed of the sound you can calculate the distance.
For this lesson you will need:
⮚ ARDUINO UNO
⮚ BREAD BOARD;
⮚ ULTRASONIC HC-SR04;
How to connect an ultrasonic
sensor to Arduino
● Supply voltage 5V;
● Current strength in passive state -6 s.
The ultrasonic rangefinder
HC SR04 has the following technical parameters:
The sensor is equipped with four
terminals :
• Positive type power contact – +5V;
• Trid (T) – input signal output;
• Echo (R) – output signal output;
• GND – “Ground” pin.
1. Get to know the sensor
2. Find out how it works
3. Connecting the sensor to
Arduino
Exercise
int trigPin = 8; // assign a name to Pin8
int echoPin = 9; // assign a name to Pin9
void setup() {
Serial.begin(9600); // connect the port monitor
pinMode(trigPin, OUTPUT); // assign trigPin (Pin8) as output
pinMode(echoPin, INPUT); // assign echoPin (Pin9) as input
}
void loop() {
int duration, cm; // assign the variable "cm" and "duration" to the sensor readings
digitalWrite(trigPin, LOW); // initially the sensor does not send a signal
delayMicroseconds(2); // set the delay to 2 mm microseconds
digitalWrite(trigPin, HIGH); // send a signal
delayMicroseconds(10); // set the delay to 10 microseconds
digitalWrite(trigPin, LOW); // turn off the signal
duration = pulseIn(echoPin, HIGH); // enable signal reception
cm = duration / 58; // calculate the distance in centimeters
Serial.print(cm); // display distance in centimeters
Serial.println("cm");
delay(1000); // set a pause of 1 second
}
Thank you
for your
attention!

More Related Content

Similar to ultrasonic sensor.pptx

Similar to ultrasonic sensor.pptx (20)

ultrasonic sensor.pptx
ultrasonic sensor.pptxultrasonic sensor.pptx
ultrasonic sensor.pptx
 
Hc sr04 users-manual
Hc sr04 users-manualHc sr04 users-manual
Hc sr04 users-manual
 
Ultrasonicsensor 170828140914
Ultrasonicsensor 170828140914Ultrasonicsensor 170828140914
Ultrasonicsensor 170828140914
 
Ultrasonic sensor
Ultrasonic sensorUltrasonic sensor
Ultrasonic sensor
 
Sensor Based Blind Stick
Sensor Based Blind StickSensor Based Blind Stick
Sensor Based Blind Stick
 
SENSORS AND BLUETOOTH COMMUNICATION
SENSORS AND BLUETOOTH COMMUNICATIONSENSORS AND BLUETOOTH COMMUNICATION
SENSORS AND BLUETOOTH COMMUNICATION
 
Obstacle detection using ultra sonic sensor
Obstacle detection using ultra sonic sensorObstacle detection using ultra sonic sensor
Obstacle detection using ultra sonic sensor
 
Arduino radar system
Arduino radar systemArduino radar system
Arduino radar system
 
batch 7.pptx
batch 7.pptxbatch 7.pptx
batch 7.pptx
 
Distance measuring unit with zigbee protocol, Ultra sonic sensor
Distance measuring unit with zigbee protocol, Ultra sonic sensorDistance measuring unit with zigbee protocol, Ultra sonic sensor
Distance measuring unit with zigbee protocol, Ultra sonic sensor
 
Ultrasonic_Based_Security_System
Ultrasonic_Based_Security_SystemUltrasonic_Based_Security_System
Ultrasonic_Based_Security_System
 
Arduino projects & tutorials
Arduino projects & tutorialsArduino projects & tutorials
Arduino projects & tutorials
 
Radar Detector
Radar Detector Radar Detector
Radar Detector
 
Radar
RadarRadar
Radar
 
Ultrasonic sensors
Ultrasonic sensorsUltrasonic sensors
Ultrasonic sensors
 
Radar using ultrasonic sensor and arduino.pptx
Radar using ultrasonic sensor and arduino.pptxRadar using ultrasonic sensor and arduino.pptx
Radar using ultrasonic sensor and arduino.pptx
 
SENSOR DATA COMMUNICATION TO THNIGSPEAK IOT PLATFORM USING RASPBERRY P
SENSOR DATA COMMUNICATION TO THNIGSPEAK  IOT PLATFORM USING RASPBERRY PSENSOR DATA COMMUNICATION TO THNIGSPEAK  IOT PLATFORM USING RASPBERRY P
SENSOR DATA COMMUNICATION TO THNIGSPEAK IOT PLATFORM USING RASPBERRY P
 
Hc sr04
Hc sr04Hc sr04
Hc sr04
 
Hcsr04
Hcsr04Hcsr04
Hcsr04
 
Hcsr04
Hcsr04Hcsr04
Hcsr04
 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 

Recently uploaded (20)

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 

ultrasonic sensor.pptx

  • 2. The purpose of the lesson To form the concept of an ultrasound sensor, skills and abilities to work with a robotic constructor and EV3 software
  • 3. An ultrasonic sensor (also often called a sonar or ultrasonic rangefinder) determines the distance to an object in the same way as bats or dolphins do. The HC-SR04 sensor generates a highly directional signal at a frequency of 40 kHz and catches the reflected signal (echo). Based on the time it takes sound to travel to an object and back, you can quite accurately determine the distance to it. Ultrasonic sensor Arduino HC-SR04
  • 4. It is based on the well-known phenomenon of echolocation. The HC-SR04 ultrasonic sensor emits sound pulses (ping) at a frequency of 40 kHz and catches the reflected signal (echo). The range is determined by the time of transmission of the pulse and its return. That is, in all of these devices they emit a narrowly directed ultrasonic signal and receive a reflected signal back. Operating principle of ultrasonic sensor
  • 5. How the HC-SR04 Ultrasonic Distance Sensor Works? It emits an ultrasound at 40 000 Hz which travels through the air and if there is an object or obstacle on its path It will bounce back to the module. Considering the travel time and the speed of the sound you can calculate the distance.
  • 6. For this lesson you will need: ⮚ ARDUINO UNO ⮚ BREAD BOARD; ⮚ ULTRASONIC HC-SR04; How to connect an ultrasonic sensor to Arduino
  • 7.
  • 8. ● Supply voltage 5V; ● Current strength in passive state -6 s. The ultrasonic rangefinder HC SR04 has the following technical parameters: The sensor is equipped with four terminals : • Positive type power contact – +5V; • Trid (T) – input signal output; • Echo (R) – output signal output; • GND – “Ground” pin.
  • 9. 1. Get to know the sensor 2. Find out how it works 3. Connecting the sensor to Arduino Exercise
  • 10. int trigPin = 8; // assign a name to Pin8 int echoPin = 9; // assign a name to Pin9 void setup() { Serial.begin(9600); // connect the port monitor pinMode(trigPin, OUTPUT); // assign trigPin (Pin8) as output pinMode(echoPin, INPUT); // assign echoPin (Pin9) as input } void loop() { int duration, cm; // assign the variable "cm" and "duration" to the sensor readings digitalWrite(trigPin, LOW); // initially the sensor does not send a signal delayMicroseconds(2); // set the delay to 2 mm microseconds digitalWrite(trigPin, HIGH); // send a signal delayMicroseconds(10); // set the delay to 10 microseconds digitalWrite(trigPin, LOW); // turn off the signal duration = pulseIn(echoPin, HIGH); // enable signal reception cm = duration / 58; // calculate the distance in centimeters Serial.print(cm); // display distance in centimeters Serial.println("cm"); delay(1000); // set a pause of 1 second }