# Lightware SFxx Lidar

LightWare develops a range of light-weight, general purpose, laser altimeters ("Lidar") suitable for mounting on UAVs. These are useful for applications including terrain following, precision hovering (e.g. for photography), warning of regulatory height limits, anti-collision sensing etc.

![LightWare SF11/C Lidar](https://4155462212-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LArEa7z2SPawfl3HpCD%2Fuploads%2Fgit-blob-eff91af2741a8a6cd6cefb9029147d93c102804c%2Fsf11c_120_m.jpg?alt=media)

## Supported Models

The following models are supported by PX4, and can be connected to either the I2C or Serial bus (the tables below indicates what bus can be used for each model).

### Available

| Model                                                      | Range (m) | Bus               | Description                                                     |
| ---------------------------------------------------------- | --------- | ----------------- | --------------------------------------------------------------- |
| [SF11/C](https://lightwarelidar.com/products/sf11-c-100-m) | 100       | Serial or I2C bus |                                                                 |
| [LW20/C](https://lightware.co.za/products/lw20-c-100-m)    | 100       | I2C bus           | Waterproofed (IP67) with servo for sense-and-avoid applications |

### Discontinued

The following models are no longer available from the manufacturer.

| Model                                                                                              | Range | Bus           |
| -------------------------------------------------------------------------------------------------- | ----- | ------------- |
| [SF02](http://documents.lightware.co.za/SF02%20-%20Laser%20Rangefinder%20Manual%20-%20Rev%208.pdf) | 50    | Serial        |
| [SF10/A](http://documents.lightware.co.za/SF10%20-%20Laser%20Altimeter%20Manual%20-%20Rev%206.pdf) | 25    | Serial or I2C |
| [SF10/B](http://documents.lightware.co.za/SF10%20-%20Laser%20Altimeter%20Manual%20-%20Rev%206.pdf) | 50    | Serial or I2C |
| SF10/C                                                                                             | 100m  | Serial or I2C |
| LW20/B                                                                                             | 50    | I2C bus       |

## I2C Setup

Check the tables above to confirm that which models can be connected to the I2C port.

### Lidar Configuration

This hardware does not ship with Pixhawk I2C compatibility enabled by default. To enable support, you have to download [LightWare Studio](https://lightwarelidar.com/pages/lightware-studio) and got to **Parameters > Communication** and tick mark **I2C compatibility mode (Pixhawk)**

![LightWare SF11/C Lidar-I2C Config](https://4155462212-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LArEa7z2SPawfl3HpCD%2Fuploads%2Fgit-blob-b4a1af7fa52f14c390459af89eed1dcb8998bf0e%2Flightware_studio_i2c_config.jpg?alt=media)

### Hardware

Connect the Lidar the autopilot I2C port as shown below (in this case, for the [Pixhawk 1](https://px4.gitbook.io/px4-user-guide/drone_parts/flight_controller/autopilot_pixhawk_standard/mro_pixhawk)).

![SF1XX LIDAR to I2C connection](https://4155462212-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LArEa7z2SPawfl3HpCD%2Fuploads%2Fgit-blob-7854a443787c6480b2001460f62488f2219ed27f%2Fsf1xx_i2c.jpg?alt=media)

:::note Some older revisions cannot be used with PX4. Specifically they may be miss-configured to have an I2C address equal to `0x55`, which conflicts with `rgbled` module. On Linux systems you may be able to determine the address using [i2cdetect](https://linux.die.net/man/8/i2cdetect). If the I2C address is equal to `0x66` the sensor can be used with PX4. :::

### Parameter Setup

Set the [SENS\_EN\_SF1XX](https://px4.gitbook.io/px4-user-guide/advanced_config/parameter_reference#SENS_EN_SF1XX) parameter to match the rangefinder model and then reboot.

## Serial Setup

### Hardware

The lidar can be connected to any unused *serial port* (UART), e.g.: TELEM2, TELEM3, GPS2 etc.

### Parameter Setup

[Configure the serial port](https://px4.gitbook.io/px4-user-guide/advanced_config/serial_configuration) on which the lidar will run using [SENS\_SF0X\_CFG](https://px4.gitbook.io/px4-user-guide/advanced_config/parameter_reference#SENS_SF0X_CFG). There is no need to set the baud rate for the port, as this is configured by the driver.

:::note If the configuration parameter is not available in *QGroundControl* then you may need to [add the driver to the firmware](https://px4.gitbook.io/px4-user-guide/advanced_config/serial_configuration#parameter_not_in_firmware). :::

Then set the [SENS\_EN\_SF0X](https://px4.gitbook.io/px4-user-guide/advanced_config/parameter_reference#SENS_EN_SF0X) parameter to match the rangefinder model and reboot.

## Further Information

* [Modules Reference: Distance Sensor (Driver) : lightware\_laser\_i2c](https://px4.gitbook.io/px4-user-guide/development/modules_main/modules_driver/modules_driver_distance_sensor#lightware-laser-i2c)
* [Modules Reference: Distance Sensor (Driver) : lightware\_laser\_serial](https://px4.gitbook.io/px4-user-guide/development/modules_main/modules_driver/modules_driver_distance_sensor#lightware-laser-serial)
