SRF05 Ultrasonic Range Sensor
Accurate Measure 2-400cm+ Distances
The SRF05 is a highly-accurate ultrasonic range sensor for 2-450cm distances with approximately 2mm accuracy. Unlike the discontinued SR04 sensor, the updated SRF05 offers increased range and accuracy. The SRF05 also has a built-in delay before the echo pulse giving microcontrollers additional time to execute the pulse-reading functions.

How It Works
The SRF05 works like this:
- Send a pulse signal to pin-2 (TRIG), which is a minimum of 10us long.
The trigger pulse activates the module to start detecting. The ultrasonic module will automatically send eight 40khz square waves and will automatically detect when there is a reflected signal. - When a reflected signal is sensed, pin-3 (ECHO) will output a high level.
The duration of the high-level is the time from ultrasonic launch to return.
As a result, the Measured Distance = (T(Time of High Level output ) * (340M / S)) / 2
The reason for the division by two is that since this is an echo, the signal has traveled both to and from the object. Also, keep in mind the speed of sound is dependent on temperature so keep that in mind if you need accuracy
Technical Details
- Operating Voltage: 5V DC
- Standby Current: <2mA
- Operating Current: 15mA
- Operating Frequency: 40KHz
- Measurement Range: 2cm to ~450cm
- Measurement Angle: 15-degree
- Trigger Signal: 10uS TTL Pulse
- Pin Spacing: 5 pins, 0.1" spacing
- Pins
- 1) VCC (+5V)
- 2) TRIG (Trigger In)
- 3) Echo (Return Signal)
- 4) OUT
- 5) GND (Ground)
Sample Arduino Code
asdf
/*
Tested with HY-SRF05
Assuming a room temp of 20 degrees centigrade
The circuit:
* VCC connection of the sensor attached to +5V
* GND connection of the sensor attached to ground
* TRIG connection of the sensor attached to digital pin 12
* ECHO connection of the sensor attached to digital pin 13
*/
const int TRIG_PIN = 12;
const int ECHO_PIN = 13;
void setup() {
// initialize serial communication:
Serial.begin(9600);
pinMode(TRIG_PIN,OUTPUT);
pinMode(ECHO_PIN,INPUT);
}
void loop()
{
long duration, distanceCm, distanceIn;
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
duration = pulseIn(ECHO_PIN,HIGH);
// convert the time into a distance
distanceCm = duration / 29.1 / 2 ;
distanceIn = duration / 74 / 2;
if (distanceCm <= 0){
Serial.println("Out of range");
}
else {
Serial.print(distanceIn);
Serial.print("in, ");
Serial.print(distanceCm);
Serial.print("cm");
Serial.println();
}
delay(1000);
}
Additional Resources:
- Resource 1 (PDF Download Available)
- Resource 2
- Resource 3: PDF Download Available
| Light Packet | |
| Package Type | Light Packet |
SRF05 Ultrasonic Range Sensor
- Product Code: SRF05
- Availability: In Stock
- Light Packet Shipping Eligible
-
$2.15 USD
-
- 75 or more $2.10 USD
Related Products
Mini Limit Switch Model RME8166
Mini Limit Switch RME8166 The RME 8166 Limit Switch is used for controlling machinery as part ..
$9.90 USD
Water Flow Sensor YF-S401
Water flow sensor consists of a plastic valve body, a water rotor, and a hall effect sensor - when w..
$5.90 USD
DHT22 / AM2302 Sensor
DHT22 Digital Temperature and Humidity Sensor Accurate Digitial Measurements The DHT22 is an a..
$5.80 USD
Temperature Thermostat Switch
Widely used for temperature control or protection for household electric appliances. It is open unti..
$1.00 USD
AM2320 Sensor
AM2320 Temperature and Humidity Sensor Highly Accurate I2C Temperature and Humidity Readings The A..
$4.20 USD
BME680 Digital Sensor
BME680 Temperature, Humidity, and Pressure Sensor Ultra-Small Accurate Digital Measurements Th..
$6.00 USD








