URM06 ANALOG_Ultrasonic_SKU_SEN0151 - jimaobian/DFRobotWiki GitHub Wiki
Introduction
To Do
Specification
- Working Voltage: 6V-12V
- Rated Current: 16mA
- Peek Current: 2A
- Interface: TTL pulse
- Working Frequency: 49.5KHZ
- Working Temperature: -10℃ ~ +70℃
- Detecting Angle: 15°(-6dB)
- Detecting Range: 20cm ~ 10m
- Size: 50mm(diameter)*43mm(length)
- Mounting Thread Diameter: 35mm
- Weight: 45g
Applications
- robot navigation
- obstacle avoidance
- measuring distance devices
- engineering measurement tools
- industrial control system
Connection Diagram
Pin Definition
- VCC: 6~12V@Max 2A
- GND: Ground
- Trig: Measurement trigger pin - Low level pulse over 50us triggers one distance measurement. Holding this pin LOW will repeats the measurement every 100ms.
- ECHO: Pulse signal output pin – 1us high level pulse equals 1mm in distance. If error occurs in detection, a 15000us high level pulse will be generated.
Sample Code
#include "Arduino.h"
/*
Trig: Measurement trigger pin - Low level pulse over 50us triggers one distance measurement.
Holding this pin LOW will repeats the measurement every 100ms.
*/
#define TRIGGER 2
/*
ECHO: Pulse signal output pin – 1us high level pulse equals 1mm in distance.
If error occurs in detection, a 15000us high level pulse will be generated.
*/
#define ECHO 3
void setup()
{
pinMode(TRIGGER, OUTPUT);
digitalWrite(TRIGGER, HIGH);
pinMode(ECHO, INPUT);
Serial.begin(9600);
}
void loop()
{
// generate the pulse to trigger the sensor
digitalWrite(TRIGGER, LOW);
delayMicroseconds(50);
digitalWrite(TRIGGER, HIGH);
delayMicroseconds(50);
//read the time of the pulse. 1us equals 1mm.
int distance = pulseIn(ECHO,HIGH);
Serial.print("distance:");
Serial.print(distance);
Serial.println("mm");
delay(500);
}
shopping digital servo shield for arduino(sku:dri0027) category: Product Manual category: SEN Series category: Sensors category: source