Product Information

1 Light Sensor
Max Gain Register
(default 31)
2
1st Echo High
Byte
Range Register
(default 255)
3
1st Echo Low
Byte
N/A
~~~~ ~~~~ ~~~~
34
17th Echo
High Byte
N/A
35
17th Echo
Low Byte
N/A
Only locations 0, 1 and 2 can be written to. Location 0 is the command register and is
used to start a ranging session. It cannot be read. Reading from location 0 returns the
SRF08 software revision. By default, the ranging lasts for 65mS, but can be changed by
writing to the range register at location 2. If you do so, then you will likely need to
change the analogue gain by writing to location 1. See the Changing Range and
Analogue Gain sections below.
Location 1 is the onboard light sensor. This data is updated every time a new ranging
command has completed and can be read when range data is read. The next two
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 is either the range in
inches, or the range in cm or the flight time in uS. A value of zero indicates that no
objects were detected. There are up to a further 16 results indicating echo's from more
distant objects.
Commands
The are three commands to initiate a ranging (80 to 82), to return the result in inches,
centimeters or microseconds. There is also an ANN mode (Artificial Neural Network)
mode which is described later and a set of commands to change the I2C address.
Command
Decimal Hex
Action
80 0x50 Ranging Mode - Result in inches
81 0x51 Ranging Mode - Result in centimeters
82 0x52 Ranging Mode - Result in micro-seconds
83 0x53 ANN Mode - Result in inches
84 0x54 ANN Mode - Result in centimeters
85 0x55 ANN Mode - Result in micro-seconds
160 0xA0 1st in sequence to change I2C address
165 0xA5 3rd in sequence to change I2C address