Ultrasonic Sensor TYWu.

Slides:



Advertisements
Similar presentations
Khaled A. Al-Utaibi  Digital Vs Analog Signals  Converting an Analog Signal to a Digital One  Reading Analog Sensors with the.
Advertisements

PING))) Ultrasonic Distance Sensor living with the lab ultrasonic pressure waves from PING))) speaker The PING))) sensor emits short bursts of sound and.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
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.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
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.
Basic Circuits – Lab 2 Arduino and Sensors
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.
PING))) Ultrasonic Distance Sensor living with the lab ultrasonic pressure waves from PING))) speaker The PING))) sensor emits short bursts of sound and.
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi. Objectives 1. Control the rotation of standard servo motor  A standard servo motor is limited in its rotation.
Pulse Width Modulation (PWM). 100% Pulse Width Modulation (PWM) 0% On the chipKIT there are 490 periods per second. Use analogWrite(pin, value) to control.
Material taken from Robotics with the Boe-Bot
Suleyman Demirel University CSS340 Microprocessor Systems – Lecture 2 ATMEGA328P ARCHITECTURE ANALOG INPUTS.
Processing TYWu. Where can I download? 2.0b9 Windows 32-bit.
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.
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
Basic Circuits – Lab 4 Serial and OSC (maybe some theory too) Xmedia Spring 2011.
BMP085 Barometric Digital Pressure Sensor Module TYWu.
TechKnowTone Contents: Sensor Features Sensor Connections Sample Sketch Questions …Sensor Features… Arduino Coding – Distance Sensors.
Wireless TYWu. 433Mhz RF link kit Picture 433Mhz RF link kit Specification –Frequency: 433Mhz. –Receiver Data Output: High - 1/2 Vcc, Low - 0.7v –Transmitter.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
C# SERIAL COMMUNICATION TEMPERATURE CONTROL WITH ARDUINO KAAN EREN
Temperature Sensor TYWu. Seeed’s Temperature Sensor Picture.
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
Microcontroller basics Embedded systems for mortals.
Istituto Tecnico Industriale A.Monaco EURLAB Object Detection Object Detection by Ultrasonic How to install and program a ultra sonic sensor with Arduino.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
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 Control a Servo Motor If you want to swing an robot arm or … steer a robot you need a special motor (Servo).
Electronic instrumentation Digitization of Analog Signal in TD
Pulse-Width Modulation: Simulating variable DC output
Infrared Proximity Sensors & Liquid Crystal Display Instructor Dr Matthew Khin Yi Kyaw.
Microcontroller basics Embedded systems for mortals.
Pulse Width Modulation Instructor Dr Matthew Khi Yi Kyaw.
DC Motor – H bridge L293D ile Kontrolü /* Adafruit Arduino - Lesson 15. Bi-directional Motor */ int enablePin = 11; int in1Pin = 10; int in2Pin = 9; int.
physical computing .2 – Day 3
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
ARDUINO UNO The Arduino uno is a microcontroller board based on the ATmega328. It has 14 digital Input / Output pins (of which 6 can be used as PWM outputs),
Using Arduino and Cheap Ultrasonic Transducer for Robotics
Application of Programming: Scratch & Arduino
Assist. Prof. Rassim Suliyev - SDU 2017
Using Arduinos to Teach Engineering Concepts
If you want to swing an robot arm or …
Assist. Prof. Rassim Suliyev - SDU 2017
BMP085 Barometric Digital Pressure Sensor Module
Microcontroller basics
Sensors with Arduino A Microcontroller.
Ultrasonic Distance Sensor
Arduino motor control using servo & ultrasonic sensor
Arduino Part 1 Topics: Microcontrollers Programming Basics
Arduino - Introduction
Chapter E –Transistors and H-Bridges
Arduino Uno and sensors
Vex Ultrasonic Sensor (US) Interfacing and Programming
Maxbotix Ultrasonic Distance Sensor
Ultrasonic Distance Sensor
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi.
Using Photoresistors with an Arduino
Appliace Remote Control
CTY SAR FCPS Shawn Lupoli, Elliot Tan
frclabviewtutorials.com/workshop
Pulse-Width Modulation: Simulating variable DC output
CTY SAR FCPS Alexander Velikanov
Ultrasonic Distance Sensor
Presentation transcript:

