SF20 LiDAR Manual Rev 12-2943502
SF20 LiDAR Manual Rev 12-2943502
Datasheet
Features
• Size: 30 mm x 20 mm x 32 mm
• Weight: 10g
1 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
Table of contents
Overview 3
Specifications 4
Quickstart guide 5
Quickstart guide 7
Communication with a controller 7
Human Machine Interface (HMI) communication with a USB converter cable 8
Graphical User Interface (GUI) mode 10
Servo 11
Alarms 15
Machine Machine Interface (MMI) communication with a Devantech USB to I2C module 17
Safety instructions 19
5.1 Labelling 19
5.2 Laser radiation information 19
Hardware 20
6.1 Powering up the SF20 20
6.2 Dimension drawings 20
6.3 Installation 20
6.4 Communication cable 21
6.5 Pinout diagram for LW20 22
Settings 22
7.1 HMI main menu 22
7.2 HMI servo menu 22
7.3 MMI commands set 23
Revision history 27
Disclaimer
Information found in this document is used entirely at the reader’s own risk and whilst every effort has been
made to ensure its validity, neither LightWare Optoelectronics (Pty) Ltd nor its representatives make any
warranties with respect to the accuracy of the information contained herein.
2 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
1. Overview
The SF20 is a small form factor, OEM LiDAR sensor that measures the distance to objects by timing a laser flash. Accuracy is not
generally affected by the colour or texture of the target surface, nor the angle of incidence of the laser beam. The SF20 is tolerant
to changes in background lighting conditions, wind and noise.
Please note that the SF20 is an open frame device and is sensitive to moisture and electromagnetic interference.
There are two communication interfaces available using a common set of wires:
● A serial port (3.3V logic level) with configurable baud rate to connect to a host controller.
● An I2C serial bus (3.3V logic level and 3.3k pull up resistors) with configurable address as an alternative to the serial port
when multiple devices are connected on a common bus.
The SF20 LiDAR is rated laser Class 1M eye safe. Do not view the laser with magnifying optics such as microscopes,
binoculars or telescopes.
3 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
2. Specifications
Performance
Resolution 1 cm
Accuracy ±10 cm
Connections
Mechanical
Dimensions 30 mm x 20 mm x 32 mm
Optical
Optical aperture 28 mm x 15 mm
Environmental
Accessories
Default settings
Serial port settings 115200 baud, 8 data bits, 1 stop bit, no parity, no handshaking
4 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
3. Quickstart guide
Caution
The SF20 contains a laser and should never be aimed at a person or an animal. Do not look at the beam directly
with optical instruments.
p:SF20,1.7.0,12
● Press the <ESC> keyboard key and the SF20 will display a live data stream - first distance signal, last distance signal,
alarm A status and alarm B status - in the LightWare Terminal application window.
...
2.68 2.68 1 1
2.68 2.68 1 1
2.68 2.68 1 1
...
● Press the <SPACE> key to display the main menu. This menu includes a list of all the settings that can be changed in the
unit:
Once the settings have been entered, your host controller can communicate with the SF20 through the serial or I2C ports. API
support is available from the LightWare A
PI repository.
5 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
Sensors have a resolution of 1 centimeter and the accuracy of each measurement is ±10 centimeter. Laser precise distance
measurements provide the exact height above ground level for multi-copter drones to set off alarms when the ground gets too
close. The SF20 is able to measure the first and last return signals when there is more than one object in the laser beam - objects
must be separated by approximately 5 meters before they are seen as separate return signals. For terrain following applications,
this enables a drone to track the closest tops of trees, and measure the height above ground simultaneously, to get information
about potential collisions.
The SF20 outputs measurements from 48 readings per second, to a maximum of 388 readings per second. The slower reading
rate gives better measuring range for forwards-facing obstacle detection. The faster reading rate is better for scanning
applications. By adding a small digital servo, the SF20 has built-in drivers to enable scanning the area ahead of an autonomous
vehicle, by adding a small digital servo. Ideal for sense-and-avoid navigation, the SF20 can either stream the measured data to the
communication ports for “SLAM(Stop Look Assess and Manage)” mapping, or analysed internally to look for potentially hazardous
alarm conditions.
There are two enclosure options available, the LW20 and the SF20. The LW20 is a sealed waterproof IP67 unit suitable for outdoor
applications. Weighing less than 20 grams (excluding cables), it is ideal for applications where the weight and size are important.
The SF20 is an open frame, 10 gram unit, suitable for OEM applications when low mass is the defining specification. The SF20 is
not waterproof.
The SF20 / LW20 includes serial, I2C and alarm outputs that can be easily connected to a flight controller or a standard processing
platform. Each interface on the SF20 / LW20 can be configured using a simple software menu.
The SF20 / LW20 LiDAR is rated laser Class 1M eye safe. Do not view the laser with magnifying optics such as microscopes and
telescopes.
6 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
4. Quickstart guide
Caution
The SF20 laser rangefinder contains a laser and should never be aimed at a person or an animal. Do not look at
the beam directly with optical instruments.
The SF20 / LW20 is designed to communicate with a host controller. This controller can be a single board computer,
flight controller, PC or laptop.
There are two communications interfaces available, serial and I2C. The SF20 / LW20 will wait for the first command to
confirm which communication mode to select (serial or I2C). The first command will not get a response.
The serial port is a one-to-one protocol that lets a single SF20 / LW20 talk to a single host controller. The serial
interface uses 3.3 V logic to transmit results and receive commands.
Multiple SF20 / LW20’s with an I2C port can be connected onto an I2C bus. The I2C interface uses 3.3 V logic to receive
commands from a master device.
The communication language for both the serial and I2C ports is based on ASCII commands and messages.
Command strings take the form of simple mnemonics and results are provided as text strings.
There are four different directives, each using a single ASCII character:
? Fetch a value
# Write a value
$ Stream live results
% Save changes
?PN<CR><LF>
PN:LW20 <CR><LF>
7 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
4.2. Human Machine Interface (HMI) communication with a USB converter cable
● Download the LightWare Terminal application from www.lightware.co.za onto your PC or laptop. Open the installer
package and follow the installation instructions. Everything needed for communicating with the unit will automatically
be installed.
● Connect the serial port of the SF20 to the USB port on a PC or laptop using a serial UART TTL (3.3 V logic, 5 V power) to
USB adapter such as the TTL-232R-3V3-WE converter cable from FTDI. This will allow for communication and power
supply to the SF20. A red indicator light will show that the unit is powered up.
● Start the LightWare Terminal application and click on the “Settings” icon and set the baud rate to “115200”. Select the
correct “Protocol” for your communication type and the correct USB port. You can tick the “Remember settings” box if
you intend to use this configuration again. Click “Apply” the change to close the dialog window.
● Press the <↑> keyboard key to engage serial communication mode (if you are using an alternative Terminal emulation
program, send the character string <UU>. The SF20 / LW20 will reply with a product code, firmware revision and
hardware revision number.
p:SF20,1.7.0,12
● Press the <ESC> keyboard key and the SF20 / LW20 will display a live data stream - first distance signal, last distance
signal, alarm A status and alarm B status - in the LightWare Terminal application window.
...
2.68 2.68 1 1
2.68 2.68 1 1
2.68 2.68 1 1
...
8 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
● The live data stream displays the first distance signal, last distance signal, alarm A status and alarm B status. The servo
live data stream (if it is attached) displays the aiming angle, first distance signal, last distance signal, alarm A status and
alarm B status.
● Press the <SPACE> key to display the main menu. This menu includes a list of all the settings that can be changed in the
unit:
● To activate a menu item, press the keyboard key relating to that menu. Some of the menu values are numeric, and
others will toggle between the available options. For example, to access the menu item “1: Measurement update rate”
- which toggles through “48 per sec”, “55 per sec”, “64 per sec”, “77 per sec”, “97 per sec”, “129 per sec” and “388 per
sec” as the preferred rate at which distances are measured - press the <1> key. Note that any changes made are stored
immediately in permanent memory, and will remain valid after the power is removed. Information regarding the other
menu items, and how to use them for your application, is contained in the body of this document.
● You can navigate between the main menu and the servo menu (if attached), and between the live data stream, and the
servo live data stream (if attached) using the <→>,<←>,<↓> and <↑> keyboard keys.
● Information regarding the other menu items, and how to use them for your application, is contained in the body of this
document.
● To exit the menu, press the <SPACE> key and the unit will resume taking distance measurements.
● Pressing the “Save” icon to save the information currently displayed on the Terminal, the information is saved as a txt
file..
● Pressing the “Log” icon allows the user to log the live streamed data either as a txt file or as a csv file.
● Pressing the “Clear” icon clears the workspace in Terminal.
● Under the “Settings’ icon, the Serial Port, Baud Rate and Communication protocol can be selected.
● The “LW20” icon is explained in the next section (4.2).
● You can use this feature with the SF20 series as they are the same model, the LW 20 units are IP67 rated.
● The “Drone” icon is still an experimental feature that allows one to upload pixhawk settings directly to pixhawk.
● The “I2C Tester” icon will be explained in section (4.5).
9 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
● Connect your SF20 to a PC or laptop as detailed in section “4.2 Human Machine Interface (HMI) communication with a
USB converter cable”
● Start the LightWare Terminal application and click the “Connect” icon to open a communications port.
● Click the “LW20” icon to open the GUI home screen. There are four tabs at the top of the home screen. Each one
provides a visualization of the settings inside the SF20 / LW20 and guides you through the setup process as follows:
● The “Home” tab shows the welcome screen with shortcuts to other screens.
● The “Setup” tab is for checking or entering settings with graphical indicators showing the effect of any changes. The
“Setup” tab is divided into three functional areas. On the left there are four buttons that group related settings
together. In the middle column the names and values of each setting are shown in editable boxes. On the right of the
screen there is a graphic visualizing the group of settings.
● The “Parameters” tab gives a tabulated summary of all the settings. The “Parameters” tab gives a summary of all the
available settings, grouped into columns to match the buttons on the “Setup” tab. This tab is useful to users who are
familiar with the effects of each setting and know what values to enter for their application.
10 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
● The “Operate” tab is a graphical display that shows the LW20 working with the settings that you have entered, it shows
a graphic that can be used for display purposes. Different elements can be added or removed from the image using the
tick boxes and the view can be changed to represent either single point distance measurement or two dimensional
LiDAR scanning.
● Note that any settings changes are not automatically saved. The “Save” button must be pressed if you want to keep the
changes. The graphics can be manipulated to alter their position and angle of view using the left and right mouse keys.
There is a scale slider in the top right hand corner along with icons to return to the default isometric view or change to a
view from above.
4.4. Servo
The SF20 can be converted into a scanning LiDAR by attaching it to a digital servo and using the built-in servo driver
hardware and software. The LiDAR data can be streamed live or used to activate two internal alarms. This makes a
useful SLAM mapping device or a collision sensor.
The servo driver works with most standard digital servos. Note that analog servos are not compatible as they
respond too slowly to the control signals produced by the SF20. The SF20 is connected to the servo as shown in the
diagram below:
11 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
Servo connections
To reduce the chances of power supply spikes affecting the performance of the SF20, it is important to run the servo
from a separate power supply. Check the servo specifications for the correct voltage and current ratings and make
sure that there is a common connection to the negative rails of the SF20 and servo power supplies.
Communications to the SF20 and the servo can be made through either the serial port or via an I2C bus. In this guide
we will use the serial port and the GUI interface to set up the servo parameters and configure automatic scanning.
Start the LightWare Terminal application and click the “Connect” icon to open a communications port. Click the
“LW20” icon to open the GUI home screen. Select the ”Servo” button under the “Setup” tab to access the initial servo
configuration graphic.
With the SF20 connected to the GUI, settings can be entered and saved even without the servo attached. This is
useful if you already know what values to enter for your chosen servo. If the servo is connected, then ticking the
“Connected” box and entering settings through the GUI will result in live movements of the servo, allowing you to see
the effect of the new values.
The servo position is controlled by a pulse-width modulated (PWM) signal coming from the blue control line of the
SF20. This signal can change in width from 0 us to 3000 us in steps of 0.7 us and updates 333 times per second. A
given servo will be limited to a specific range of PWM widths, corresponding to the physical limits of rotary motion.
By default the minimum PWM width is set to 1000 us and the maximum PWM width to 2000 us. This is suitable for
most servos but new values can be entered if needed. If a new value beyond the capabilities of the servo is entered,
the servo may draw too much power, get hot or buzz.
12 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
Caution
Setting PWM values outside the specified range of the servo may cause damage to the servo.
When viewed from above, the lower PWM setting turns the servo shaft to the extreme left position and the higher
PWM setting turns it to the extreme right. The midpoint position corresponds to the PWM value that is halfway
between the two end settings.
For each degree of motion by the servo, the PWM pulse width needs to change by a specific number of us. This “PWM
scale” can usually be found on the data sheet of the servo. Alternatively, you can measure how many degrees the
servo moves for a 1000 us change in PWM pulse width and calculate the PWM scale from this result. The default scale
value is 10.00 us per degree as shown in the picture below:
Once the settings have been entered, the servo can be manually positioned using the slider near the bottom of the
graphic page. This slider works in 5 degree increments. The central or middle position can be checked by pressing the
“Go to midpoint” button. The midpoint should be lined up with the forward direction of whatever the servo is
mounted on. In the graphic, the physical range of angular motion of the servo is shown as a grey segment.
Note that settings will only be saved to the SF20 once the “Save” button in the bottom left corner of the screen has
been pushed.
Once the electrical characteristics of the servo have been entered using the method above, the servo can be used to
aim the SF20 in a specific direction or autonomously scan the SF20 to produce LiDAR maps and provide collision
warning alarms.
13 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
Configuring the scanning motion is done by selecting the “Sweep” button under the “Setup” tab. Note that the
settings entered here are limited by the physical and electrical characteristics of the servo. Only the first return signal
is shown on the graphic.
The speed of the scan is determined by how fast the SF20 updates and the number of steps that the servo moves
with each reading. The “Steps per reading” box increases or decreases this speed as does the update rate setting in
the “Laser” section. Running the servo faster increases its power consumption but provides a faster response to
changes in measurements. If the servo moves too fast its range of motion may be decreased.
Each direction of the scan is indicated in a different color on the graphic. This is to emphasize the effect of “servo lag”
that most servos exhibit when moving at a constant speed. Servo lag comes about because servos are designed to
aim in a fixed direction and their control systems are optimized for this type of action. When the servo moves
continuously, the control loop isn’t able to catch up with the aiming direction and always lags behind.
The number of degrees of lag is different for different servos, at different speeds and at different power supply
voltages. To correct for this lag enter a value in the “Lag offset” box. This is typically between 0.5 degrees and 10
degrees depending upon the torque, speed and quality of the servo. By making small adjustments to the lag offset
the images from each direction of scan can be made to coincide, as seen in the picture below.
The effect of servo lag with no correction and after applying a 2.5 degree correction
Once the servo lag has been corrected, the mechanical motion of the servo will remain consistent. From time to time
the settings should be checked in case wear on the gears or changes to the power supply have affected the servo.
In most applications, the field of view of the scanning pattern will need to be reduced. This could be because of fixed
objects inside the scanning area or to remove errors at the edges of the scan caused by the servo changing direction.
Changing the field of view does not affect the physical motion of the servo as this would upset the PWM and servo lag
settings. Instead, the field of view cuts out unwanted data from the edges of the scanned image. The left and right
edge settings of the field of view can be changed independently.
14 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
Reducing the field of view to avoid detecting the landing legs on a drone
For high precision scanning, the servo can be made to scan in one direction only. The resulting image has higher
angular repeatability at the expense of increased power consumption by the servo when returning to the start of the
scan. Switching from bi-directional to uni-direction scans is done using the “Scan type” selection box.
The SF20 has two alarms, A and B, that can be used to warn when objects get too close. The alarm changes from a 0
state to a 1 state when an object is detected closer than the set distance. The alarms are updated every time a new
distance measurement is taken.
Communications to the SF20 can be made through either the serial port or via an I2C bus. In this guide we will use
the serial port and the GUI interface to set up the servo parameters and configure automatic scanning.
Start the LightWare Terminal application and click the “Connect” icon to open a communications port. Click the
“LW20” icon to open the GUI home screen. Select the ”Laser” button under the “Setup” tab to access the
configuration graphic.
15 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
The alarms can also be used in scanning mode when the SF20 is attached to a servo. In this case, the alarms become
two dimensional with distance and angle settings. Two dimensional alarms update at the ends of each sweep and
remain in a fixed state for the duration of the sweep, giving the host controller time to check the alarm status.
The two dimensional alarm settings can be found using the “Alarms” button under the “Setup” tab. The segment
representing alarm A is indicated in orange and alarm B is indicated in grey. The colored areas flash when an object is
detected inside the alarm zone.
You can use the position slider to check the activation of alarms at different scanning angles.
16 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
4.6. Machine Machine Interface (MMI) communication with a Devantech USB to I2C module
The I2C interface is designed for machine-to-machine communications with multiple devices over a small network. In order
to test the I2C interface on the SF20, an I2C to USB converter can be connected and a limited number of commands can be
sent to the SF20 using the LightWare Terminal application.
● Connect the serial port of the SF20 to the USB port on a PC or laptop using a Devantech USB to I2C, SPI, Serial Adaptor
module (USB-ISS). This will allow for communication and power supply to the SF20. A red indicator light will show that
the unit is powered up.
● Start the LightWare Terminal application and click on the “Settings” icon and set the baud rate to “115200”. Select the
correct “Protocol” for your communication type. This should match the I2C converter being used and in this example
the Devantech USB-ISS adaptor is shown.
● You can tick the “Remember settings” box if you intend to use this configuration again. Click “Apply” the change to close
the dialog window.
● Once connected, open the I2C tester by clicking on the “I2C Tester Icon”. Located inside the I2C tester page, there are
three buttons. these three buttons have been programmed as follows:
○ Get Product - this sends the command < ?>
■ p:SF20,1.7.0,12 (The SF20 will reply with a product code, firmware revision and hardware revision
number.)
○ Distance ( First Pulse Median) - this sends the command <?LDF,0>
■ ldf,0:5.82
○ Distance ( First Pulse Raw) - this sends the command < ?LDF,1>
■ ldf,1:5:83
● A full list of I2C commands can be viewed under the command list provided later in this document.
● The factory default I2C bus address is 0x66.
17 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
● Using an alternative emulation program, send the character string <UU>. The LW20 will reply with a product code,
firmware revision and hardware revision number.
● In this mode, the LW20 will respond to the command set normally used by a controller to communicate using either the
serial or I2C ports (please refer to section 7.3 for a comprehensive list of commands and how to communicate with the
unit via I2C).
● Press the “Disconnect” icon before unplugging the USB cable.
18 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
5. Safety instructions
The SF20 is a laser based altimeter that emits ionizing laser radiation. The level of the laser emission is Class 1M which indicates
that the laser beam is safe to look at with the unaided eye but must not be viewed using binoculars or other optical devices at a
distance of less than 0.5 meters. Notwithstanding the safety rating, avoid looking into the beam and switch the unit off when
working in the area.
Caution
The use of optical instruments with this product will increase eye hazard.
The SF20 should not be disassembled or modified in any way. The laser eye safety rating depends on the mechanical integrity of
the optics and electronics so if these are damaged do not continue using the SF20. There are no user serviceable parts and
maintenance or repair must only be carried out by the manufacturer or a qualified service agent.
No regular maintenance is required for the SF20 / LW20 but if the lenses start to collect dust then they may be wiped with
suitable lens cleaning materials. Make sure that the SF20 / LW20 is switched OFF before looking into the lenses.
5.1 Labelling
Pulse width 16 ns
6. Hardware
19 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
The power supply, communications and servo driver signals are connected to the SF20 using a built-in cable. The
cable has a shield that should be earthed to reduce electrical interference. The power supply voltage must be
between 4.5 V and 5.5 V and the SF20 / LW20 draws about 130 mA while measuring. It is good practice to make sure
that the power supply is able to deliver more current than needed and to make sure that the voltage is stable and
clean from spikes.
6.3 Installation
SF20 Rangefinders require a clear line-of-sight to measure distance to a target surface. They can be mounted with a
vertical or horizontal lens orientation.
They can be mounted in a downward facing orientation for altimetery, terrain following or precision landing
applications. For terrain following, install the rangefinder at an angle to reduce lag time in reaction. The angle
depends on the speed traveled, and the overall system lag, but should be between 20 and 45 degrees. They can be
mounted forward facing orientation for sense-and-avoid or position-hold applications.
Do not mount the rangefinder within the cavity of an airframe, rather mount it directly at the surface boundary. This
can prevent beam divergence from causing false readings in short range distances, or out of range conditions.
20 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
Precautions
Ensure that nothing is in the path of the laser beam.
Ensure that no shiny or highly reflective surfaces are near the path of the beam.
Secure the cable with zip ties to protect it from pulling on the connectors.
The SF20 is an OEM module that requires appropriate heat sinking (see area in red) and EMI shielding.
21 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
22 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
7. Settings
1: Measurement update rate 48 … 388 readings per second Sets the rate at which distances are measured.
2: Serial port baud rate 9600 … 921600 Select the baud rate for the serial communication port. Note that
new values take effect after they are saved and power is cycled,
the factory default is 115200.
3: I2C address 0x00 … 0x7F The address of the SF20 / LW20 on the I2C bus, the factory default
is 0x66.
4: Zero distance offset trim -10.00 … 10.00 meters Moves the point at which the measured distance reads zero. This
is to correct for errors introduced by the mounting position.
5: Number of lost results 1 … 250 Sets the number of readings that must be taken before a lost
before out of range signal or out-of-range condition is reported. This value prevents
brief losses of signal from affecting the distance results.
6: Alarm A distance 0 … 100 meters Sets the activation distance of alarm A. This is the distance below
which the alarm changes state from ‘0’ to ‘1’.
7: Alarm B distance 0 … 100 meters Sets the activation distance of alarm B. This is the distance below
which the alarm changes state from ‘0’ to ‘1’.
8: Alarm hysteresis 0 … 10 meters The alarm hysteresis prevents the alarms from switching rapidly
between states when the target surface is at the activation
distance. Activation occurs at the set distance minus the hysteresis
distance and deactivation occurs at the set distance plus the
hysteresis distance.
C: Servo connected no
S: Servo scanning no
M: Go to mid-point
23 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
The SF20 / LW20 has either a serial or an I2C communication port. Commands can be sent that read values, change
settings, or alter the performance of the SF20 / LW20. Distances are in meters and temperatures in degrees celsius.
Commands are sent and responses received in ASCII format (human readable). These ASCII strings have a maximum
of 32 characters.
NOTE: There are some special commands to make the SF20 / LW20 compatible with older systems and these are in
binary format.
Once a command has been sent a single reply will be returned. To continuously update the reply without re-sending
the command the streaming ($) command can be used.
Note
The first command sent after power up will be used to detect if the SF20 / LW20 is running in Serial or I2C mode, and therefore
will not get a response.
Command types:
? Read a value once. This can be either a result or a setting.
# Change a setting. All settings can be changed.
$ Stream a value continuously. Update a result or a setting every time it changes.
% Save a setting. The setting becomes permanent even after the power is switched off.
Channels:
P Product channel - provides product specific information
L Laser channel - provides distance measurements and related settings
S Servo channel - relates to servo position and settings
A Alarm channel - shows the status of alarms
C Communications channel - handles serial and I2C settings
Examples:
?LDF,0 Read the median value of the distance to the first return signal
#LO,0.23 Move the measurement zero datum further away by 0.23 meters
$1LT Stream the internal temperature in the first column
%P Save all settings to permanent memory
Command list
?
p:SF20,1.0.0,11 Product name, firmware version, hardware version
?P
24 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
25 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
Data streaming
For example:
To stream the median distance to the first return, on stream one: $1,ldf<CR>
26 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
Streams are considered a settable parameter like any other in the SF20 / LW20, therefore you can save the stream to persist
through boot up. The command %p<CR> will save all settings.
Note: Saving parameters in the SF20 / LW20 happens on flash memory, which has limited writes. This is not a problem for
everyday use, but don't call the save command in a tight loop, as you could exhaust the flash if you accidentally call it a few
hundred thousand times.
27 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
SF20 LiDAR sensor
Datasheet
8. Revision history
Rev 12 2020/09/28 Fix incorrect average Laser power, pulse frequency and NOHD distance in paragraph 5.2. Update FDA Accession
number (page 4). Cable layout displayed on page 23 was incorrect.
Rev 11 2020/05/22 Separated LW20 information from SF20. Updated branding and layout of this document has resulted in page number
changes to previous revision history entries. Include “CE” certification. Converted to new layout to datasheet format.
Updated power supply current to “100mA” (page 4). Removed housing details (page 4). Include HMI commands
description table (page 21,22)
Rev 10 2019/11/28 Include ce certification, Converted to new layout to datasheet format. Separated LW 20 information from SF 20.
Rev 9 2018/07/23 Included “Figure 30 :: Heat sink contact area” (page 22).
Rev 8 2018/07/04 Removed feature “Remove feature: “Encoded laser pulses prevent interference for other lasers” (pages 1, 6). Removed
feature “Power saving mode to save energy when not in use” (page 1). Updated power supply current to “130 mA”
(pages 5, 7). Added “Objects must be separated by approximately 5 meters before they are seen as separate return
signals.” (page 6). Include cautionary note “The SF20 is an OEM module that requires the customer to provide
appropriate heat sinking and EMI shielding” (page 7). Changed “Select the “Laser” icon” to “Select the “Settings” icon”
(page 8). Added new instruction "Press the up arrow to engage serial communication mode. The LW20 will reply with a
product code” (page 11). Removed <~> key option to go back into machine-to-machine mode (page 11). Updated
“Figure 12 :: Arrangement of screens in terminal emulation mode” (page 11). Update "The LW20 will wait for the first
command to confirm which communication mode to select (serial or I2C). The first command will not get a response
(page 15). Remove the “E - The Energy channel controls power usage” channel (pages 15, 24, 26). Remove the setting
“Encoding pattern” from the table (page 16). Correct the serial port baud rate to “9600 … 921600” (page 16). Updated
“Figure 31 :: Pinout diagram” (page 23). Added note “The first command sent after power up will be used to detect if
the LW20 is running in Serial or I2C mode, and therefore will not get a response” (page 24). Replace “%C - Save the
latest communications settings to permanent memory" with “%P - Save all settings to permanent memory” (page 24).
Updated “Command list” table (pages 24, 25, 26).
Rev 7 2018/04/26 Added new model variations for “LW20/B”, “LW20/C”, “SF20/B” and “SF20/C” to replace obsolete “LW20/SER”,
“LW20/I2C” and “SF20” models (pages 2, 7, 15). Units now ship a single I2C and serial communication cable (pages 7, 15,
17, 24). Updated “Figure 10 :: Connection to a USB converter cable” (page 11). Updated “Figure 4 :: Connection to a USB
converter cable” (page 8) and “Figure 13 :: Connection to a Devantech USB-ISS module” (page 13). Removed sentences
“5 V logic should also work without any level shifters.” and “In some cases, 5 V logic will also work but this is not
guaranteed.” (page 15). Included cautionary note “Ensure that adequate ventilation or heat sinking is provided if the
SF20 is incorporated into a custom enclosure, as heat build-up could occur.” (page 22). Removed “Figure 31 :: I2C and
power cable”. Updated “Figure 31 :: Pinout diagram” by removing reference to “or 5 V logic” on RXD pin (page 22).
Rev 6 2018/04/05 Updated “4. Specifications of the LW20 / SF20” item “Range” to “0.2 … 100 m (sunlit white wall, 45 readings per second)”
(pages 4, 5). “4. Specifications of the LW20 / SF20” item “Beam divergence” to “0.3°” (page 5). Updated “Figure 13 ::
Connection to a Devantech USB-ISS module” to reflect an LW20/I2C model (page 11).
Rev 4 2017/05/25 Highlighted the factory default I2C bus address as 0x66 (pages 12, 14). Highlighted the factory default serial baud rate
as 115200 (page 12).
Rev 3 2017/05/05 Changed baud rate setting from 921600 to 115200 (pages 6, 9). Updated “Figure 13 :: Connection to a Devantech
USB-ISS module” (page 11). Updated LightWare Terminal screens to version 1.3.1 (pages 6, 9, 10, 11, 14). Included
“Data streaming” section into “Appendix C” (page 25).
Rev 2 2017/04/10 Include new section “6.1 How to communicate with the LW20 using the Devantech USB to I2C module” (pages 11, 12).
Rev 1 2017/03/03 Updated “4. Specifications of the LW20 / SF20” to include the approval “FDA: 1710193-000 (2017/02)” (page 5). Update
“Figure 26 :: Serial and power cable” (Rev 2) and “Figure 27 :: I2C and power cable” (Rev 2) to include a Ferrite Core
component (page 19).
28 of 28
SF20 LiDAR sensor - Datasheet (Rev 12) | © LightWare Optoelectronics (Pty) Ltd, 2019 | www.lightware.co.za
Mouser Electronics
Authorized Distributor
LightWare:
SF20/C