Introduction
This is an ultrasonic sensor with an open dual-probe, employing standard interface of Gravity PH2.0-3P vertical patch socket. The module is compatible with controllers with 3.3V or 5V logical level, such as Arduino and Raspberry Pi.
The sensor comes with built-in temperature compensation, which can greatly reduce measurement error caused by over high/low temperature. It adopts analog voltage output, and provides accurate distance measurement within 2-500cm with 1cm resolution and ±1% accuracy. The design of dual probe effectively decreases the dead zone. Users can check the measurement process conveniently by the onboard indicator.
This small ranging module can be used in an extensive range of applications, for instance, robots with obstacle avoidance function, backing car annunciator, doorbell etc.
Specification
- Power Supply: 3.3~5.5V DC
- Operating Current: 20mA
- Operating Temperature: -10℃~+70℃
- Measurement Range: 2cm~500cm
- Resolution: 1cm
- Accuracy: 1%
- Acoustic Frequency: 38~42KHz
- Frequency: 30Hz Max
- Dimension: 47mm × 22 mm/1.85×0.87”
- Distance Formula: Distance=Vout(mV)×520/Vin(mV)
Measuring Angle
Board Overview
Pin | Description |
---|---|
- | Ground |
+ | Power Input(3.3V-5.5V) |
A | Analog Output |
Tutorial
This is a practical and simple ultrasonic sensor that adopts analog voltage ouput. It can be easily connected to main control board with Gravity 3Pin connectors.
Connection Diagram
Connnect the module to UNO via I2C interface, shown as below:
Distance Measurement
The module will output analog voltage proportional to distance. After ADC sampled and output these data, the distance value can be obtained with a simple processing step.
Sample Code
// # Editor : roker
// # Date : 18.02.2019
// # Product name: URM09 Ultrasonic Sensor(Gravity Analog)(V1.0)
// # Product SKU : SEN0307
// # Version : 1.0
#define MAX_RANG (520)//the max measurement vaule of the module is 520cm(a little bit longer than effective max range)
#define ADC_SOLUTION (1023.0)//ADC accuracy of Arduino UNO is 10bit
int sensityPin = A0; // select the input pin
void setup() {
// Serial init
Serial.begin(9600);
}
float dist_t, sensity_t;
void loop() {
// read the value from the sensor:
sensity_t = analogRead(sensityPin);
// turn the ledPin on
dist_t = sensity_t * MAX_RANG / ADC_SOLUTION;//
Serial.print(dist_t,0);
Serial.println("cm");
delay(500);
}
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum