HC-SR04 Sonar Rangefinder

the one I’ve tested before is i2c… maybe they have done different versions…

Should I connect it to the I2C connector?

Where do I connect the SCL and SDA of I2c?

Does it look like this?

HC-SR04

If so it’s not I2C, you would configure 2 GPIO pins. The link to the Wiki is clear about how it’s connected and configured.

And then after you get this cheap sensor working performance will be very bad and you will remove it…

3 Likes

if you sensor is i2c you can find sda and scl written on the board and you can connect it on a i2c splitter, if its gpio you need follow the pinout of the board with the pinout of the fc.
what fc are you using?

The flight controller is pixhawk.

Is the HC-SR04 sonar rangefinder i2c? :question:
Is it GPIO :question:

just attach pls you rangefinder so we can help you

Doesn’t it require an attiny or something like that, to make the HC-SR04 talk i2c? I saw HC-SR04 sold prefitted with an attiny, but most of them should be GPIO.
Anyhow, as Dave said, just get a supported lidar like the tfmini and never look back.

1 Like

a good option can be the tf mini s with a can node

1 Like

I think you are right. I tried a couple of these cheap sonar units several years ago and you get what you pay for. These can be had for $1 on ebay, so there you have it.

1 Like

I have the HC-SR04 Sonar Rangefinder attached to my drone.
At the time of purchase, only HC-SR04 Sonar Rangefinder was included

Hi

This one have a i2c interfaceScreenshot_20200722-220518_Chrome

Right. That’s the one Sebastian was referring to.

Is this not compatible with i2c?:question:

looking at your board my instinct tell me that your sensor is GPIO, the one with the arduino board can be wired on i2c.
In my opinion better you look for another rangefinder

Is this something for an arduino board?
Is it not compatible with Pixhark?

the pic of the sensor attach by fred_fr is with the Arduino board flashed with a code, so can communicate with the ardupilot firmware.

On the pics i’ve attach you can see its work…but i will not use it for fly

I will purchase and install an I2C compatible sonar.

You can look for a TF mini lidar or teranger evo 60, its up about the use you need