SlideShare uma empresa Scribd logo
1 de 8
HC-SR04
Ultra-sonic sensor
Arduino Uno
Atmega328
Arduino Uno
Atmega328
Pin Symbol Function
1 VCC Power Supply
2 Trig Triggering Signal
3 Echo Echo Receiver
4 GND Signal Ground
#include <LiquidCrystal.h> //Load the Liquid Crystal Library
LiquidCrystal LCD(12, 11, 5, 4, 3, 2); //Create Liquid Crystal Object called LCD
#define trigPin 8 //Sensor Trigger pin connected to Arduino pin 8
#define echoPin 9 //Sensor Echo pin connected to Arduino pin 9
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
LCD.begin(16,2); //Tell Arduino to start your 16 column 2 row LCD
LCD.setCursor(0,0); //Set LCD cursor to upper left corner, column 0, row 0
LCD.print("Target Distance:"); //Print Message on first row
}
void loop() {
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
LCD.setCursor(0,1); //Set cursor to first column of second row
LCD.print(" "); //Print blanks to clear the row
LCD.setCursor(0,1); //Set cursor again to first column of second row
LCD.print(distance); //Print measured distance
LCD.print(" cm"); //Print your units.
delay(250); //pause to let things settle
}
• Production line robots
• Parking sensor of cars
• Car wash stations
• Self driving vehicles

Mais conteúdo relacionado

Mais procurados

Vehicle Theft control system
Vehicle Theft control systemVehicle Theft control system
Vehicle Theft control systemAnkush Jamthikar
 
A report on ultrasonic distance measurement
A report on ultrasonic distance measurementA report on ultrasonic distance measurement
A report on ultrasonic distance measurementitfakash
 
Obstacle avoidance robot
Obstacle avoidance robotObstacle avoidance robot
Obstacle avoidance robotRahuldey1991
 
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMS
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMSACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMS
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMSKrishna Moparthi
 
Women safety device with gps tracking and alerts
Women safety device with gps tracking  and alertsWomen safety device with gps tracking  and alerts
Women safety device with gps tracking and alertsPraween Lakra
 
Monopulse tracking radar
Monopulse tracking radarMonopulse tracking radar
Monopulse tracking radarAshok Selsan
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.Omkar Rane
 
1. Introduction to Embedded Systems & IoT
1. Introduction to Embedded Systems & IoT1. Introduction to Embedded Systems & IoT
1. Introduction to Embedded Systems & IoTIEEE MIU SB
 
PROJECT REPORT ON Home automation using by Bluetooth
 PROJECT REPORT ON Home automation using by Bluetooth PROJECT REPORT ON Home automation using by Bluetooth
PROJECT REPORT ON Home automation using by BluetoothAakashkumar276
 
Sensor Based Blind Stick
Sensor Based Blind StickSensor Based Blind Stick
Sensor Based Blind StickGagandeep Singh
 
Bluetooth based Home Automation
Bluetooth based Home AutomationBluetooth based Home Automation
Bluetooth based Home AutomationJagannath Kartik
 

Mais procurados (20)

RF Based Home Automation System
RF Based Home Automation SystemRF Based Home Automation System
RF Based Home Automation System
 
Vehicle Theft control system
Vehicle Theft control systemVehicle Theft control system
Vehicle Theft control system
 
Ultrasonic based distance meter
Ultrasonic based distance meterUltrasonic based distance meter
Ultrasonic based distance meter
 
A report on ultrasonic distance measurement
A report on ultrasonic distance measurementA report on ultrasonic distance measurement
A report on ultrasonic distance measurement
 
RADAR SYSTEM
RADAR SYSTEMRADAR SYSTEM
RADAR SYSTEM
 
OBSTACLE AVOIDING CAR
OBSTACLE AVOIDING CAROBSTACLE AVOIDING CAR
OBSTACLE AVOIDING CAR
 
Antenna (2)
Antenna (2)Antenna (2)
Antenna (2)
 
Obstacle avoidance robot
Obstacle avoidance robotObstacle avoidance robot
Obstacle avoidance robot
 
Lambda design rule
Lambda design ruleLambda design rule
Lambda design rule
 
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMS
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMSACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMS
ACCIDENT DETECTION AND VEHICLE TRACKING USING GPS,GSM AND MEMS
 
