MAVLINKHUD

Overview

The TEMP parameter group configures the Temperature Sensing subsystem. This library manages sensors for monitoring battery temperature, motor temperature, or ambient air temperature.

Key Concepts

1. Sensor Types (TEMPn_TYPE)

ArduPilot supports multiple temperature sensor instances.

  • 1 (Analog): Using a thermistor or active analog sensor on an ADC pin.
  • 2 (I2C-MCP9808): High-precision digital temperature sensor.
  • 3 (DroneCAN): CAN-based temperature reports.

2. Monitoring and Logging

  • TEMP_LOG: Toggles recording of temperature data to the DataFlash log.
  • TEMP_MSG_RATE: Defines how often temperature updates are sent over MAVLink.

Parameter Breakdown

  • TEMP1_TYPE: Driver selection.
  • TEMP1_SRC: Selects what the sensor is measuring (Battery, Internal, Motor).
  • TEMP_PIN: (Analog only) ADC pin number.

Integration Guide

  1. Hardware: Connect your sensor (e.g., an NTC thermistor to an ADC pin with a pull-up resistor).
  2. Enable: Set TEMP1_TYPE and TEMP1_SRC.
  3. Calibrate: For analog sensors, use the TEMP1_A0...A5 coefficients to define the thermistor's Beta-curve.

Developer Notes

  • Library: libraries/AP_TempSensor.

TEMP1_A0

Default 0

Temperature Polynomial Coefficient A0 (TEMP1_A0)

Description

TEMP1_A0 is the first part of a 5th-order polynomial used to translate raw analog voltage from a thermistor or probe into a human-readable temperature in degrees Celsius.

In its simplest form (linear), A0 acts as the offset. In a complex curve, it works with A1 through A5 to fit the specific response curve of your sensor.

The Mathematics

The autopilot calculates the temperature ($T$) from the measured voltage ($V$) using this formula:

$$ T = A\_0 + (A\_1 \cdot V) + (A\_2 \cdot V^2) + (A\_3 \cdot V^3) + (A\_4 \cdot V^4) + (A\_5 \cdot V^5) $$

Tuning & Behavior

  • Default: 0.
  • Usage: For most standard analog sensors, you will find these coefficients in the manufacturer's data sheet or by performing a curve-fitting calibration in a spreadsheet.
  • Note: This only applies if TEMP1_TYPE is set to 5 (Analog).

TEMP1_A1

Default 0

Temperature Polynomial Coefficient A1 (TEMP1_A1)

Description

TEMP1_A1 is the linear part of the 5th-order polynomial used to calculate temperature from analog voltage.

  • Linear Scale: It defines how many degrees the temperature changes for every 1 volt increase.
  • Formula: $T = A\_0 + (A\_1 \cdot V) + (A\_2 \cdot V^2) + \dots$

Tuning & Behavior

  • Default: 0.
  • Usage: Consult your sensor's datasheet for the "Slope" or "Scale" value.
  • Note: Only used if TEMP1_TYPE is set to 5 (Analog).

TEMP1_A2

Default 0

Temperature Polynomial Coefficient A2 (TEMP1_A2)

Description

TEMP1_A2 is the second-order (square) part of the 5th-order polynomial used to calculate temperature from analog voltage.

  • Role: Defines the curvature of the sensor's response. Most low-cost thermistors are non-linear and require this coefficient to provide accurate readings across a wide temperature range.
  • Formula: $T = A\_0 + (A\_1 \cdot V) + (A\_2 \cdot V^2) + \dots$

Tuning & Behavior

  • Default: 0.
  • Usage: Consult your sensor's datasheet or a calibration table.
  • Note: Only used if TEMP1_TYPE is set to 5 (Analog).

TEMP1_A3

Default 0

Temperature Polynomial Coefficient A3 (TEMP1_A3)

Description

TEMP1_A3 is the third-order (cubic) part of the 5th-order polynomial used to calculate temperature from analog voltage.

  • Role: Refines the accuracy of non-linear sensors.
  • Formula: $T = A\_0 + (A\_1 \cdot V) + (A\_2 \cdot V^2) + (A\_3 \cdot V^3) + \dots$

TEMP1_A4

Default 0

Temperature Polynomial Coefficient A4 (TEMP1_A4)

Description

TEMP1_A4 is the fourth-order part of the 5th-order polynomial used to calculate temperature from analog voltage.

  • Role: Used for extremely precise curve fitting on high-end specialized analog probes.
  • Formula: $T = A\_0 + (A\_1 \cdot V) + (A\_ linear \cdot V^2) + (A\_3 \cdot V^3) + (A\_4 \cdot V^4) + \dots$

