Sonar Maxbotix analog with Cube Orange

Hello,

I have asked the question in the Ardupilot forum before, but haven’t gotten an answer.

First, I want to operate an analog sonar with the Cube via the ADC connector.

I have connected a Maxbotix EZ4 analog sonar to the Orange Cube of my Rover via the ADC connector (ROVER firmware 4.1.2) but it is not taken into account.

My ultimate goal is to use this function by removing the sonar and using a microcontroller instead which will receive information from for example a bumper, a rain sensor, etc … to stop the Rover

I have performed several tests and it does not work.

When RNGFND1_TYPE = 0, I have 0 which is displayed in “sonarrange” and “sonarvoltage”
sonar_01

When I have filled in all the necessary parameters:
RNGFND1_TYPE = 1
RNGFND1_PIN = 14
RNGFND1_MAX = 700
RNGFND1_SCALING = 2.04
There are numbers that appear in “sonarrange” and “sonarvoltage”, regardless of whether the sonar is connected or not.
sonar_02

I tested the sonar signal (sonar connected to the Cube) with a multimeter and there is indeed a voltage variation when you vary the distance to the sonar.

I had read this post, I tested on pin 15, but it didn’t change anything:

I think I’m missing something, but I haven’t found it.

Do you have an idea ?