Difference between revisions of "Ultrasonic range measurement module"
(→Usage) |
|||
Line 25: | Line 25: | ||
==Usage== | ==Usage== | ||
[[File:Ultrasonic 2.jpg|500px]] | [[File:Ultrasonic 2.jpg|500px]] | ||
+ | |||
[[File:Ultrasonic table.jpg]] | [[File:Ultrasonic table.jpg]] | ||
[User guide http://www.robot-electronics.co.uk/acatalog/Ultrasonic_Rangers.html] | [User guide http://www.robot-electronics.co.uk/acatalog/Ultrasonic_Rangers.html] | ||
+ | |||
==Example code== | ==Example code== | ||
int inputPin=4; // define ultrasonic signal receiver pin ECHO to D4 | int inputPin=4; // define ultrasonic signal receiver pin ECHO to D4 |
Revision as of 00:49, 23 May 2012
Introduction
SRF-05 is the latest model of this series of ultrasonic distance measuring sensor.This ultrasonic ranger has an approximate range of 3 cm to 4 m. This ranger has a logic line used to trigger a pulse and the echo is returned on a second line. Minimal power requirements and a compact, self contained design make this a versatile range finder.
Description
- Working Voltage : 5V(DC)
- Static current: Less than 2mA.
- Output signal: Electric frequency signal, high level 5V, low level 0V.
- Sensor angle: Not more than 15 degrees.
- Detection distance: 2cm-450cm.
- High precision: Up to 0.3cm
- Input trigger signal: 10us TTL impulse
- Echo signal : output TTL PWL signal
Working principal
1.Adopt IO trigger through supplying at least 10us sequence of high level signal. 2.The module automatically send eight 40khz square wave and automatically detect whether receive the returning pulse signal. 3.If there is signals returning, through outputting high level and the time of high level continuing is the time of that from the ultrasonic transmitting to receiving. Test distance = (high level time * sound velocity (340M/S) / 2.
Usage
[User guide http://www.robot-electronics.co.uk/acatalog/Ultrasonic_Rangers.html]
Example code
int inputPin=4; // define ultrasonic signal receiver pin ECHO to D4 int outputPin=5; // define ultrasonic signal transmitter pin TRIG to D5 void setup() { Serial.begin(9600); pinMode(inputPin, INPUT); pinMode(outputPin, OUTPUT); } void loop() { digitalWrite(outputPin, LOW); delayMicroseconds(2); digitalWrite(outputPin, HIGH); // Pulse for 10μs to trigger ultrasonic detection delayMicroseconds(10); digitalWrite(outputPin, LOW); int distance = pulseIn(inputPin, HIGH); // Read receiver pulse time distance= distance/58; // Transform pulse time to distance Serial.println(distance); //Ourput distance delay(50); }
==Click here to buy Ultra Sonic range measurement module