Applications - Technology insights

Connection to Pixhawk autopilots Teraranger One

Instruction Manual for:
TeraRanger One
Connection to Pixhawk Autopilots
Teraranger One Connection To Pixhawk 2

Table of contents:

1 Introduction

2 Compatibility table

3 Wiring Connection to Pixhawk

3.1 TeraRanger One wiring connection – Pixhawk 2.1

3.2 TeraRanger One wiring connection – Pixhawk 1

4 Setup the onboard firmware

4.1 PX4 – QGroundControl

4.2 ArduCopter – QGroundControl

4.3 ArduCopter – APM Planner 2

4.4 ArduCopter – Mission Planner

1 Introduction

The purpose of this document is to explain how to connect a TeraRanger One sensor to a Pixhawk board through the I2C interface and how to setup PX4 or ArduPilot firmware to enable TeraRanger One sensor use.

2 Compatibility table

Teraranger One Connection To Pixhawk Compatibility Table
Generic Compatibility Between Pixhawk Boards And Terabee Products Image

3 Wiring Connection to Pixhawk

3.1 TERARANGER ONE WIRING CONNECTION – PIXHAWK 2.1

For brevity we will refer to the TeraRanger One distance sensor module as TR-One. Please make sure you have a TR-One and a TR-I2C adapter:

TR-One sensor
TR-I2C adapter
Teraranger One Connection To Pixhawk 1 What Is In The Pack

To connect the sensor to the Pixhawk, please solder the power cable to the I2C adapter as described below:

Teraranger One Connection To Pixhawk Cables To Connect

Take the I2C cable included in the Pixhawk 2.1 box and make your own connection as described below:

Teraranger One Connection To Pixhawk Cables To Connect 2
Teraranger One Connection To Pixhawk Adapter Pins

Now connect the I2C adaptor to the Pixhawk and the TR-One to the I2C Adaptor:

Teraranger One Connection To Pixhawk 2

3.2 TERARANGER ONE WIRING CONNECTION – PIXHAWK 1
Teraranger One Connection To Pixhawk 1 What Is In The Pack

To connect the sensor to the Pixhawk, please solder the power cable to the I2C adapter as described below:

Teraranger One Connection To Pixhawk 1 Cables To Connect

Now connect the I2C adaptor to the Pixhawk via a DF13 4S cable (included in the Pixhawk box) and the TR-One to the I2C Adaptor:

Teraranger One Connection To Pixhawk 1 Adapter Pins
Teraranger One Connection To Pixhawk 1

4 Setup the onboard firmware

4.1 PX4 – QGROUNDCONTROL

Note: Please always use the latest QGroundControl version, available from:

1. Launch QGroundControl software
2. Open Vehicle setup menu and go into the Firmware tab (unplug and replug autopilot if needed).

Select the latest stable release of PX4 Flight Stack. Press the Ok button to flash the autopilot.
Teraranger One Connection To Px Ground Control

3. Go to Parameters/Sensor Enable

In the field SENS_EN_TRANGER select your TeraRanger sensor type:
TROne

Press Save to confirm.
Teraranger One Connection To Px Ground Control I2c Port

4. After making sure the sensor is connected to the Pixhawk I2C port, reboot the autopilot.

5. To verify that the sensor is operational open an Analyze Widget (Widgets/Analyze). From the list on the left hand side select; M1:DISTANCE_SENSOR.current_distance. The plot showing distance measurements should indicate that the sensor is working correctly.
Teraranger One Connection To Px Ground Control Distance Sensing

4.2 ARDUCOPTER – QGROUNDCONTROL

1. Go to the Firmware tab on QGroundControl (reconnect autopilot in order to flash a new firmware). Select ArduPilot Flight Stack. In the dropdown menu select the latest version of MultiRotor – APM:Copter.
Teraranger One Connection To Arducopter Ground Control

2. Go to Parameters/RNGFND and update the following fields:

RNGFND_TYPE : 14 / TrOneI2c / TeraRangerI2C (each of these values should work, but they might appear differently based on GCS software version.)

RNGFND_ADDR:
TR-One : 48

RNGFND_MIN_CM:
TR-One : 20

RNGFND_MAX_CM:
TR-One : 1400

After setting the values in these fields, please reboot the autopilot.

3. To verify that the sensor is operational open an Analyze Widget (Widgets/Analyze). From the list on the left hand side select; M1:DISTANCE_SENSOR.current_distance. The plot showing distance measurements should indicate that the sensor is working correctly.
Teraranger One Connection To Arducopter Ground Control Distance Sensing

4.3 ARDUCOPTER – APM PLANNER 2

Please make sure you are running the latest version of APM Planner 2, available here:

1. Open APM Planner. Go to Initial Setup, Instal Firmware and flash the latest firmware of ArduPilot.

2. Click on USB device name on the right hand side and select the appropriate Serial Port and Baud Rate for your device and press the Connect button.

3. Go to Parameters/RNGFND and update the following fields:

RNGFND_TYPE : 14 / TrOneI2c / TeraRangerI2C (each of these values should work, but they might appear differently based on GCS software version.)

RNGFND_ADDR:
TR-One : 48

RNGFND_MIN_CM:
TR-One : 20

RNGFND_MAX_CM:
TR-One : 1400
Teraranger One Connection To Apm Planner

4.Reboot the autopilot and select the GRAPHS tab. On the right hand side you should see the messages from the autopilot. From the list select; DISTANCE_SENSOR/current_distance:
Teraranger One Connection To Apm Planner Distance Sensor

4.4 ARDUCOPTER – MISSION PLANNER

Please ensure you are running the latest version of Mission Planner, available here:

1.Open Mission Planner. Go to Initial Setup, Instal Firmware and flash the latest firmware.

2. Click on USB device name on the right hand side and select appropriate Serial Port and Baud Rate for your device and press the Connect button.

3. Go to Parameters/RNGFND and update the following fields:

RNGFND_TYPE : 14 / TrOneI2c / TeraRangerI2C (each of these values should work, but they might appear differently based on GCS software version.)

RNGFND_ADDR:
TR-One : 48

RNGFND_MIN_CM:
TR-One : 20

RNGFND_MAX_CM:
TR-One : 1400

4. Reboot the autopilot and select the Flight Data tab. On the left window you should see a quick tab with displayed value. Double click on one and check SonarRange. The distance is now displayed on the Quick flight data menu.
Teraranger One Connection To Mission Planner
Teraranger One Connection To Mission Planner Values

0
My Cart