You are on page 1of 6

14th IFAC Conference on Programmable Devices and Embedded

Systems Available
14th IFAC Conference on Programmable online
Devices at www.sciencedirect.com
and Embedded
14th IFAC5-7,
October
Systems Conference onCzech
2016. Brno, Programmable
Republic Devices and Embedded
Systems
October 5-7, 2016. Brno, Czech Republic
October 5-7, 2016. Brno, Czech Republic ScienceDirect
IFAC-PapersOnLine 49-25 (2016) 153–158
Distance Measuring by Ultrasonic Sensor
Distance Measuring by
Distance Measuring by Ultrasonic
Ultrasonic Sensor
Sensor
L. Koval*. J. Vaňuš**. P. Bilík***
L. Koval*. J. Vaňuš**.
 P. Bilík***
L. Koval*. J. Vaňuš**.
 P. Bilík***
*VŠB-TU Ostrava, FEI,
 Ostrava-Poruba
CZ (Tel: *VŠB-TU Ostrava, FEI,
+420-59732-5958; Ostrava-Poruba
e-mail: ludvik.koval@ vsb.cz)
*VŠB-TU Ostrava, FEI, Ostrava-Poruba
CZ (Tel:**VŠB-TU
+420-59732-5958;
Ostrava, e-mail: ludvik.koval@ vsb.cz)
FEI, Ostrava-Poruba
CZ (Tel: +420-59732-5958; e-mail: ludvik.koval@ vsb.cz)
**VŠB-TU
CZ (Tel: Ostrava, FEI,
+420-59732-5856; Ostrava-Poruba
e-mail: jan.vanus@ vsb.cz)
**VŠB-TU Ostrava, FEI, Ostrava-Poruba
CZ (Tel: +420-59732-5856;
***VŠB-TU e-mail:
Ostrava, FEI, jan.vanus@ vsb.cz)
Ostrava-Poruba
CZ (Tel: +420-59732-5856; e-mail: jan.vanus@ vsb.cz)
***VŠB-TU Ostrava, FEI, Ostrava-Poruba
CZ (Tel: +420-59732-5955; e-mail: petr.bilik@ vsb.cz).
***VŠB-TU Ostrava, FEI, Ostrava-Poruba
CZ (Tel: +420-59732-5955; e-mail: petr.bilik@ vsb.cz).
CZ (Tel: +420-59732-5955; e-mail: petr.bilik@ vsb.cz).
Abstract: This presentation deals with the verification of the accuracy of measurement distance ultrasonic
Abstract: Thiscurrent
sensor in the presentation deals with
environment. As the verificationsensor
a measuring of the accuracy
chosenof measurement distance by
ultrasonic
an I2C
Abstract: This presentation deals with the verification of thewas accuracy ofSFR08 type equipped
measurement distance ultrasonic
sensor in the current
communication interfaceenvironment.
which allowsAs a measuringThis sensor was itchosen
simple SFR08
to createtype equipped an I2C
by Control
sensor in the current environment. Asaddressing.
a measuring fact makes
sensor was chosen SFR08 the sensor
type array.
equipped by an I2C
communication
and interface
also visualization whichwas
system allows
PC addressing. This fact makes card
based. As communication it simple
was to create
used NI the
USBsensor
8451.array.
The Control
goal of
communication interface which allows addressing. This fact makes it simple to create the sensor array. Control
and also visualization
verification measurementssystem
waswas
to PC based.
determine As
the communication
actual sensor card
accuracywas used NI
especially USB
when 8451. The goal
measuring of
longer
and also visualization system was PC based. As communication card was used NI USB 8451. The goal of
verificationWhen
distances. measurements
evaluating was to determine
the accuracy thesensor
of the actual sensor accuracy inespecially when measuring longer
verification measurements was to determine the actualwas not included
sensor temperature
accuracy especially compensation
when of the
measuring longer
distances. data.
measured When evaluating the accuracy of the sensor was not included in temperature compensation of the
distances. When evaluating the accuracy of the sensor was not included in temperature compensation of the
measured data.
© 2016, IFAC
measured data.(International Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved.
Keywords: Ultrasonic sensors, I2C communication interface, virtual instrument
Keywords: Ultrasonic sensors, I2C communication interface, virtual instrument
Keywords: Ultrasonic sensors, I2C communication interface, virtual instrument

According to the use the ultrasound can be divided into two


1. INTRODUCTION According to the use the ultrasound can be divided into two
groups:
1. INTRODUCTION According to the use the ultrasound can be divided into two
Ultrasonic sensors 1. areINTRODUCTION
often used in automation tasks to groups: ultrasound, when applied exhibits physical or
Active
groups:
Ultrasonic
measure sensorsposition
distance, are often used level
changes, in automation
measurement, taskssuchto Active ultrasound,
chemical when applied
effects. The generated exhibits higher
output reaches physical or
values.
Ultrasonic sensors are often used in automation tasks to Active ultrasound, when applied exhibits physical or
measure
as distance,
presence detectors position
or in changes, level measurement,
special applications, for example,such chemical
The effects.is The
ultrasound usedgenerated output
for cleaning, reachesdrilling
welding, higher and
values.
the
measure distance, position changes, level measurement, such chemical effects. The generated output reaches higher values.
as presence
when detectors
measuring or in special
the purity applications,
of transparent for example,
material. They are The ultrasound is used for cleaning, welding, drilling and the
like.
as presence detectors or in special applications, for example, The ultrasound is used for cleaning, welding, drilling and the
when measuring
based on the principlethe purity of transparent
of measuring material. They
the propagation timeareof like.
Passive ultrasound output is contrast generated at much
when measuring the purity of transparent material. They are like.
based on the
ultrasonic principle
waves. This of measuring
principle the propagation
ensures time of
reliable detection is Passive
lower (usually small) output
ultrasound values. isHiscontrast generated
main area at much
of application is
based on the principle of measuring the propagation time of Passive ultrasound output is contrast generated at much
ultrasonic waves.
independent of theThis principle
color ensures
rendering of thereliable
objectdetection
or to the is lower (usually small)
then measuring values.
distance, His main
detecting area in
defects of materials
applicationand
is
ultrasonic waves. This principle ensures reliable detection is lower (usually small) values. His main area of application is
independent
design and the of type
the color
of its rendering
surface. Itofisthe objecttoorreliably
possible to the then measuring distance, detecting defects in
thickness of the materials, measuring the flow of liquidsmaterials and
independent of the color rendering of the object or to the then measuring distance, detecting defects in materials and
design
detect andeventhesuchtype materials
of its surface. It is possible
as liquids, bulk tomaterials,
reliably thickness
gases and of thediagnostics
also materials, in
measuring the flow of liquids and
healthcare.
design and the type of its surface. It is possible to reliably thickness of the materials, measuring the flow of liquids and
detect evenobjects,
transparent such glassmaterials as liquids,
etc. Another argumentbulkformaterials,
their use gases and
Speed also diagnostics
of sound in healthcare.
is dependent on the type of environment in
detect even such materials as liquids, bulk materials, gases and also diagnostics in healthcare.
transparent
is them using objects, glass etc. Another
in aggressive argument
environments, notfor theirgreat
very use Speed ofit sound
which moves, is dependent
and the on the type
current of environment
temperature in
of the
transparent objects, glass etc. Another argument for their use Speed of sound is dependent on the type of environment in
is them using
sensitivity in aggressive
to dirt and also the environments,
possibility ofnotmeasuring
very greata which it moves,
environment. Velocityandof sound
the current
in sometemperature of the
materials is showed
is them using in aggressive environments, not very great which it moves, and the current temperature of the
sensitivity Ultrasonic
distance. to dirt andsensorsalso thearepossibility
manufacturedof measuring
in manya environment.
in Table 1. Velocity of sound in some materials is showed
sensitivity to dirt and also the possibility of measuring a environment. Velocity of sound in some materials is showed
distance. Ultrasonic
mechanical designs. For sensors are manufactured
laboratory use, the simpleinhousing many in Table 1.
distance. Ultrasonic sensors are manufactured in many in Table 1.
mechanical
used designs. For
for transmitter and laboratory use, the simple
receiver separately or in ahousing
single
mechanical designs. For laboratory use, the simple housing Table 1. The speed of sound propagation in materials
used for for
housing, transmitter
industrialand use receiver
are oftenseparately
constructed orrobust
in a single
metal
used for transmitter and receiver separately or in a single Table 1. The speed of sound propagation in materials
housing,
housing. Some types allow you to adjust the sensitivity metal
for industrial use are often constructed robust using TableGases
1. The speed of sound Solidspropagation inLiquids
materials
housing, for industrial use are often constructed robust metal
ahousing. Some types
potentiometer allow you
or digitally. to adjust
Also, the sensitivity
the output may be in using
the Gases
(m/s) Solids
(m/s) Liquids
(m/s)
housing. Some types allow you to adjust the sensitivity using Gases Solids Liquids
a potentiometer
unified version ororthe digitally. Also, directly
analog signal the output may be
in digital in the
form. In (m/s) 331
a potentiometer or digitally. Also, the output may be in the
unified version Air (0°C)
(m/s) Al (m/s) (m/s)
(m/s) 5100 Water(m/s) 1481
the case of or the analog
sensors that signal
can directly in digital via
be connected form.theIn
unified version or the analog signal directly in digital form. In Air (0°C) 331 Al 5100 Water
(20°C) 1481
the case of sensors
communication interfacethat can PC,
to the be itconnected
is possibleviato the set Air (0°C) 331 Al 5100 Water 1481
the case of sensors that can be connected via the Air (20) 343 Steel (20°C)
5000 Water 1497
communication
detailed parameters interface
of all tothethe PC, itoperating
sensor's is possible
range to and
set (20°C)
communication interface to the PC, it is possible to set Air (20) 343 Steel 5000 Water
(25°C) 1497
detailed parameters
measured distances. of all the sensor's operating range and Air (20) 343 Steel 5000 Water 1497
detailed parameters of all the sensor's operating range and He 965 (25°C)
Concrete 1700 Gasoline 1170
measured distances. (25°C)
measured distances. He
(25°C) 965 Concrete 1700 Gasoline (20°C) 1170
He 965 Concrete 1700 Gasoline 1170
2. ULTRASONIC MEASUREMANTS (25°C)
H (25°C) 1284 Cu 3500 Hg (20°C) 1450
2. ULTRASONIC MEASUREMANTS (25°C) (20°C)
H (25°C) 1284 Cu 3500 Hg (25°C) 1450
Ultrasound 2.has ULTRASONIC MEASUREMANTS
similar propagation characteristics in the H (25°C) 1284 Cu 3500 Hg 1450
Ultrasound has similar sound.
propagation He – Helium (25°C)
Cu – Cuprum
environment as audible This ischaracteristics in the
mechanical vibration (25°C)
Ultrasound has similar propagation characteristics in the He––Hydrogen
H Helium Cu –- Quicksilver
Hg Cuprum
environment
particle as audibleUltrasound
environment. sound. Thispropagation
is mechanical mayvibration
be in He – Helium Cu – Cuprum
environment as audible sound. This is mechanical vibration H ––Hydrogen
Al Aluminium Hg - Quicksilver
particle environment.
gaseous, liquid and solids. Ultrasound
For propagation
ultrasound ismay be in
generally H – Hydrogen Hg - Quicksilver
particle environment. Ultrasound propagation may be in Al – Aluminium
gaseous, as
regarded liquid
a soundand of solids. For ultrasound
a frequency is generally
higher than 20 kHz. Al – Aluminium
gaseous, liquid and solids. For ultrasound is generally
regarded as a sound of a frequency higher than 20 kHz.
regarded as a sound of a frequency higher than 20 kHz.
2405-8963 © 2016, IFAC (International Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved.
Peer review©under
Copyright responsibility of International Federation of Automatic
2016 IFAC 153Control.
10.1016/j.ifacol.2016.12.026
Copyright © 2016 IFAC 153
Copyright © 2016 IFAC 153
2016 IFAC PDES
154
October 5-7, 2016. Brno, Czech Republic L. Koval et al. / IFAC-PapersOnLine 49-25 (2016) 153–158

2.1 Ultrasonic sensors

Ultrasonic sensors operate on the principle of measuring the


time between sending usually a few very short pulses and
receiving the reflection of the transmitted signal. The basic
building blocks are the transmitter and receiver. Transmitter
block may be composed of two types of transducer:
Magnetostrictive transducers - are working at low
frequencies and their principle is based on a mechanical Fig. 2. Sensor SRF08
change in the length of magnetic material.
The list of sensor SRF08 registers is in the following table.
Piezoelectric transducers - operate at high frequencies and
The first registers allow only write (0-2), others read and
the principle is based on the inverse piezoelectric effect.
write. SFR08 has a total of 36 registers.
Ultrasonic receiver is based on the principle of the transfer of
mechanical waves reflected back to an electrical signal. Table 2. SRF08 registers
Address Reading Writing
0 Revision SW Command Registry
1 Lighting Gain
2 1. echo MSB Range
3 1. echo LSB
~~~ ~~~ ~~~
34 17. echo MSB
Fig. 1. Block diagram of the ultrasonic sensor
35 17. echo LSB
2.2 Ultrasonic sensor SRF08
2.4 Addressing the sensor and measurement
Ultrasonic sensor SRF08 is sometimes also called as sonar. It
is an ultrasonic obstacle detector. It is able to measure the The measuring process begins by writing the contents of 80
distance up to 11 m. The principle of measurement of the to 82 in the command register. According to the content of
sensor is the ultrasonic signal on the eighth periods and a the measured value in the appropriate unit (inch, cm, s). In
frequency of 40 kHz. Sonar measures the time between the case of an artificial neural network (ANN) it is necessary
sending the test signal and the receiving of its reflection. to specify one of the commands 83 to 85, which will be the
Measured values (individual reflections) are stored up to 16 same as in the measurement mode, in one of the formats of
registers from which data can then be read master system. units belonging to a given command. Change of address of
From this principle it follows one of the biggest advantages the sensor can be done by writing values from 160 to 170 to
of this sensor - possibility of measuring objects only at the command register in the following table.
desired distances. The sensor communicates via I 2C bus. This
fact allows you addressing of the sensor and also create Table 3. Measuring and addressing SRF08
sensor arrays. In addition to changing the base address, which
Command
is set in production, the sensor enables the selection of units Description
and output variables measuring ambient light. Sonar is also Dec. Hex.
suitable for use in neural networks. 80 50 Measuring (inch)
2.3 Basic features of the sensor SRF08 81 51 Measuring (cm)
82 52 Measuring (m)
Power supply voltage: 5 V DC
Current consumption: 12 mA – measuring, 3 mA - waiting 83 53 ANN mode (inch)
Frequency: 40 kHz 84 54 ANN mode (cm)
Measuring range: 43mm - 11000 mm
Communication bus: I2C 85 55 ANN mode (m)
Base address: 0xE0 (adjustable 16 addresses) 160 A0 Address 1. Byte
Metering Mode: multiple echo, recording up to 17 early
reflections 165 A5 Address 3. Byte
Unit: inch, cm, microsecond 170 AA Address 2. Byte
Dimensions: 43x20x17 mm

At the start of each measurement registers are reset and


measurement reading from registers is decimal value 255
(0xFF). Recommended time while waiting for the completion

154
2016 IFAC PDES
October 5-7, 2016. Brno, Czech Republic L. Koval et al. / IFAC-PapersOnLine 49-25 (2016) 153–158 155

of the measurement is 65 ms. The first echo sonar captured Data SDA and SCL clock signals are bidirectional data lines.
after the completion of measurement is located at address 2 Signals are fixed to a logic HIGH level via pull-up resistor
(MSB) and address 3 (LSB), the second echo is at address 4 connected to the positive supply voltage. The outputs of all
and address 5, etc. Each measurement is also updated light devices connected to the I2C bus must be open collector type,
sensor, which is located at the address 1 Advantage of the so that it can be implemented logical function AND. [2]
record more reflection is the ability to detect more than one The speed of communication on the bus may be different in
object in the measured distance. Reading the measured values order to be connected to the bus also the slower device. One
is possible after 65 ms, as mentioned above, or by reading the of the limitation is also applied - the higher transmission rate
contents of registers. If the read value  255, it is a - the shorter maximum length of the bus. This limitation is
measurement result. due to the increase in parasitic capacitance conductor SDA
When you need to change the measuring range do this by and SCL at high wire lengths. [2]
changing the values in the register at address 0x2. A value of By default the communications bus speed is 100kbit/s
0x0 represents a distance of 43 mm, and the value 0xFF (Standard Mode) in other modes is the communication speed
represents a distance of 11 m. Dependence register values higher: Fast Mode - 400kbit/s, Fast Mode Plus 1Mbit/s, High
and the range contains the following formula: Speed Mode - 3,4Mbit/s. The highest baud rate (Ultra Fast
Mode) is 5Mbit/s. In this mode is no longer possible
𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅 = [(𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅 2).43] + 43 (𝑚𝑚𝑚𝑚) (1) bidirectional transmission of conductors. [2]
Due to the connection of various devices operating at
The basic sensor address is 0xE0. It can be changed to one of different voltage levels on the I2C bus is not fixed level logic
the other 16 addresses (0xE0, 0xE2, 0xE4, 0xE6, 0xE8, 0 (LOW) and logic 1 (HIGH). Their value is the percentage
0xEA, 0xEC, 0xEE, 0xF0, 0xF2, 0xF4, 0xF6, 0xF8, 0xFA, derived from the supply voltage: VIL=0,3VCC a VIH=0,7 VCC.
0xFC, 0xFE). Said addresses can be used in case of [2]
communication over the I2C bus with multiple sensors.
Another possibility is the address 0x00. Using this address, 3.1 Communication protocol
you can write data to all connected sensors on the bus.
To change the I2C address on the bus must be connected to Beginning each I2C bus communication is started by start bit
only one sensor. For a change of address must be entered and terminated by stop bit. The beginning of communication
series of three consecutive commands (0xA0, 0xAA, 0xA5) is defined by changing the logic level H to L level of signal
which need to be reversed their order. As the fourth SDA, while SCL signal is at a logical level H. Ending
command is then registered a new sensor address. This communication is defined as the change of logic level L to
sequence must be written with the address 0x00. In the case the level H signal SDA when signal SCL is also at the logical
of ignorance of the new address of the sensor it is possible to level H.
deduce the number of LED blinks so that after connecting
with a long LED lights, followed by a sequence of short
flashes. The resulting address in decimal form can be
calculated by the following formula:

𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴 = 2. 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑜𝑜𝑜𝑜 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓ℎ𝑒𝑒𝑒𝑒 + 224 (𝐷𝐷𝐷𝐷𝐷𝐷. ) (2) Fig. 3. Start and stop bits in the communication.

To change or discovery addresses must take place no Start and Stop the conditions of communication always
operation is reading or writing. generates Master. The bus is considered busy, when Start
condition. Conversely, the bus is considered free, when Stop
condition. The bus stays busy in case of generating Restart
3. COMMUNICATION WITH THE SENSOR condition instead a Stop condition. In this connection are
The entire communication system with sensor consists of a Start and Restart considered identical.
PC and of universal communication card NI USB-8451, Detection of Start and Stop conditions is very simple if a
which offers two interfaces SPI, and I2C. To communicate device connected to the bus, have the appropriate hardware.
with the sensor has been selected I2C interface. However microcontrollers without this equipment must check
I2C is a two-wire serial bus. One signal SDA is intended for the status of the bus at least 2 times/ period clock signal. [2]
data transmission and the second signal SCL is intended for Number of transmitted bytes when communication is not
synchronization of transmission. Every device connected to limited, however each byte transmitted on SDA must have
the bus has a 7 or 10 bit unique address which is set at the eight bits. Each transmitted byte must be followed by
factory. It is used to select a device. Each device must have a Acknowledge bit. Bit with the highest value (MSB) is sent
different address. On the bus can be connected device as the first. If the Slave is unable for any reason to receive or
master, slave and also the device as the Master / Slave. The transmit data (internal interrupt operation) can hold the SCL
bus is a Multi - Master means that to the bus can be wire on level L and thus to delay transmitting until it is ready.
connected to more than one master. Bus also has a facility for If the Slave can receive data, releases the SCL on L level and
detecting a collision during the transmission of multiple the data transfer can proceed. [2]
devices at the same time. [2]

155
2016 IFAC PDES
156
October 5-7, 2016. Brno, Czech Republic L. Koval et al. / IFAC-PapersOnLine 49-25 (2016) 153–158

1 17
2 18
3 19
Acknowledge Acknowledge 4 20
5 21
6 22
7 23
Start/ Stop/ 8 24
Restart Byte Complete, Releasing state L Repeated 9 NI-8451 25
10 26
SLAVE, state L SLAVE Stop 11 27
12 28 +5V
13 I2C SDA 29 R1 R2 SDA
C1 C2 SCL SFR08
Fig. 4. The Byte transmission via bus 14
15
I2C SCL
+5V
30
31
2k2 2k2
100F 100nF NC
16 GND 32 GND

3.2 NI USB-8451 card


Fig. 6. Sensor and NI USB-8451 card connection
The NI USB 8451 card is a high-speed (12Mb/s) USB 2.0
card. The card can connect to I2C and SPI buses, and also
includes a universal DI/O ports. The card supports
communication speed for I2C bus from 32kHz to 250kHz and 4. SENSOR MEASUREMENT APLICATION
for the SPI bus from 48kHz to 12MHz. [1] Start

Initialize

Parameters No
change?

Fig. 5. NI USB-8451card
Yes
The basic parameters of the NI USB-8451:
Power: USB (4.1 V to 5.25 V DC, max. 500 mA) Parameters
change
Number of pins: 32
Connection ports: Terminal
Dimensions: 8.18 cm x 8.51 cm x 2.31 cm (including Start
terminals)
Table 4. NI USB-8451connection
Wait
Signal Type Description
SPI CS output Chip Select
<0…7> Read
SPI MOSI output Master Output Slave Input
(SDO) for communication to Slave
SPI MISO output Master Input Slave Output
No
(SDI) for communication to Slave
SPI CLK output CLK signal Stop?
I2C SDA OC * Data on I2C Bus
2
I C SCL OC * CLK on I2C Bus
Yes
P <0…7> I/O General I/O
+5V output Power Voltage - USB Stop
GND Signal Ground
NC Not connected Fig. 7. Flowchart
* OC – open collector output
The application is developed in LabVIEW graphical
programming environment. For users has been created a
3.3 Communication scheme
graphical interface that allows you to specify the
The ultrasonic sensor is connected via I2C bus. There are 2 measurement, read the results and make adjustments as
pull - up resistors connected to power voltage. They are used needed.
to adjust the H logical level in the idle state of the bus. The application has an initialization part into which is made a
Furthermore on a plate are connected also two capacitors C, card selection and setting the voltage levels for
which stabilize the supply voltage at higher current communication. Another part is formed by a loop, which
consumption of the sensor during measurement. performs repeated communication with the sensor. Between
the start of measurement and reading of data must be loaded
waiting for the sensor to finish the measurement. This

156
2016 IFAC PDES
October 5-7, 2016. Brno, Czech Republic L. Koval et al. / IFAC-PapersOnLine 49-25 (2016) 153–158 157

waiting time was set to 100ms (65ms minimal). The Table 6. Up to 3m measuring
following flowchart illustrates measuring algorithm.
lM lS S M S CLK tp
5. VERIFICATION OF APPLICATION (cm) (cm) (cm) (mm) (cm) ()
Practical measurement was carried out for different distances 1 137 136,5 -0,5 ±0,7 ±0,57
up to a maximum distance of 750 cm in order to determine 2 156 155 -1 ±0,7 ±1,07
the measurement accuracy of the sensor. Further it also has
been verified a directional sensor characteristics. 3 174 173 -1 ±0,7 ±1,07
0,5
4 210,2 210 -0,2 ±0,9 ±0,29 (0,46)
5.1 Verification of the accuracy of distance
measurement 5 240,3 239 -1,3 ±0,9 ±1,39
6 284,5 284 -0,5 ±0,9 ±0,59
The first was realized to verify the accuracy distance
measurement, which was divided into 3 parts. In the first part
the distance up to 300 cm, and subsequently the distance up Where: lM distance measured by the tape-meter
to 600 cm, and finally the distance up to 750 cm. lS distance measured by the sensor
S sensor error
5.2 Method of Measurement M tape-meter error
S CLK total error (including error tape-meter)
The sensor was placed on the stand in a vertical position so tp sensor accuracy class
that it faces toward the ceiling. Such a location was chosen
because of possible reflections from other objects in space Total error ultrasonic sensor was calculated as the maximum
and easier identification of measured objects. deviation relative to the range of 3 m:
3m distance measuring by ultrasonic sensor took place in the
laboratory. Measurement procedure consisted in gradually max(|∆𝑆𝑆 |+|∆𝑀𝑀 |)
increasing the distance between the sensor and the ceiling ∆𝑆𝑆 𝐶𝐶𝐶𝐶𝐶𝐶 = ± . 100 (%) (4)
300
using adjustable height tripod. Sensor measured distance was
always checked using tape-measure to determine the 5.1 The measurement results up to 6m
reference distance. The accuracy of the reference meter was
in class II according to EG (notice MPO no. 339/2000 Sb). Procedure for distance measurement in the range of 6m was
Accuracy is given by the formula: carried out similarly as in the previous case. As the
corresponding room was chosen classroom with the required
∆= (0.3 + 0.2𝑙𝑙) (𝑚𝑚𝑚𝑚) (3) parameters classroom ceiling height (see Table 7).
As the last measurement was performed measurement over a
Where  measurement error
l gauge length range of 6m. This measurement was carried out in the
entrance hall of the FEI, VSB-TU Ostrava. There was again
the required parameters of the ceiling (see Table 8).
The following table shows the maximum error meter for each Calculations class sensor accuracy in both cases were the
measured distance: same as in the case of determining the accuracy class for
basic sensor measuring range distances up to 3m.
Table 5. Measurement errors using a tape - measure
Table 7. Up to 6m measuring
Error limits according to EG II (mm)
lM lS S M S CLK tp
1m 2m 3m 5m 8m 10m
(cm) (cm) (cm) (mm) (cm) ()
±0,5 ±0,7 ±0,9 ±1,3 ±1,9 ±2,3 1 396 395 -1,00 ±1,3 ±1,13
2 422,8 425 2,20 ±1,3 ±2,33
5.3 The measurement results up to 3m
3 452,4 455 2,60 ±1,3 ±2,73
In the results table are measured values as their own meter
4 487,5 485 -2,50 ±1,3 ±2,63
length (measuring tape) and ultrasonic sensor is evaluated
and eventually total measurement error. In the column on the 5 517,5 515 -2,50 ±1,9 ±2,69 0,7
sensor accuracy tp is also included precision instrument, (0,62)
6 546,3 545 -1,30 ±1,9 ±1,49
which was verified by the ultrasonic sensor.
7 578,5 575 -3,50 ±1,9 ±3,69
8 607,5 605 -2,50 ±1,9 ±2,69
9 635 635 0,00 ±1,9 ±0,19

157
2016 IFAC PDES
158
October 5-7, 2016. Brno, Czech Republic L. Koval et al. / IFAC-PapersOnLine 49-25 (2016) 153–158

Table 8. over 6m measuring Table 9. Beam angle measurement


lM lS S M S CLK tp Direction lS (cm) lM (cm) l (cm)  S ()  M ()
(cm) (cm) (cm) (mm) (cm) ()
left 150 149 132 27,6 28,4
1 733 730 3,0 ±1,9 ±3,19 0,4*
(0,38) right 150 149 132 27,6 28,4
* Range setting XR=8m
front 149 147 130,5 27,4 29,9
behind 149 147 130,5 27,4 29,9
6. DIRECTIONAL CHARACTERISTICS
S CLK () 55,0 58,3
According to the manufacturer's data sheets ultrasonic sensor
transducers makes beam angle of 55 °. The figure below
shows the radiation pattern of the sensor in polar coordinates. Where: lM distance measured by the tape-meter
To test this characteristic were taken only one point. Due to lS distance measured by the sensor
simple realization of this experiment was chosen measured l height boards
distance 150 cm. S the angle of the sensor data
M the angle of the tape-meter
S CLK angle overall

7. CONCLUSIONS
We can see from practical measurements [5] that the
ultrasonic sensor measures the distance with high accuracy.
In measurements distances up to 3m was accuracy class 0.5
, in case measurements distances up to 6m was accuracy class
0.7 and in case measurements distances over 6 meters the
accuracy class was even 0.4. The accuracy of the sensor
was in all cases related to the measurement range (including
the accuracy of the tape-meter). Manufacturer of the sensor
Fig. 8. Directional characteristics SRF08 indicates the maximum measurement error 3-4 cm in his data
Above the sensor was placed the path in along which was sheets. This accuracy was confirmed with reserve. When
displaced the plate (24 x 39 cm). The plate was moved in the verifying the directional characteristics the object was
four directions in the plane until was captured by sensor. detected approximately at the same angle, as determined by
Subsequently, from the known distance location above the the manufacturer. All measurements were realized
sensor plate and the length of the measured hypotenuse of the approximately under the same conditions (temperature T =
triangle was calculated angle. Measurements were performed 23C).
in two axes (in the plane of the four sides).
REFERENCES

1 NATIONAL INSTRUMENTS. NI-845x (2005) Software


User Manual: I2C/SPI [online]. Available from:
http://www.ni.com/pdf/manuals/371746a.pdf
2 NXP Semiconductors. I2C-bus specification and user
manual Available from:
http://www.nxp.com/documents/user_manual/UM10204.
pdf
3 DEVANTECH Ltd (Robot Electronics).SRF08 Ultra
sonic range finder. Available from:
http://www.cs.york.ac.uk/micromouse/Docs/SRF08Ultra
Fig. 9. Directional characteristics verification SonicRanger.pdf
4 ROBOT STORE (HK). SRF08 – Ultrasonic range finger
Beam angle was confirmed with great conformity with the – datasheet. Available from:
manufacturer. Measured values in the following table: http://www.robotstorehk.com/srf08tech.pdf
5 VALA, D., SLANINA, Z., WALENDZIUK, W. Mining
Shaft Inspection by Laser Photogrammetry. Elektronika
Ir Elektrotechnika, Vol. 22, Issue 1, 2016. ISSN 1392-
1215.

158

You might also like