Ultrasonic Distance Sensor

Slides:



Advertisements
Similar presentations
Khaled A. Al-Utaibi Interfacing an LED The Light Emitting Diode (LED) Applications DC Characteristics & Operation Interfacing to.
Advertisements

Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
Introduction to Sensor Technology Week Three Adam Taylor
Using the Arduino to Make an LED Flash Work in teams of two! living with the lab digital I/O pins (I/O = input / output) USB cable plug power pins.
PING))) Ultrasonic Distance Sensor living with the lab ultrasonic pressure waves from PING))) speaker The PING))) sensor emits short bursts of sound and.
IR Object Detection living with the lab IR light from LED IR light reflected off object IR LED IR receiver Infrared (IR) light leaving an LED reflects.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2011 LWTL faculty team.
1 Ultrasonic Distance Sensor. 2 How it Works The distance sensor emits short bursts of sound and listens for this sound to echo off of nearby objects.
PROGRAMMING WITH ARDUINO. Arduino An open-source hardware platform based on an Atmel AVR 8-bit microcontroller and a C++ based IDE Over boards.
Embedded Programming and Robotics Lesson 10 Ultrasonic Range Finder Range Finder1.
Sensors Material taken from Robotics with the Boe-Bot.
Sensor Technology Dr. Konstantinos Tatas. Outline Introduction Sensor requirements Sensor Technology Selecting a sensor Interfacing with sensors Integrated.
Sensors. This is a set of transmitter and receiver in one of the photoelectric sensor. Detection distance can be adjusted according to the requirements.
Program ultrasonic range sensor in autonomous mode
PING))) Ultrasonic Distance Sensor living with the lab ultrasonic pressure waves from PING))) speaker The PING))) sensor emits short bursts of sound and.
Khaled A. Al-Utaibi  The Push Button  Interfacing Push Buttons to Arduino  Programming Digital Inputs  Working with “Bouncy”
Sensors Material taken from Robotics with the Boe-Bot.
Using Hobby Servos with the Arduino living with the lab © 2012 David Hall.
Material taken from Robotics with the Boe-Bot
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
PHY 235 Robotics Workshop Day 5 Distance Sensing Using The Ultrasonic Ping Sensor.
TechKnowTone Contents: Sensor Features Sensor Connections Sample Sketch Questions …Sensor Features… Arduino Coding – Distance Sensors.
Autumn, 2012C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Sensors I Chin-Shiuh Shieh ( 謝欽旭 ) Department of Electronic.
PWM: Pulse Width Modulation © 2014 Project Lead The Way, Inc.Digital Electronics.
PROGRAMMING WITH ARDUINO. Arduino An open-source hardware platform based on an Atmel AVR 8-bit microcontroller and a C++ based IDE Over boards.
INTERNET OF EVERYTHING SDU 2016 Week 6. Getting Input from Sensors  Sensors give report on the world around it  Sensors convert physical input an electrical.
AAPT workshop W03 July 26, 2014 Saint Cloud State University, MN, USA
IR Object Detection living with the lab IR light from LED IR light reflected off object IR LED IR receiver Infrared (IR) light leaving an LED reflects.
Istituto Tecnico Industriale A.Monaco EURLAB Object Detection Object Detection by Ultrasonic How to install and program a ultra sonic sensor with Arduino.
Istituto Tecnico Industriale A.Monaco EURLAB Object Detection Object Detection by Ultrasonic How to install and program a ultra sonic sensor with Arduino.
Ultrasonic Sensor TYWu.
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
breadboard LED Resistor Potentiometer Circuit.
Arduino.
NXT Mindstorms Kit Programming
Using Arduino and Cheap Ultrasonic Transducer for Robotics
Application of Programming: Scratch & Arduino
Microcontroller basics
Using Arduinos to Teach Engineering Concepts
Assist. Prof. Rassim Suliyev - SDU 2017
Microcontroller basics
Microcontroller basics
Sensors with Arduino A Microcontroller.
Ultrasonic Distance Sensor
Arduino motor control using servo & ultrasonic sensor
Get Your Project Started with Arduino
Arduino Part 1 Topics: Microcontrollers Programming Basics
INC 161 , CPE 100 Computer Programming
3.0 ARDUINO WORKSHOP PRESENTATION FOR STUDENTS IN 4º DEGREE OF COMPULSORY SECONDARY EDUCATION 3.0.
Arduino - Introduction
Chapter E –Transistors and H-Bridges
Arduino Uno and sensors
How an Ultrasonic Range Finder works
Vex Ultrasonic Sensor (US) Interfacing and Programming
How to avoid catching things on fire.
ARDUINO     What is an Arduino? Features 14 Digital I/O pins 6 Analogue inputs 6 PWM pins USB serial 16MHz Clock speed 32KB Flash memory 2KB SRAM.
Maxbotix Ultrasonic Distance Sensor
Schedule 8:00-11:00 Workshop: Arduino Fundamentals
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi.
using the Arduino to make LEDs flash
Implementing Switches Using Interrupts
IR Object Detection IR detector IR LED IR light reflected off object
Sensors and actuators Sensors Resistive sensors
CTY SAR FCPS Shawn Lupoli, Elliot Tan
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Arduino Uno circuit basics
Arduino程式範例.
Sound Waves and Ultrasound
CTY SAR FCPS Alexander Velikanov
Ultrasonic Distance Sensor
Presentation transcript:

Ultrasonic Distance Sensor The PING))) sensor emits short bursts of sound and listens for this sound to echo off of nearby objects. The frequency of the sound is too high for humans to hear (it is ultrasonic). The PING))) sensor measures the time of flight of the sound burst. A user then computes the distance to an object using this time of flight and the speed of sound (1,126 ft/s). ultrasonic pressure waves from PING))) speaker sound wave reflects off object and returns to PING))) “microphone”

Computing Distance  

Specifications Working Voltage : 5V(DC) Working Current : max 15 ma Working frequency : 40HZ Output Signal : 0-5V (Output high when obstacle in range) Sentry Angle : max 15 degree Sentry Distance : 2cm - 500cm High-accuracy : 0.3cm sensing distance (feet) as a function of angle www.parallax.com/Portals/0/Downloads/docs/prod/acc/28015-PING-v1.6.pdf

Interface with Arduino

Arduino Connection to an Arduino DIGITAL ANALOG POWER AREF GND 13 12 PMW 11 PMW 10 PMW 9 8 7 PMW 6 PMW 5 4 PMW 3 2 TX 1 RX 0 RESET 3V3 5V GND GND Vin 0 1 2 3 4 5 DIGITAL ANALOG POWER Arduino

Arduino Sketch The Arduino triggers the PING))) by sending a 5ms pulse to the sensor through pin 7, which is initially configured as an Arduino OUTPUT. Immediately after sending this pulse, pin 7 is switched to an INPUT. When the PING))) receives the 5ms pulse from the Arduino, it sends a 40kHz (ultrasonic) burst of sound out its “speaker” and sets pin 7 to HIGH. The PING))) then waits for the sound burst to reflect off of something and return to the “microphone” where it is detected; the PING))) then sets pin 7 to LOW. The Arduino uses the pulseIn command to measure the time of flight of the sound wave in microseconds (the time that pin 7, when configured as an input, is HIGH). The “time of flight” of the sound wave in ms is stored in the variable “duration.” void setup() { Serial.begin(9600); } void loop() { long duration, inches; pinMode(7, OUTPUT); // send a 5 microsecond pulse out pin 7 digitalWrite(7, LOW); delayMicroseconds(2); digitalWrite(7, HIGH); delayMicroseconds(5); digitalWrite(7, LOW); pinMode(7, INPUT); // make pin 7 an input duration = pulseIn(7, HIGH); // measure the time of flight of sound wave inches = duration / 74 / 2; // 1130 ft/s * 12in/ft * 1s/1,000,000us = 74 // factor of 2 since sound travels out and back Serial.print(inches); // display distance in inches Serial.print("in "); Serial.println(); }

Arduino Programming The Arduino triggers the PING))) by sending a 5ms pulse to the sensor through pin 2, which is initially configured as an Arduino OUTPUT. When the PING))) receives the 5ms pulse from the Arduino, it sends a 40kHz (ultrasonic) burst of sound out its “speaker” and sets pin 2 to HIGH. The PING))) then waits for the sound burst to reflect off of something and return to the “microphone” where it is detected; the PING))) then sets pin 3 to LOW. The Arduino uses the pulseIn command to measure the time of flight of the sound wave in microseconds (the time that pin 3, when configured as an input, is HIGH). The “time of flight” of the sound wave in ms is stored in the variable “duration.”

Arduino Programming int pingPin = 2 int inPin = 3 long microseconds; void setup() { Serial.begin(9600); } void loop() { long duration, inches, cm; digitalWrite(pingPin, LOW); delayMicroseconds(2); digitalWrite(pingPin, HIGH); delayMicroseconds(10); pinMode(pingPin, OUTPUT); pinMode(inPin, INPUT); duration = pulseIn(inPin, HIGH); inches = microsecondsToInches(duration); cm = microsecondsToCentimeters(duration); Serial.print(inches); Serial.print("in, "); Serial.print(cm); Serial.print("cm"); Serial.println(); delay(100); } long microsecondsToInches(long microseconds) { return microseconds / 74 / 2; } long microsecondsToCentimeters(long microseconds) { return microseconds / 29 / 2;

Example Application The picture shows how stiff wire (such as a coat hanger) can be used to mount the PING))) to an aluminum plate. An Arduino and breadboard are also mounted to the plate, and a piezospeaker is installed on the breadboard to allow the device to output an irritating noise whose frequency is proportional to the distance from the PING))) to a target. void setup() {pinMode(8, OUTPUT); }   void loop() { long duration, inches, tone_freq; pinMode(7, OUTPUT); // make pin 7 an output digitalWrite(7, LOW); // send wakeup pulse delayMicroseconds(2); digitalWrite(7, HIGH); delayMicroseconds(5); digitalWrite(7, LOW); pinMode(7, INPUT); // make pin 7 an input duration = pulseIn(7, HIGH); // time of flight of wave inches = duration / 74 / 2; // compute distance in inches tone_freq = inches*100; // a freq of 100*inches is good tone(8,tone_freq); // send a tone out of pin 8 }