How to make the TFMINI rangefinder talk I2C

Hi, rickyg32. You are right, TFmini now upgraded to new version with IP65 protection. More details below:

"In order to meet the user’s requirement in harsh conditions, we newly added IP65 level waterproof shell to TFmini!
In addition, the switching value function is also added. First, let’s take a look at the changes in appearance.
TFmini%20LiDAR%20sensor%20IP65%20protection%20outdoor%20use

Left one is the update, is it cool? : )

Those who don’t know TFmini before can get familiar with product through the following introduction.

TFmini Product Introduction
TFmini is a milestone for Benewake to promote the process of low cost LiDAR.
With its unique optical, structural, and electronic designs, the product possesses 3 major advantages: low cost, tiny volume and low power consumption. The built-in algorithm adapted to indoor and outdoor environments can guarantee an excellent ranging performance at a low cost and in a tiny volume, which highly expands the application fields and scenarios of LiDAR and lays a solid foundation for future “eyes” in the smart era.

For more information, please visit our website at http://www.benewake.com/tfmini.html

The highlights of TFmini updating

  1. Protective shell

  2. Switching value

  3. Protective shell
    In order to meet TFmini’s requirement in some harsh environments, we have launched protective accessory that allow the TFmini to meet IP65 protection level, while only increasing a little volume.

  4. Switching value
    We update the firmware so that TFmini can output switching value. Current functions are:
    ① The standard UART communication can be switched to the I/O push-pull output via a serial command, and it can also be switched back through the command to achieve one-touch switching.
    ② The distance threshold value of switching can be changed via the serial command to increase the flexibility of uses;
    ③ Default output states: if there are obstacles (range value within the certain distance), TFmini output high level of 3.3V; if no obstacle or out of range (ranging distance outside the certain distance), TFmini output low level of 0V. The the output level can be changed according to requirements.

Coming soon: Wide power supply voltage of 5-28V; upgrade type TFmini which meets IP65 protection level without customized protective shell; output switching value signal without firmware update requirement and switching value output high level up to 24V. "

1 Like

Hey Siya
My Lidar just arrived. Can’t wait to give it a try. Just make note it doesn’t mount the same as the original version.

1 Like

hi, seems so big, will the oldest one be still available? do not need IP65. Size matters.

It’s not that much bigger then the original. But I get the concern.
The original is still available.
I am building an all weather quad so IP65 is important to me.

3 Likes

nice, I like the yellow cover, home made?

1 Like

Hi, chris661. The old version TFmini is still available as it’s very popular LiDAR.

1 Like

@chris661 I finally flew outside with my 330 quad and 2 TFMINI on I2C (adress112 & 113) with lightware I2c emulation.
One as altimeter (orient 25) the other as avoidance (orient 0 looking forward) and it works like a charm on shadow or on sunlight

1 Like

Hi, Pls check the upgrade TFmini with IP65 case dimension below for reference.

1 Like

Perfect thank you Siya

Unfortunately it won’t fit on this current build, but there will be other uses for it.

1 Like

Hi,
I have one Maxbotix I2CXL EZ4 and want to connect it to the Pixhawk on my drone to use it as collision avoidance. Using Mission Planner how can I make the Pixhawk read the distance of the sonar to use it for the collision avoidance? I know I have to use de Mavlink DISTANCE SENSOR message, how is that done with Mission Planner? Using the terminal?

Thanks for your time.

great, what did you set as MAX_RANGE? Or what was the max reliable distance you were able to measure outside? Thanks.

1 Like

Yes Chris. Sorry just saw your question

Patrick
Can you tell me the command set I need to restore the TFMini to working off a serial port.
I have a second machine I am going to mount the Mini on but I want to run it off a serial port.
So it needs to be in the correct mode running the correct measurements. not sure what those commands are.

first I am not sure what mode it should be in.
The command of standard output is 42 57 02 00 00 00 01 06 I think this.
The command of pix format output is 42 57 02 00 00 00 04 06

Second not sure if it should be MM or CM. I see the gui is not in pix mode and displays meters.
Modify output unit to mm output: 42 57 02 00 00 00 00 1A I think this
Modify output unit to cm output: 42 57 02 00 00 00 01 1A

Also do I need to enter config mode before making the change.
Enter cmd 42 57 02 00 00 00 01 02, wait for sampling go down to 0 before sending other cmd
and 42 57 02 00 00 00 00 02 for quit config
Not sure thats needed

1 Like

@rickyg32
The command of pix format output is 42 57 02 00 00 00 04 06
Modify output unit to cm output: 42 57 02 00 00 00 01 1A

Enter and quit command mode, actually I never had to use (maybe you need with the new firmware ?)

1 Like

Thanks Patrick.
Seems to still give me trouble. Gives me a bad lidar health and a fixed distance of 1.24 meters…not changing.
Some observations. Sending the Pix string crashes the gui. If I send the enter config command then the pix mode change I get no crash.
Today I downloaded the most current gui and firmware updater. Will update the firmware and then try again.

The BENEWAKE gui seems to hangs sometimes, I prefer using an advanced terminal like RealTerm

What version are you using.
I tried to install one and it crashed all the time. Never mind, I got it to install. It didn’t register with the OLE automation correctly. Fixed now

I have no clue how to use realterm…best start reading. lol


Starting to head in the right direction.
I can see on the bottom left that its measuring 960 MM…which is correct based on my tape measure.
I also know the scale on the right never changes.
So I think it needs to be shifted to CM…so thats next to solve
command 42 57 02 00 00 00 01 1A
Second I think this needs to be in Pix mode for Pixhawk…is that correct. As it doesn’t seem to shift into Pix mode.
command 42 57 02 00 00 00 04 06

Pixmode is clear text, so it can be read with a standard terminal, so if you read cm in a standard terminal, it should work as lightware serial on ardupilot

So right now I seem to be reading MM and won’t change to CM.
Also won’t change to Pixmode…grrrrr
It’s like it doesn’t want to take any commands via the gui and I just don’t know enough bout realterm to use it.
Can you tell me how to send the commands via Realterm. Perhaps that will resolve it