TEMP1_A5

Default 0

Temperature Polynomial Coefficient A5 (TEMP1_A5)

Description

TEMP1_A5 is the fifth-order part of the 5th-order polynomial used to calculate temperature from analog voltage.

  • Role: The highest order term for complex curve fitting.
  • Formula: $T = A\_0 + (A\_1 \cdot V) + (A\_ linear \cdot V^2) + (A\_3 \cdot V^3) + (A\_4 \cdot V^4) + (A\_5 \cdot V^5)$

TEMP1_ADDR

Default 0
Range 0 127

Temperature Sensor Address (TEMP1_ADDR)

Description

TEMP1_ADDR sets the 7-bit I2C address for digital temperature sensors (Types 1-4, 7).

Most sensors have a fixed or jumper-selectable address. If you have multiple sensors of the same type on the same bus, you must configure them with unique addresses and set those addresses here.

Tuning & Behavior

  • Default: 0 (Use the driver's default address for the selected type).
  • Recommendation: Only change this if your hardware documentation specifies a non-standard I2C address.

TEMP1_BUS

Default 0
Range 0 3

Temperature Sensor Bus (TEMP1_BUS)

Description

TEMP1_BUS specifies which physical I2C port on the flight controller the temperature sensor is plugged into.

Most flight controllers have multiple I2C buses (e.g. internal for compass/baro, and external for GPS/Peripherals).

  • 0: Bus 0.
  • 1: Bus 1 (Often the primary external port).
  • etc.

Tuning & Behavior

  • Default: 0.
  • Action: If your I2C temperature sensor is not being detected, check your flight controller's hardware specification to find the correct bus number for the port you have used.

TEMP1_MSG_ID

Default 0
Range 0 65535

Temperature DroneCAN Message ID (TEMP1_MSG_ID)

Description

TEMP1_MSG_ID identifies which specific piece of hardware on the DroneCAN bus is providing the temperature data for this instance.

This allows you to map multiple DroneCAN temperature sensors (e.g., from different ESCs or battery monitors) to specific slots in the autopilot's telemetry system.

Tuning & Behavior

  • Default: 0 (Auto-detection).
  • Usage: Only set this if you have multiple sensors of the same type and need to force a specific one to Instance 1.
  • Requirement: Only used if TEMP1_TYPE is set to 1 (DroneCAN).

TEMP1_SRC

Default 0
Range 0 6

Temperature Sensor Source (TEMP1_SRC)

Description

TEMP1_SRC tells the autopilot what the temperature sensor is actually touching.

By default, temperature data is just recorded in the logs. However, if you set a source here, the autopilot will "link" this sensor to a specific component. For example, if you set this to 1 (ESC), the temperature reported for ESC 1 will come from this physical sensor instead of the ESC's built-in (often inaccurate) telemetry.

  • 0: None. Data is logged but not displayed as a component temperature.
  • 1: ESC.
  • 2: Motor.
  • 3: Battery. (Uses TEMP1_SRC_ID to select which battery).
  • 5: Pitot Tube.

Tuning & Behavior

  • Default: 0.
  • Integration: Use this to enable thermal protection for motors or to monitor battery health more closely.

TEMP1_SRC_ID

Default 0
Range 0 255

Sensor Source Instance ID (TEMP1_SRC_ID)

Description

TEMP1_SRC_ID tells the autopilot which specific system component this temperature sensor is "Replacement" data for.

For example, if you have a standalone temperature probe mounted to your motor, and you want that probe's data to show up as "ESC 1 Temperature" in your logs and GCS, you would use this parameter.

  • Mapping: This works with TEMP1_SRC.
    • If TEMP1_SRC = 1 (ESC), and TEMP1_SRC_ID = 1, this sensor's data replaces the temperature report for ESC 1.
    • If TEMP1_SRC = 3 (Battery), and TEMP1_SRC_ID = 2, it replaces Battery 2.

Tuning & Behavior

  • Default: 0.
  • Significance: This is a powerful integration tool for customizing your vehicle's telemetry dashboard without needing custom firmware.

TEMP1_TYPE

Default 0
Range 0 7

Temperature Sensor Type (TEMP1_TYPE)

Description

TEMP1_TYPE enables the primary external temperature sensor.

This is often used to monitor the heat of critical components like motors, ESCs, or batteries that do not have built-in telemetry.

  • 0: Disabled.
  • 1: TSYS01. (I2C).
  • 2: MCP9600. (I2C Thermocouple).
  • 5: Analog. (Voltage-divider based thermistor).
  • 6: DroneCAN.

Tuning & Behavior

  • Reboot Required: Yes.
  • Integration: Once enabled, use TEMP1_SRC to tell ArduPilot which system component this sensor is measuring.

TEMP2_ADDR

Default AP_TEMPERATURE_SENSOR_I2C_ADDR_DEFAULT
Range 0 127

Temperature sensor address

Note: This parameter functions identically to TEMP1_ADDR.

TEMP2_BUS

Default AP_TEMPERATURE_SENSOR_I2C_BUS_DEFAULT
Range 0 3

Temperature sensor bus

Note: This parameter functions identically to TEMP1_BUS.

TEMP2_SRC

Default (float
Range null

Sensor Source

Note: This parameter functions identically to TEMP1_SRC.

TEMP2_SRC_ID

Default AP_TEMPERATURE_SENSOR_SOURCE_ID_DEFAULT
Range null

Sensor Source Identification

Note: This parameter functions identically to TEMP1_SRC_ID.

TEMP2_TYPE

Default (float
Range null

Temperature Sensor Type

Note: This parameter functions identically to TEMP1_TYPE.

TEMP3_ADDR

Default AP_TEMPERATURE_SENSOR_I2C_ADDR_DEFAULT
Range 0 127

Temperature sensor address

Note: This parameter functions identically to TEMP1_ADDR.

TEMP3_BUS

Default AP_TEMPERATURE_SENSOR_I2C_BUS_DEFAULT
Range 0 3

Temperature sensor bus

Note: This parameter functions identically to TEMP1_BUS.

TEMP3_SRC

Default (float
Range null

Sensor Source

Note: This parameter functions identically to TEMP1_SRC.

TEMP3_SRC_ID

Default AP_TEMPERATURE_SENSOR_SOURCE_ID_DEFAULT
Range null

Sensor Source Identification

Note: This parameter functions identically to TEMP1_SRC_ID.

TEMP3_TYPE

Default (float
Range null

Temperature Sensor Type

Note: This parameter functions identically to TEMP1_TYPE.

TEMP4_ADDR

Default AP_TEMPERATURE_SENSOR_I2C_ADDR_DEFAULT
Range 0 127

Temperature sensor address

Note: This parameter functions identically to TEMP1_ADDR.

TEMP4_BUS

Default AP_TEMPERATURE_SENSOR_I2C_BUS_DEFAULT
Range 0 3

Temperature sensor bus

Note: This parameter functions identically to TEMP1_BUS.

TEMP4_SRC

Default (float
Range null

Sensor Source

Note: This parameter functions identically to TEMP1_SRC.

TEMP4_SRC_ID

Default AP_TEMPERATURE_SENSOR_SOURCE_ID_DEFAULT
Range null

Sensor Source Identification

Note: This parameter functions identically to TEMP1_SRC_ID.

TEMP4_TYPE

Default (float
Range null

Temperature Sensor Type

Note: This parameter functions identically to TEMP1_TYPE.

TEMP5_ADDR

Default AP_TEMPERATURE_SENSOR_I2C_ADDR_DEFAULT
Range 0 127

Temperature sensor address

Note: This parameter functions identically to TEMP1_ADDR.

TEMP5_BUS

Default AP_TEMPERATURE_SENSOR_I2C_BUS_DEFAULT
Range 0 3

Temperature sensor bus

Note: This parameter functions identically to TEMP1_BUS.

TEMP5_SRC

Default (float
Range null

Sensor Source

Note: This parameter functions identically to TEMP1_SRC.

TEMP5_SRC_ID

Default AP_TEMPERATURE_SENSOR_SOURCE_ID_DEFAULT
Range null

Sensor Source Identification

Note: This parameter functions identically to TEMP1_SRC_ID.

TEMP5_TYPE

Default (float
Range null

Temperature Sensor Type

Note: This parameter functions identically to TEMP1_TYPE.

TEMP6_ADDR

Default AP_TEMPERATURE_SENSOR_I2C_ADDR_DEFAULT
Range 0 127

Temperature sensor address

Note: This parameter functions identically to TEMP1_ADDR.

TEMP6_BUS

Default AP_TEMPERATURE_SENSOR_I2C_BUS_DEFAULT
Range 0 3

Temperature sensor bus

Note: This parameter functions identically to TEMP1_BUS.

TEMP6_SRC

Default (float
Range null

Sensor Source

Note: This parameter functions identically to TEMP1_SRC.

TEMP6_SRC_ID

Default AP_TEMPERATURE_SENSOR_SOURCE_ID_DEFAULT
Range null

Sensor Source Identification

Note: This parameter functions identically to TEMP1_SRC_ID.

TEMP6_TYPE

Default (float
Range null

Temperature Sensor Type

Note: This parameter functions identically to TEMP1_TYPE.

TEMP7_ADDR

Default AP_TEMPERATURE_SENSOR_I2C_ADDR_DEFAULT
Range 0 127

Temperature sensor address

Note: This parameter functions identically to TEMP1_ADDR.

TEMP7_BUS

Default AP_TEMPERATURE_SENSOR_I2C_BUS_DEFAULT
Range 0 3

Temperature sensor bus

Note: This parameter functions identically to TEMP1_BUS.

TEMP7_SRC

Default (float
Range null

Sensor Source

Note: This parameter functions identically to TEMP1_SRC.

TEMP7_SRC_ID

Default AP_TEMPERATURE_SENSOR_SOURCE_ID_DEFAULT
Range null

Sensor Source Identification

Note: This parameter functions identically to TEMP1_SRC_ID.

TEMP7_TYPE

Default (float
Range null

Temperature Sensor Type

Note: This parameter functions identically to TEMP1_TYPE.

TEMP8_ADDR

Default AP_TEMPERATURE_SENSOR_I2C_ADDR_DEFAULT
Range 0 127

Temperature sensor address

Note: This parameter functions identically to TEMP1_ADDR.

TEMP8_BUS

Default AP_TEMPERATURE_SENSOR_I2C_BUS_DEFAULT
Range 0 3

Temperature sensor bus

Note: This parameter functions identically to TEMP1_BUS.

TEMP8_SRC

Default (float
Range null

Sensor Source

Note: This parameter functions identically to TEMP1_SRC.

TEMP8_SRC_ID

Default AP_TEMPERATURE_SENSOR_SOURCE_ID_DEFAULT
Range null

Sensor Source Identification

Note: This parameter functions identically to TEMP1_SRC_ID.

TEMP8_TYPE

Default (float
Range null

Temperature Sensor Type

Note: This parameter functions identically to TEMP1_TYPE.

TEMP9_ADDR

Default AP_TEMPERATURE_SENSOR_I2C_ADDR_DEFAULT
Range 0 127

Temperature sensor address

Note: This parameter functions identically to TEMP1_ADDR.

TEMP9_BUS

Default AP_TEMPERATURE_SENSOR_I2C_BUS_DEFAULT
Range 0 3

Temperature sensor bus

Note: This parameter functions identically to TEMP1_BUS.

TEMP9_SRC

Default (float
Range null

Sensor Source

Note: This parameter functions identically to TEMP1_SRC.

TEMP9_SRC_ID

Default AP_TEMPERATURE_SENSOR_SOURCE_ID_DEFAULT
Range null

Sensor Source Identification

Note: This parameter functions identically to TEMP1_SRC_ID.

TEMP9_TYPE

Default (float
Range null

Temperature Sensor Type

Note: This parameter functions identically to TEMP1_TYPE.

TEMP_LOG

Default 0
Range 0 2

Temperature Sensor Logging (TEMP_LOG)

Description

TEMP_LOG enables or disables the recording of temperature sensor data to the drone's internal dataflash log (.BIN files).

  • 0: Disabled. No temperature data is logged.
  • 1: Log All. Data from every enabled temperature sensor is recorded.
  • 2: Log Only Source None. Only logs sensors that are NOT assigned to a specific component (like an ESC or Battery). This avoids duplicating data already being recorded in other messages.

Tuning & Behavior

  • Default Value: 0.
  • Use Case: Enable this if you have added a dedicated sensor for monitoring ambient air temperature or a custom payload.

TEMP_PIN

null
Default WINDSPEED_DEFAULT_TEMP_PIN
Range null

Wind vane speed sensor analog temp pin

Note: This parameter functions identically to TEMP1_PIN.

TEMP_MSG_RATE: Temperature sensor message rate

Description

This is the rate Temperature sensor data is sent in Hz. Zero means no send.

Values

  • Range: 0 to 200
  • Units: Hz
  • Default: 0

Description

This parameter controls how frequently the AP_Periph device broadcasts temperature data over the DroneCAN bus.

  • 0 (Default): Disabled. No temperature messages are sent.
  • 1-200: The frequency in Hertz.
  • Usage: Set this to a positive value (e.g., 10) if you have connected an external temperature sensor to your CAN peripheral and want the flight controller to receive the data.