SlideShare a Scribd company logo
1 of 14
Course: ECE322
Presentation
by
Dr. Kesavan Gopal
1
Experiment:
Ultra Sonic Sensor interfacing with Arduino Uno
Outline
• Ultrasonic Principle
• Ultrasonic Module – HC- SR04, features,
Function
• Distance Calculation
• Connection Diagram
• Arduino Sketch
• Observation & Results
2
Ultrasonic Sensor Principle
• Generate an inaudible sound wave (40 KHz,
human’s cannot hear it, human auditory system is
capable of up to 20 KHz )
• Transmit the sound in open
• Wait for a reflection from near by objects
• Measure the time taken to make te onward
journey and return journey of the sound wave.
• Calculate the distance
3
Ultrasonic Sensor HC-SR-04 Module
• HC SR-04 Module
4
Pin1 (Vcc): This pin provides a +5V
power supply to the sensor.
Pin2 (Trigger): This is an input pin,
used to initialize measurement by
transmitting ultrasonic waves by
keeping this pin high for 10us.
Pin3 (Echo): This is an output pin,
which goes high for a specific time
period and it will be equivalent to the
duration of the time for the wave to
return back to the sensor.
Pin4 (Ground): This is a GND pin used
to connect to the GND of the system.
Salient Features of SR04
• Power supply: 5V
• Operating current: 15m
• Quiescent Current < 2mA
• Dimension: 45mm
x20mmx15mm
• Pulse width Trigger: 10uS
5
• Resolution: 3 mm
• Measuring angle: 30
deg
• Effectual Angle: < 15
Deg
• Operating frequency
40 KHZ
Ultrasonic Sensor - Function
6
Cont…
7
Distance Calculation
• Speed of Sound (S) = 340 m/s= 0.034 cm /us
• Time = Distance / Speed
• Distance = Time X Speed
• Distance = (Time X (0.034 cm/us) )
• (Travelled by the sound wave)
• Distance to Object = (Time X (0.034 cm/us) ) / 2
• Note: divided by 2 is for round trip distance
8
Connection Diagram
9
Arduino Sketch
// defines pins numbers
const int trigPin = 13;
const int echoPin = 12;
// defines variables
long duration;
int distance;
void setup()
{
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
}
10
Cont…
void loop()
{
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
delay(2000);
}
11
Observation and Results
12
Queries?
• Queries related to this after class hours may be
directed to e-mail Kesavan.24346@lpu.co.in or
through LPU live.
13
Thank You
14

More Related Content

Similar to Ultrsonic sensor_Arduino_DRKG.pptx

SENSORS AND BLUETOOTH COMMUNICATION
SENSORS AND BLUETOOTH COMMUNICATIONSENSORS AND BLUETOOTH COMMUNICATION
SENSORS AND BLUETOOTH COMMUNICATIONsoma saikiran
 
Ultrasonic sensors
Ultrasonic sensorsUltrasonic sensors
Ultrasonic sensorsAnCh24
 
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 sensorAshok Raj
 
Sensor Based Blind Stick
Sensor Based Blind StickSensor Based Blind Stick
Sensor Based Blind StickGagandeep Singh
 
Arduino-with-Ultrasonic-sensor.pdf
Arduino-with-Ultrasonic-sensor.pdfArduino-with-Ultrasonic-sensor.pdf
Arduino-with-Ultrasonic-sensor.pdfAshleyEvonneSerna
 
Ultrasonic Range Finder
Ultrasonic Range FinderUltrasonic Range Finder
Ultrasonic Range FinderHicham Berkouk
 
Ultrasonicsensor 170828140914
Ultrasonicsensor 170828140914Ultrasonicsensor 170828140914
Ultrasonicsensor 170828140914amitshaha3
 
Ultrasonic sensor
Ultrasonic sensorUltrasonic sensor
Ultrasonic sensorAdarsh Raj
 
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripheralsThe IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripheralsThe IOT Academy
 
Obstacle detection using ultra sonic sensor
Obstacle detection using ultra sonic sensorObstacle detection using ultra sonic sensor
Obstacle detection using ultra sonic sensorsatyashanker
 
Hc sr04 users-manual
Hc sr04 users-manualHc sr04 users-manual
Hc sr04 users-manualnguyen nam
 

Similar to Ultrsonic sensor_Arduino_DRKG.pptx (20)

SENSORS AND BLUETOOTH COMMUNICATION
SENSORS AND BLUETOOTH COMMUNICATIONSENSORS AND BLUETOOTH COMMUNICATION
SENSORS AND BLUETOOTH COMMUNICATION
 
Reverse car-parking
Reverse car-parkingReverse car-parking
Reverse car-parking
 
Ultrasonic sensors
Ultrasonic sensorsUltrasonic sensors
Ultrasonic sensors
 
Arduino radar system
Arduino radar systemArduino radar system
Arduino radar system
 
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
 