Ultrasonic Sensor TYWu

HC-SR04 Picture

HC-SR04 Specifications power supply :5V DC quiescent current : <2mA effectual angle: <15° ranging distance : 2cm – 500 cm resolution : 0.3 cm 40KHz ultrasonic signal

HC-SR04 There are 4 pins Control VCC , Trig, Echo, GND Control pull the Trig pin to high level  for more than 10us impulse , the module start ranging finish ranging, If you find an object in front, Echo pin will be high level, and based on the different distance, it will take the different duration of high level. So we can calculated the distance easily : Distance = High Level Duration*(Sonic:340m/s)/2

HC-SR04 Control

HC-SR04 Effectual Angle: <15°

HC-SR04 Library Ultrasonic.cpp Ultrasonic.cpp and Ultrasonic.h #include "WProgram.h" #include "Ultrasonic.h" Ultrasonic::Ultrasonic(int TP, int EP) { pinMode(TP,OUTPUT); pinMode(EP,INPUT); Trig_pin=TP; Echo_pin=EP; }

HC-SR04 long Ultrasonic::Timing() { digitalWrite(Trig_pin, LOW); delayMicroseconds(2); digitalWrite(Trig_pin, HIGH); delayMicroseconds(10); duration = pulseIn(Echo_pin,HIGH); // in microseconds return duration; }

HC-SR04 long Ultrasonic::Ranging(int sys) { Timing(); distacne_cm = duration / 29 / 2 ; // 34000cm/s*us=0.034=1/29 distance_inc = duration / 74 / 2; if (sys) return distacne_cm; else return distance_inc; }

HC-SR04 Ultrasonic.h #ifndef Ultrasonic_h #define Ultrasonic_h #include "WProgram.h" #define CM 1 #define INC 0

HC-SR04 class Ultrasonic { public: Ultrasonic(int TP, int EP); long Timing(); long Ranging(int sys); private: int Trig_pin; int Echo_pin; long duration,distacne_cm,distance_inc; }; #endif

HC-SR04 Test Example (Sketch) #include "Ultrasonic.h" Ultrasonic ultrasonic(12,13); // TP: pin 12, EP: pin 13 void setup() { Serial.begin(9600); } void loop() Serial.print(ultrasonic.Ranging(CM)); Serial.println(" cm");

LV-MaxSonar®-EZ1 Pictures

LV-MaxSonar®-EZ1 Overview detects objects from 0-inches to 254-inches (6.45-meters) 1-inch resolution The interface output formats included are pulse width output, analog voltage output, and serial digital output.

LV-MaxSonar®-EZ1 AN – Outputs analog voltage with a scaling factor of (Vcc/512) per inch. A supply of 5V yields ~9.8mV/in. and 3.3V yields ~6.4mV/in. The output is buffered and corresponds to the most recent range data.

LV-MaxSonar®-EZ1 Test Example (Sketch) int ultraAn = 0; // select the input pin for the ultrasonic sensor int val = 0; // variable to store the value coming from the sensor int dist = 0; // variable to store the converted distance in inches // VDD Connect to 3.3V void setup() { Serial.begin(9600); // setup the serial port to send the values // back to the computer }

LV-MaxSonar®-EZ1 void loop() { val = analogRead(ultraAn); // read the value from the sensor Serial.println(val); // print the value to the serial port dist = (val*2.1); // converts the analog value to distance in inches Serial.print(dist); // prints the distance in cm Serial.println(" cm"); // prints the distance in cm delay (500); // delays 0.5 seccond in between readings }