SRF10 Ultra sonic range finder (2024)

SRF10Ultrasonic range finder
Technical Specification

Communication with the SRF10 ultrasonic rangefinder is via theI2C bus. This is available on popular controllers such as the OOPic and StampBS2p, as well as a wide variety of micro-controllers. To the programmer the SRF10behaves in the same way as the ubiquitous 24xx series eeprom's, exceptthat the I2C address is different. The default shipped address of the SRF10 is0xE0. It can be changed by the user to any of 16 addresses E0, E2, E4, E6, E8,EA, EC, EE, F0, F2, F4, F6, F8, FA, FC or FE, therefore up to 16 sonar's can beused.

Connections
The connections to the SRF10 are identical to the SRF08. The "Do Not Connect" pin should be left unconnected. It isactually the CPU MCLR line and is used once only in our workshop to program thePIC16F87 on-board after assembly, and has an internal pull-up resistor. The SCL and SDA lines should each have apull-up resistor to +5v somewhere on the I2C bus. You only need one pair ofresistors, not a pair for every module. They are normally located with the busmaster rather than the slaves. The SRF10 is always a slave - never a bus master.If you need them, I recommend 1.8k resistors. Some modules such as the OOPicalready have pull-up resistors and you do not need to add any more.

+5v
SDA
SCL
Do not connect
GND
SRF10 Ultra sonic range finder (1)

Registers
The SRF10 appears as a set of 4 registers.

Location

Read

Write

Software Revision

Command Register

1

Unused (reads 0x80)

Max Gain Register (default 16)

2

Range High Byte

Range Register (default 255)

3

Range Low Byte

N/A

Only locations 0, 1 and 2 can be written to. Location 0 is thecommand register and is used to start a ranging session. It cannot be read.Reading from location 0 returns the SRF10 software revision. By default,the ranging lasts for 65mS, but can be changed by writing to the range registerat location 2. The SRF10 will not respond to commands on the I2C bus whilst itis ranging. See the Changing Range and AnalogueGain sections below.

Locations, 2 and 3, are the 16bit unsigned result from the latest ranging -high byte first. The meaning of this value depends on the command used, and iseither the range in inches, or the range in cm or the flight time in uS. A valueof either 0 or maximum indicates that no objects were detected. Maximum is 65535(0xFFFF) if you are ranging in uS, 1129 for cm and 442 for inches

Commands
The are three commands to initiate a ranging (80 to 82), to return the result in inches, centimeters ormicroseconds. There is also a set of commands to changethe I2C address.

Command Action
Decimal Hex
80 0x50 Ranging Mode - Result in inches
81 0x51 Ranging Mode - Result in centimeters
82 0x52 Ranging Mode - Result in micro-seconds
160 0xA0 1st in sequence to change I2C address
165 0xA5 3rd in sequence to change I2C address
170 0xAA 2nd in sequence to change I2C address

Ranging Mode
To initiate a ranging, write one of the above commands to thecommand register and wait the required amount of time for completion and readthe result. The echo buffer is clearedat the start of each ranging. The default and recommended time for completionof ranging is 65mS, howeveryou can shorten this by writing to the range register before issuing a rangingcommand.

Checking for Completion of Ranging
You do not have to use a timer on your own controller to wait for ranging tofinish. You can take advantage of the fact that the SRF10 will not respond toany I2C activity whilst ranging. Therefore, if you try to read from the SRF10 (we use the software revision number a location 0) then you will get 255 (0xFF)whilst ranging. This is because the I2C data line (SDA) is pulled high ifnothing is driving it. As soon as the ranging is complete the SRF10 will againrespond to the I2C bus, so just keep reading the register until its not 255(0xFF) anymore. You can then read the sonar data. Your controller can takeadvantage of this to perform other tasks while the SRF10 is ranging.

