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

male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MysoreMuleSoftMeetup
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 

Recently uploaded (20)

male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 

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 }