Women safety device with gps tracking and alerts
Women safety device with gps tracking  and alertsWomen safety device with gps tracking  and alerts
Women safety device with gps tracking and alerts
 
Monopulse tracking radar
Monopulse tracking radarMonopulse tracking radar
Monopulse tracking radar
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
 
Electronics projects
Electronics projectsElectronics projects
Electronics projects
 
1. Introduction to Embedded Systems & IoT
1. Introduction to Embedded Systems & IoT1. Introduction to Embedded Systems & IoT
1. Introduction to Embedded Systems & IoT
 
PROJECT REPORT ON Home automation using by Bluetooth
 PROJECT REPORT ON Home automation using by Bluetooth PROJECT REPORT ON Home automation using by Bluetooth
PROJECT REPORT ON Home automation using by Bluetooth
 
Sensor Based Blind Stick
Sensor Based Blind StickSensor Based Blind Stick
Sensor Based Blind Stick
 
Ir sensor
Ir sensorIr sensor
Ir sensor
 
BATTERY LESS PHONE
BATTERY LESS PHONE BATTERY LESS PHONE
BATTERY LESS PHONE
 
Bluetooth based Home Automation
Bluetooth based Home AutomationBluetooth based Home Automation
Bluetooth based Home Automation
 

Semelhante a Distance measurement using Ultrasonic sensor on Arduino Uno

Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counterMafaz Ahmed
 
m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for recordG Lemuel George
 
coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino Nanda Fauzi P
 
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
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseElaf A.Saeed
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuatorsEueung Mulyana
 
Functions for Nano 5 Card
Functions for Nano 5 CardFunctions for Nano 5 Card
Functions for Nano 5 CardOmar Sanchez
 
2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdf2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdfVNEX
 
Introducing the Sun SPOTs
Introducing the Sun SPOTsIntroducing the Sun SPOTs
Introducing the Sun SPOTsStefano Sanna
 
Starting with Arduino
Starting with Arduino Starting with Arduino
Starting with Arduino MajdyShamasneh
 
Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Tom Paulus
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfforwardcom41
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMR Selamet
 

Semelhante a Distance measurement using Ultrasonic sensor on Arduino Uno (20)

Arduino: Arduino lcd
Arduino: Arduino lcdArduino: Arduino lcd
Arduino: Arduino lcd
 
Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counter
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for record
 
coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino
 
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
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
 
Day1
Day1Day1
Day1
 
ESD -DAY 24.pptx
ESD -DAY 24.pptxESD -DAY 24.pptx
ESD -DAY 24.pptx
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuators
 
Functions for Nano 5 Card
Functions for Nano 5 CardFunctions for Nano 5 Card
Functions for Nano 5 Card
 
2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdf2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdf
 
Introducing the Sun SPOTs
Introducing the Sun SPOTsIntroducing the Sun SPOTs
Introducing the Sun SPOTs
 
Starting with Arduino
Starting with Arduino Starting with Arduino
Starting with Arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdf
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recording
 

Mais de Aswin KP

Critical reasoning
Critical reasoningCritical reasoning
Critical reasoningAswin KP
 
Cell-Phone/Tower Radiation Hazards
Cell-Phone/Tower Radiation Hazards Cell-Phone/Tower Radiation Hazards
Cell-Phone/Tower Radiation Hazards Aswin KP
 
International Telecommunication Union (ITU)
International Telecommunication Union (ITU)International Telecommunication Union (ITU)
International Telecommunication Union (ITU)Aswin KP
 
International Telecommunication Union for Radio Communication (ITU-R)
International Telecommunication Union for Radio Communication (ITU-R)International Telecommunication Union for Radio Communication (ITU-R)
International Telecommunication Union for Radio Communication (ITU-R)Aswin KP
 
ITU-R and ISM
ITU-R and ISMITU-R and ISM
ITU-R and ISMAswin KP
 
Electrical shock hazards and its effects on human body
Electrical shock hazards and its effects on human bodyElectrical shock hazards and its effects on human body
Electrical shock hazards and its effects on human bodyAswin KP
 
Earthing or Grounding
Earthing or GroundingEarthing or Grounding
Earthing or GroundingAswin KP
 