Changing the Range
The maximum range of the SRF10 is set by an internal timer. By default, this is65mS or the equivalent of 11 metres of range. This is much further than the 6 metres theSRF10 is actually capable of. It is possible to reduce the timethe SRF10 listens for an echo, and hence the range, by writing to the rangeregister at location 2. The range register can be set in steps of about 43mm (0.043m or1.68 inches) up to 11 metres.
The range is ((Range Register x 43mm) + 43mm) so setting the Range Register to 0(0x00) gives a maximum range of 43mm. Setting the Range Register to 1 (0x01)gives a maximum range of 86mm. More usefully, 24 (0x18) gives a range of 1 metreand 93 (0x5D) is 4 metres. Setting 255 (0xFF) gives the original 11 metres (255x 43 + 43 is 11008mm). There are two reasons you may wish to reduce the range.
1. To get at the range information quicker
2. To be able to fire the SRF10 at a faster rate.
If you only wish to get at the range information a bit sooner and will continueto fire the SRF10 at 65ms of slower, then all will be well. However if you wishto fire the SRF10 at a faster rate than 65mS, you will definitely need to reducethe gain - see next section.
The range is set to maximum every time the SRF10 is powered-up. If youneed a different range, change it once as part of your system initializationcode.

Analogue Gain
The analogue gain register sets the Maximum gain of the analogue stages.To set the maximum gain, just write one of these values to the gain register at location1. During a ranging, the analogue gain starts off at itsminimum value of 40. This is increased at approx. 96uS intervals up to the maximum gainsetting, set by register 1.Maximum possible gain is reached after about100mm (4inches) of range. Thepurpose of providing a limit to the maximum gain is to allow you to fire thesonar more rapidly than 65mS. Since the ranging can be very short, a new ranging can be initiated as soon asthe previous range data has been read. A potential hazard with this is that thesecond ranging may pick up a distant echo returning from the previous"ping", givea false result of a close by object when there is none. To reduce thispossibility, the maximum gain can be reduced to limit the modules sensitivity tothe weaker distant echo, whilst still able to detect close by objects. Themaximum gain setting is stored only in the CPU's RAM and is initialized tomaximum on power-up, so if you only want do a ranging every 65mS, or longer, youcan ignore the Range and Gain Registers. The Gain Register is set to 16 (a gainof 700) at power-up. This can be decreased as required.

Gain Register Maximum Analogue Gain
Decimal Hex
0 0x00 Set Maximum Analogue Gain to 40
1 0x01 As above - Analogue Gain to 40
2 0x02 Set Maximum Analogue Gain to 50
3 0x03 Set Maximum Analogue Gain to 60
4 0x04 Set Maximum Analogue Gain to 70
5 0x05 Set Maximum Analogue Gain to 80
6 0x06 Set Maximum Analogue Gain to 100
7 0x07 Set Maximum Analogue Gain to 120
8 0x08 Set Maximum Analogue Gain to 140
9 0x09 Set Maximum Analogue Gain to 200
10 0x0A Set Maximum Analogue Gain to 250
11 0x0B Set Maximum Analogue Gain to 300
12 0x0C Set Maximum Analogue Gain to 350
13 0x0D Set Maximum Analogue Gain to 400
14 0x0E Set Maximum Analogue Gain to 500
15 0x0F Set Maximum Analogue Gain to 600
16 0x10 Set Maximum Analogue Gain to 700

Note that the relationship between the Gain Register setting andthe actual gain is not a linear one. Also there is no magic formula to say"use this gain setting with that range setting". It depends on thesize, shape and material of the object and what else is around in the room. Tryplaying with different settings until you get the result you want. If you appearto get false readings, it may be echo's from previous "pings", trygoing back to firing the SRF10 every 65mS or longer (slower).
If you are in any doubt about the Range and Gain Registers, remember they areautomatically set by the SRF10 to their default values when it is powered-up.You can ignore and forget about them and the SRF10 will work fine, detectingobjects up to 6 metres away every 65mS or slower.

LED
The red LED is used to flash out a code for the I2C address on power-up (seebelow). It also gives a brief flash during the "ping" whilst ranging.

Changing the I2C Bus Address
To change the I2C address of the SRF10 you must have only one sonar on the bus.Write the 3 sequence commands in the correct order followed by the address.Example; to change the address of a sonar currently at 0xE0 (the default shippedaddress) to 0xF2, write the following to address 0xE0; (0xA0, 0xAA, 0xA5, 0xF2). These commands must be sent in the correct sequence to change the I2Caddress, additionally, No other command may be issued in the middle of thesequence. The sequence must be sent to the command register at location 0, whichmeans 4 separate write transactions on the I2C bus. When done, you should label the sonar with its address, however if youdo forget, just power it up without sending any commands. The SRF10 will flash*ts address out on the LED. One long flash followed by a number of shorterflashes indicating its address. The flashing is terminated immediately onsending a command the SRF10.

Address Long Flash Short flashes
Decimal Hex
224 E0 1 0
226 E2 1 1
228 E4 1 2
230 E6 1 3
232 E8 1 4
234 EA 1 5
236 EC 1 6
238 EE 1 7
240 F0 1 8
242 F2 1 9
244 F4 1 10
246 F6 1 11
248 F8 1 12
250 FA 1 13
252 FC 1 14
254 FE 1 15

Take care not to set more than one sonar to the same address,there will be a bus collision and very unpredictable results.

Changing beam pattern and beam width
You can't! This is a question which crops up regularly, however there is no easy way to reduce or changethe beam width that I'm aware of. The beam pattern ofthe SRF10 is conical with the width of the beam being a function of the surfacearea of the transducers and is fixed. It is possible to make the sonarless sensitive to objects off to the side by reducing the maximum gain registerfrom 16 to a lower level. This is a the expense of shorter range, however mostsmall robots don't need 6m of range. A value of 8 (max. gain 140) will reducethe practicable range to about 2m, but it will be much less sensitive to objectsoff the center line. The beam pattern of the transducers used onthe SRF10, taken from the manufacturers data sheet, is shown below.

SRF10 Ultra sonic range finder (2)

There is more information in the sonarfaq.

Mounting the SRF10
You may have notice that there are no mounting holes on the SRF10 module!That was deliberate to keep the module as small as possible. So how do you mount it?Here are three suggestions:
1. A straight or right angle 0.1 inch connector soldered to your PCB.
2. Using two 9.5mm rubber grommets. Two holes should be drilled into thepanel you're mounting the SRF10 to. The hole centers should be 0.7inches(17.78mm) apart and the holes drilled 0.5 inches (12.7mm) in diameter. The twogrommets should then be fitted to the panel and the SRF10 gently pushed intothem.
3. Using our SRF10 Mounting Kit, shown below.

SRF10 Ultra sonic range finder (3) SRF10 Ultra sonic range finder (4)
SRF10 Ultra sonic range finder (2024)

FAQs

How accurate is the ultrasonic rangefinder? ›

Accuracy or absolute accuracy is the difference between the measured value output by the ultrasonic sensor and the actual measurement distance. When using ultrasonic proximity switches in industrial work areas from -25 °C to +70 °C, absolute accuracy of 1 % – 3 % is realistic.

How far can ultrasonic detect? ›

They DO NOT measure farther than about 70 feet (21 meters). They DO NOT measure at very high repetition rates. Due to speed of sound limitations the fastest rate is 200 Hz at a max distance of about 24 inches. They DO NOT work as accurately in vapor environments that change the speed of sound from that of air.

How does the ultrasonic range finder work? ›

The Ultrasonic Rangefinder uses sound pulses to measure distance, in a similar way to how bats or submarines find their way around. By emitting an ultrasonic pulse and timing how long it takes to hear an echo, the Ultrasonic Rangefinder can accurately estimate how far away the object is.

How to make an ultrasonic sensor more accurate? ›

How can you optimize the range and accuracy of an ultrasonic sensor system?
  1. Choose the right sensor.
  2. Adjust the sensor parameters.
  3. Design the sensor circuit. ...
  4. Test and calibrate the sensor system. ...
  5. Implement error correction and filtering algorithms. ...
  6. Optimize the sensor placement and orientation. ...
  7. Here's what else to consider.
Nov 7, 2023

Are rangefinders more accurate than GPS? ›

However, if the course you wish to play on is not included on the list of preloaded courses then your GPS band is more or less useless. Laser Rangefinders are much more accurate, most will get you the correct measurement within a yard, some even claim to be accurate to 1/2 or even 1/10 of a yard.

How to increase the range of an ultrasonic sensor? ›

To increase the measuring range with the help of several ultrasonic sensors use the possibility of synchronization or multiplexing of the sensors. In the synchronization mode, all connected sensors send the sound pulse at the same time and also receive it at the same time.

What can ultrasonic sensor not detect? ›

Secondly, ultrasonic sensors may have difficulty detecting objects that are very small or that have irregular surfaces. When the surface of an object is not smooth or regular, the ultrasonic waves may not reflect back to the sensor or may reflect back unpredictably, causing measurement errors.

What is the maximum distance of ultrasonic sensor? ›

Ultrasonic sensor maximum range

Our sensors range from 20cm to our only 16.5m sensor (Our cargo detection sensor). Other sensors have max ranges of 254 inches, 3.5 meters, 5 meters, 7.65 meters, and 10 meters.

Is the ultrasonic range finder digital or analog? ›

These waves, when they bounce back, are converted into electrical signals. Think of it as translating a language you can't hear (ultrasonic waves) into one you can understand (electrical signals). Analog and Digital Capabilities: Many ultrasonic sensors can be both analog and digital.

Can an ultrasonic sensor detect water? ›

They offer several advantages over other detection methods, including accuracy, reliability, and versatility. With their ability to detect water levels, ultrasonic sensors have found a wide range of applications in various industries and continue to be an important technology in water level detection.

What is the frequency of ultrasonic range finder? ›

Ultrasonic transducers operate at frequencies in the range of 30–500 kHz for air-coupled applications. As the ultrasonic frequency increases, the rate of attenuation increases. Thus, low-frequency sensors (30–80 kHz) are more effective for long range, while high-frequency sensors are more effective for short range.

How small object can ultrasonic sensor detect? ›

Conventionally operating ultrasonic sensors send out conical acoustic waves. As a result, their spot size is too big for measuring into openings of less than 10 mm in diameter.

How far can an ultrasonic sensor detect an Arduino? ›

It detects the distance of the closest object in front of the sensor (from 3 cm up to 400 cm). It works by sending out a burst of ultrasound and listening for the echo when it bounces off of an object. It pings the obstacles with ultrasound.

How can I detect ultrasonic sound at home? ›

Ultrasonic sound waves are inaudible to humans, but they can be recorded by microphones. You can use an ultrasonic recorder or a bat detector to record ultrasonic sound. These devices can transform ultrasound signals into sounds that can be heard by humans.

Is ultrasonic height measurement accurate? ›

In a methods-comparison study of 222 children between 2–5 years old in Lao PDR, the One Grows™ ultrasound device showed good levels of precision and accuracy in measuring the height of standing children.

Is ultrasonic testing accurate? ›

Quality ultrasonic thickness gauges can offer highly accurate testing on metals, plastics, and other materials. However, several factors related to the test material, equipment, part geometry, and user skill and care can affect the degree of accuracy achieved in an application.

Is ultrasonic sensor accurate? ›

When the ultrasonic sensor uses pulses at 400 kHz, than the maximium distance is only about 65 cm. With an ultrasonic sensor, an accuracy of up to 1% of the set measuring range can be achieved. This means that an object can be detected with an accuracy of 1 mm at a distance of 10 cm.

How accurate is ultrasonic thickness measurement? ›

With proper calibration, measurements can usually be made to an accuracy of +/- 0.001" or 0.01 mm, and in some cases accuracy can approach 0.0001" or 0.001 mm.

Top Articles
Latest Posts
Article information

Author: Aron Pacocha

Last Updated:

Views: 5321

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.