Sensor Based Blind Stick
Sensor Based Blind StickSensor Based Blind Stick
Sensor Based Blind Stick
 
Radar
RadarRadar
Radar
 
Arduino-with-Ultrasonic-sensor.pdf
Arduino-with-Ultrasonic-sensor.pdfArduino-with-Ultrasonic-sensor.pdf
Arduino-with-Ultrasonic-sensor.pdf
 
Ultrasonic Range Finder
Ultrasonic Range FinderUltrasonic Range Finder
Ultrasonic Range Finder
 
Ultrasonicsensor 170828140914
Ultrasonicsensor 170828140914Ultrasonicsensor 170828140914
Ultrasonicsensor 170828140914
 
Ultrasonic sensor
Ultrasonic sensorUltrasonic sensor
Ultrasonic sensor
 
4th-Yr-PROJECT-REPORT
4th-Yr-PROJECT-REPORT4th-Yr-PROJECT-REPORT
4th-Yr-PROJECT-REPORT
 
Ultrasonic_Based_Security_System
Ultrasonic_Based_Security_SystemUltrasonic_Based_Security_System
Ultrasonic_Based_Security_System
 
Final year Engineering project
Final year Engineering project Final year Engineering project
Final year Engineering project
 
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripheralsThe IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
 
Radar Detector
Radar Detector Radar Detector
Radar Detector
 
Ei unit 2
Ei unit 2Ei unit 2
Ei unit 2
 
Obstacle detection using ultra sonic sensor
Obstacle detection using ultra sonic sensorObstacle detection using ultra sonic sensor
Obstacle detection using ultra sonic sensor
 
US_pres.pptx
US_pres.pptxUS_pres.pptx
US_pres.pptx
 
Hc sr04 users-manual
Hc sr04 users-manualHc sr04 users-manual
Hc sr04 users-manual
 

Recently uploaded

Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfsumitt6_25730773
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information SystemsAnge Felix NSANZIYERA
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiessarkmank1
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...ppkakm
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesRashidFaridChishti
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdfKamal Acharya
 

Recently uploaded (20)

Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information Systems
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdf
 

Ultrsonic sensor_Arduino_DRKG.pptx

  • 1. Course: ECE322 Presentation by Dr. Kesavan Gopal 1 Experiment: Ultra Sonic Sensor interfacing with Arduino Uno
  • 2. Outline • Ultrasonic Principle • Ultrasonic Module – HC- SR04, features, Function • Distance Calculation • Connection Diagram • Arduino Sketch • Observation & Results 2
  • 3. Ultrasonic Sensor Principle • Generate an inaudible sound wave (40 KHz, human’s cannot hear it, human auditory system is capable of up to 20 KHz ) • Transmit the sound in open • Wait for a reflection from near by objects • Measure the time taken to make te onward journey and return journey of the sound wave. • Calculate the distance 3
  • 4. Ultrasonic Sensor HC-SR-04 Module • HC SR-04 Module 4 Pin1 (Vcc): This pin provides a +5V power supply to the sensor. Pin2 (Trigger): This is an input pin, used to initialize measurement by transmitting ultrasonic waves by keeping this pin high for 10us. Pin3 (Echo): This is an output pin, which goes high for a specific time period and it will be equivalent to the duration of the time for the wave to return back to the sensor. Pin4 (Ground): This is a GND pin used to connect to the GND of the system.
  • 5. Salient Features of SR04 • Power supply: 5V • Operating current: 15m • Quiescent Current < 2mA • Dimension: 45mm x20mmx15mm • Pulse width Trigger: 10uS 5 • Resolution: 3 mm • Measuring angle: 30 deg • Effectual Angle: < 15 Deg • Operating frequency 40 KHZ
  • 6. Ultrasonic Sensor - Function 6
  • 8. Distance Calculation • Speed of Sound (S) = 340 m/s= 0.034 cm /us • Time = Distance / Speed • Distance = Time X Speed • Distance = (Time X (0.034 cm/us) ) • (Travelled by the sound wave) • Distance to Object = (Time X (0.034 cm/us) ) / 2 • Note: divided by 2 is for round trip distance 8
  • 10. Arduino Sketch // defines pins numbers const int trigPin = 13; const int echoPin = 12; // defines variables long duration; int distance; void setup() { pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input Serial.begin(9600); // Starts the serial communication } 10
  • 11. Cont… void loop() { // Clears the trigPin digitalWrite(trigPin, LOW); delayMicroseconds(2); // Sets the trigPin on HIGH state for 10 micro seconds digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); // Reads the echoPin, returns the sound wave travel time in microseconds duration = pulseIn(echoPin, HIGH); // Calculating the distance distance= duration*0.034/2; // Prints the distance on the Serial Monitor Serial.print("Distance: "); Serial.println(distance); delay(2000); } 11
  • 13. Queries? • Queries related to this after class hours may be directed to e-mail Kesavan.24346@lpu.co.in or through LPU live. 13