Tidal Energy (Non Conventional Energy Source)
Tidal Energy (Non Conventional Energy Source)Tidal Energy (Non Conventional Energy Source)
Tidal Energy (Non Conventional Energy Source)Aswin KP
 
Report on Internship at SRAPL (Siemens Rail Automation Pvt. Ltd.)
Report on Internship at SRAPL (Siemens Rail Automation Pvt. Ltd.)Report on Internship at SRAPL (Siemens Rail Automation Pvt. Ltd.)
Report on Internship at SRAPL (Siemens Rail Automation Pvt. Ltd.)Aswin KP
 
Alternator (AC Generator) Synchronizing Panel
Alternator (AC Generator) Synchronizing PanelAlternator (AC Generator) Synchronizing Panel
Alternator (AC Generator) Synchronizing PanelAswin KP
 
Disaster Management and Health
Disaster Management and HealthDisaster Management and Health
Disaster Management and HealthAswin KP
 

Mais de Aswin KP (11)

Critical reasoning
Critical reasoningCritical reasoning
Critical reasoning
 
Cell-Phone/Tower Radiation Hazards
Cell-Phone/Tower Radiation Hazards Cell-Phone/Tower Radiation Hazards
Cell-Phone/Tower Radiation Hazards
 
International Telecommunication Union (ITU)
International Telecommunication Union (ITU)International Telecommunication Union (ITU)
International Telecommunication Union (ITU)
 
International Telecommunication Union for Radio Communication (ITU-R)
International Telecommunication Union for Radio Communication (ITU-R)International Telecommunication Union for Radio Communication (ITU-R)
International Telecommunication Union for Radio Communication (ITU-R)
 
ITU-R and ISM
ITU-R and ISMITU-R and ISM
ITU-R and ISM
 
Electrical shock hazards and its effects on human body
Electrical shock hazards and its effects on human bodyElectrical shock hazards and its effects on human body
Electrical shock hazards and its effects on human body
 
Earthing or Grounding
Earthing or GroundingEarthing or Grounding
Earthing or Grounding
 
Tidal Energy (Non Conventional Energy Source)
Tidal Energy (Non Conventional Energy Source)Tidal Energy (Non Conventional Energy Source)
Tidal Energy (Non Conventional Energy Source)
 
Report on Internship at SRAPL (Siemens Rail Automation Pvt. Ltd.)
Report on Internship at SRAPL (Siemens Rail Automation Pvt. Ltd.)Report on Internship at SRAPL (Siemens Rail Automation Pvt. Ltd.)
Report on Internship at SRAPL (Siemens Rail Automation Pvt. Ltd.)
 
Alternator (AC Generator) Synchronizing Panel
Alternator (AC Generator) Synchronizing PanelAlternator (AC Generator) Synchronizing Panel
Alternator (AC Generator) Synchronizing Panel
 
Disaster Management and Health
Disaster Management and HealthDisaster Management and Health
Disaster Management and Health
 

Último

General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Último (20)

General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

Distance measurement using Ultrasonic sensor on Arduino Uno

  • 1.
  • 3.
  • 4. Pin Symbol Function 1 VCC Power Supply 2 Trig Triggering Signal 3 Echo Echo Receiver 4 GND Signal Ground
  • 5.
  • 6.
  • 7. #include <LiquidCrystal.h> //Load the Liquid Crystal Library LiquidCrystal LCD(12, 11, 5, 4, 3, 2); //Create Liquid Crystal Object called LCD #define trigPin 8 //Sensor Trigger pin connected to Arduino pin 8 #define echoPin 9 //Sensor Echo pin connected to Arduino pin 9 void setup() { pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); LCD.begin(16,2); //Tell Arduino to start your 16 column 2 row LCD LCD.setCursor(0,0); //Set LCD cursor to upper left corner, column 0, row 0 LCD.print("Target Distance:"); //Print Message on first row } void loop() { long duration, distance; digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration/2) / 29.1; LCD.setCursor(0,1); //Set cursor to first column of second row LCD.print(" "); //Print blanks to clear the row LCD.setCursor(0,1); //Set cursor again to first column of second row LCD.print(distance); //Print measured distance LCD.print(" cm"); //Print your units. delay(250); //pause to let things settle }
  • 8. • Production line robots • Parking sensor of cars • Car wash stations • Self driving vehicles