How to configure 4 i2c sonar sensor (sensor type: GY-US42v2)

Does you now how to add an i2c sonar sensor?. I’ve got 4 GY-US42v2 Sonar in a splitter, then i connected the output of that splitter to the original splitter of the main i2c port provided by the pixhawk 2.4.8. I still can’t find how to configure or add that four sensors in QGR. Hope you or anyone else can help me please. I’m using QGroundControl.


Google is your friend :slight_smile:
I just type GY-US42v2 and found this link : Interfacing the GY-US42V2 sonar

And I am reading:
On the SRF02 the I2C address can be modified, but the sequence for doing so doesn’t work with the GY-US42V2. This means one cannot use several GY-US42V2 on the same I2C bus. Too bad.

…so I guess its time to work with other sensors…
@geofrancis is the specialist

1 Like

Thanks a lot! Now i’m gonna see for further solutions with other sonar sensors.

You would have to set them to serial mode rangefinders and connect each to its own serial port. if your short on serial ports you can add a CAN port expander to give you 3x more serial ports.

or use i2c multiplexer to address multiple i2c devices. Like here

Another option is to take an arduino and use it to convert the serial range finder to i2c, then you can give it any address and run them all on the i2c bus. This is for a different serial sonar but could be modified.

This is based on @ppoirier s original code

1 Like

I really appreciate these kind of solutions, I’ll work on it. Thank you very much and I will keep you informed about the results. Cheers!