Wiki

Clone wiki

ALX_HC-SR04_pixhawk / Home

HC-SR04 -> Pixhawk Adaptor using an Arduino Nano

HC-SR04_arduinoNANO_pixhawk.ino

v1.0

Arduino Nano sketch to integrate the HC-SR04 sonar module with the Pixhawk flight control board.

Requirements:

The Arduino outputs a PWM signal representing distance (5v peak).

The Pixhawk expects to see an analog voltage (MAX 3.3v on ADC IN), the Nano analog output pins are not true analog, they are PWM.

A conversion circuit is required to both step down the voltage and convert signal to near analog DC signal. (A voltage divider and low pass filter)

Conversion circuit:

schemeit-project.png

The most challenging requirement is most likely sourcing the 5 pin DF13 connector that is needed on the pixhawk.

Further comments and instructions are provided in the source header.

Updated