How can I add a mini sonar sensor GL041MT GL042MT to my ArduRover firmware?

Based on Ardurover firmware,
I am building and testing a USV myself.

Due to funding issues, USVs are being manufactured using cheap parts.

Due to the need for underwater sonar sensors,
I purchased a UART-based sonar sensor from AliExpress and am trying to connect it, but it doesn’t work as I want.

It would be great if you could share the method.

I would like to measure the water depth using the sensor I purchased and check it in GCS.

If this sensor is compatible, you will be able to test the sonar function for a small amount of money in the future.

What direction should we move forward?

Below is information on the sonar sensor I purchased.


The sonar sensor I want to use does not have an official Ardupilot document.
Oh, my…

Let’s focus on it.

If the user requests it, is it the content that adds the equipment?

Looks like a nice project for driver development :slight_smile:

I ordered a similar one, I’m waiting for it to arrive. Apparently, you will need to do something that would be transmitted via the nmea protocol.

Simply setting SERIAL communication settings and RNGFND1_TYPE to NMEA does not work.
I don’t know for what reason.

You need an intermediate device to convert (arduino for example) to nmea.

What do you think?

It would just need the checksum modified to work with my i2c adapter.

First, let’s transmit using the NMEA protocol using Arduino.
Chet, I’m going to try using GPT.
Because I am an ordinary person without basic knowledge.

I have already done it, I already have a i2c sonar adapter, it just needed the checksum modified as the protocol is basically the same between the GL042MT and SR04T. I haven’t got a sonar to test it with.

1 Like

Yes, you can do as I suggested, but you can also do as @geofrancis says.

Is it normal to connect like this?

I’m sorry I don’t know much.

Ardurover Parameter settings
SERIAL2_PROTOCOL->9 (Rangefinder)
SERIAL2_BAUD->9 (9600)

Arduino source code settings
#include <Wire.h>
#include <SoftwareSerial.h>

#define I2C_SLAVE_ADDR 0x09
//Use ardupilot rangefinder set to lighware i2c address 9.

int pinRX = 10;
int pinTX = 11;
SoftwareSerial mySerial(7, 8);
unsigned char data_buffer[4] = {0};
int distance = 0;
unsigned char CS;
uint8_t Index;
byte received;

Which method is better?

A method that does not burden both Arduino and Pixhawk.

have you used Arduino before? do you know how to wire i2c?

Connect like this,

Can I set this up in Mission Planner?

set the rangefinder type to lightware i2c and its address to 9 in mission planner parameters.

thank you

RNGFND1_TYPE = 7(LightWareI2C)

Let’s modify the parameters like this.

When you look at the photo I posted, is the way to connect them the right way?

yes your diagram looks correct.