Skip to content

Sensors and Actuators — Sensor and Actuator Interface Library


The Sensors and Actuators library provides low-level access to Pixhawk flight controller sensor and actuator hardware, including IMU, magnetometer, barometer, GPS, battery monitoring, PWM output, LED control, and more.


Module List

Sensor Interfaces

Module Function Description
Battery Measure Battery voltage and current monitoring, supporting voltage divider and current sensing circuits
Input RC RC receiver input, reading PWM or PPM signals from each channel
Sensor Combined Integrated sensor data fusion, including IMU, magnetometer, and barometer data
Vehicle Attitude Vehicle attitude estimation data, including quaternions, Euler angles, and angular rates
Vehicle GPS GPS positioning data, including latitude, longitude, altitude, velocity, and accuracy information

Actuator Interfaces

Module Function Description
PWM Output PWM signal output for controlling motors (ESC) or servos
AUX Output Auxiliary PWM output, typically used for gimbals, parachutes, and other peripherals
RGB LED RGB LED control for flight controller status indication
Speaker Tune Buzzer/speaker control for audio prompts and alerts

Usage Scenarios

Sensor Data Acquisition

  • State Estimation: Obtain raw IMU, magnetometer, and barometer data for attitude and position estimation |
  • Battery Monitoring: Real-time monitoring of battery voltage and current for low-battery warnings and safety protection |
  • GPS Positioning: Acquire satellite positioning data for navigation and autonomous flight |
  • RC Input: Read operator commands for manual control |

Actuator Control

  • Motor Control: Output PWM signals to control multirotor motor speeds |
  • Servo Control: Control fixed-wing control surfaces or gimbal angles |
  • Status Indication: Provide flight status feedback via RGB LED and buzzer |
  • Auxiliary Devices: Control peripherals such as parachutes and light strips |

Usage Notes

  1. Sensor Calibration: IMU and magnetometer must be calibrated before use to ensure data accuracy |
  2. PWM Range Settings: Set correct PWM minimum/maximum values according to ESC/servo specifications to avoid device damage |
  3. Battery Monitoring Parameters: Configure voltage divider ratio and current sensing coefficients correctly to ensure accurate battery data |
  4. Sensor Fusion: Multiple sensors may introduce noise and drift; it is recommended to combine with estimation algorithms such as EKF |
  5. Safety Protections: Set appropriate failure protection thresholds (e.g., low voltage, signal loss) to ensure flight safety |


Note: This document serves as the index for the Sensors and Actuators library. For detailed usage instructions for each module, please refer to its respective standalone documentation page.