How to make the TFMINI rangefinder talk I2C

Curious to see if you get this working for Arduplane landing.

I suspect the short outdoor range ot the TFMINI - 6 Meter- is not sufficient for optimal airplane landing assist

That is what I suspected to be the case – I have not seen anyone successfully use it for this.

We got it working for arduplane flare assistance. Longer range would be ideal, but it works as intended.

1 Like

Good to know as i have one of these that I want to use for the same purpose. This was using i2c as per this thread? Were there any special settings that you used?

Hello, friend, if you interested in TFmini with I2C interface, we have an open task to develop/add the I2C protocol to the latest firmware for APM developer, welcome to check.

TFmini I2C version Datasheet:
02_TFmini-I²C-Datasheet V1.1 EN.pdf (401.6 KB)

Pls check my another Blog for more info:

1 Like

Hi everyone!

I just received a test batch of TFmini I2C versions.
Anybody managed to get these to work?
Seems that regardless of the RNGFND_ADDR set to (0x10 = 16) and setting the RNGFND_TYPE to any of the available I2C versions, it just dosn’t want to output any sonar values.

Hi

Does this method also work for the TF mini plus as well?

Thank you

Probably, if not you may need to reduce the data rate

Thank you for your help pporier, and just confirming this has been successfully used on a pixRacer if you’re using a UBEC or similar for power?

No need for UBEC if its just one TFMINI

Hello,

I am struggling with connecting the TFMINI Plus to Pixhawk Mini. I decided not to use UART version, due to lack of serial ports on my PX, but I2C.
I found out that the I2C does not work out of the box (on my Pix at least). I found the command 5A 05 0A 01 can switch the interface from serial onto I2C. Pressed the button and the data on serial port stopped updating. Looks like the working interface is now I2C.
Unfortunately ArduPlane that I am using still does not see it at any option withing I2C in rangefinders.
Any ideas how to properly set the TFMini Plus to talk to Pix directly via I2C (skipping the Arduino Pro Mini).

Thank you in advance for your help and support.
Hubert

Hardware:
Pixhawk MINI by 3DR (ArduPlane V3.9.4)
TFMini Plus

1 Like

I suggest you follow this thread

1 Like

Hello, great topic!
I got everything working. The pixhawk/missionplanner displays the distance correctly. But when it exeeds +/-2m it displays 0.13 and will not change anymore. When I restart the arduino pro mini (cut of power and reapply it) it willl display again, only if the distance measured is below +/-2m. In the Benewake GUI it measures a range that exeeds the 2m so the sensor should be fine.

Powering the arduino and TFMINI with an external powersupply at the moment for testing

Any suggestions?

Hello,
You have to find if the problem is on the sensor side or on the FC side.
Can you send static value above 2M just to check if FC reads ok?

1 Like

Thanks for the fast response.
When I set distance to 300 or more it keeps showing op normal in missionplanner (3 for 300 etc) so the FC part should be fine. The sensor displays distances of 4m+ in the benewake GUI with good accuracy.

In that case you can try reading and outputting on Arduino serial monitor

1 Like

I could try it out, but for now, I dont know exactly what I changed but it seems to work now. I ran some of the commands for the TFmini again in the GUI

Does Ardupilot 3.6.9 have native support for the TFmini i2c version? If not, is there a workaround with which I can use the TFMini i2c as the only rangefinder on the pixhawk?

I see the new driver has been merged but It’s not on a release yet you have to use Master (beta) release