Skip to main content

Sonar

A sonar sensor can be used to measure altitude for use with BARO and SONAR altitude hold modes.

The sonar sensor is used instead of the pressure sensor (barometer) at low altitudes (less than about 3.5 meters above the ground). The sonar sensor is only used when the aircraft inclination angle (attitude) is small (less than 22.5 degrees).

Hardware

Currently the main supported sensor is the HCSR04 sensor. The Parallax 28015 single-wire sonar can also be used by connecting 1k resistors to the Trigger and Echo pins, and the other end of the resistors shorted together and to the Sonar module.

          1k
TRIGGER--/\/\--\
\_______ 28015 SONAR
1k /
ECHO-----/\/\--/

Connections

Naze/Flip32+

ModeTriggerEchoInline 1k resistors
Parallel PWM/ADC current sensorPB8 / Motor 5PB9 / Motor 6NO (5v tolerant)
PPM/Serial RXPB0 / RC7PB1 / RC8YES (3.3v input)

Constraints

Current meter cannot be used in conjunction with Parallel PWM and Sonar.

CC3D

TriggerEchoInline 1k resistors
PB5 / RC4PB0 / RC5YES (3.3v input)

Constraints

Sonar cannot be used in conjunction with SoftSerial or Parallel PWM.

SPRacingF3

TriggerEchoInline 1k resistors
PB0 / RC7PB1 / RC8YES (3.3v input)

Constraints

Sonar cannot be used in conjunction with SoftSerial2 or Parallel PWM.