Servers by jDrones

How to make the TFMINI rangefinder talk I2C

(Luis Miguel González Fernández) #182

Thanks again. i will give it a try maybe tomorrow.

(Luis Miguel González Fernández) #183

Hi again.
Work in progress. I’ll upload some photos showing final product :smile::smile:.
Do you think that a UBEC rated for 5v 1Amp will be enough in order to power TFMINI + Arduino Pro Mini + Red Led ?

Thanks in advance.


(ppoirier) #184


Yes no problem, the TFMINI Average current is 120 mA

(Luis Miguel González Fernández) #185


Almost done.

I’ve made a minor modification to the arduino sketch in order to only toggle LED state every 5 samples read from the TFMini. Without this, LED keeps always on.

(Nathan E) #186

Hello @ppoirier,

Could you please give a recommendation for the min and max signal strength thresholds that you use and if you use a range limit? I seem to be having trouble with false intermediate-distance noise readings on arduplane causing incorrect ground distance readings momentarily.

I am able to send commands, but I’m not entirely sure what the best settings are. I’m also a bit confused about what to enter with the commands based on the user manual. EE and FF thresholds aren’t the most clear to me.

As of now, I am entering the following:
42 57 02 00 00 00 01 02 (Enter configuration mode)
42 57 02 00 00 00 04 06 (Pixhawk format)
42 57 02 00 00 00 07 11 (Long distance mode)
42 57 02 00 50 50 01 19 (Range limit enabled, threshold 50??)
42 57 02 00 50 00 00 20 (Lower limit of threshold 50??)
42 57 02 00 20 00 00 21 (Maximum signal strength threshold 200??, 0cm sent when max)
42 57 02 00 00 00 00 02 (Exit configuration)

Is this correct?

Ideally, I only need a very reliable reading between 0-6m. Right now even at 5m, I’m getting random noise down to 1.5m, etc. I am connected to a serial port, but my understanding is that the data should be the same.

(ppoirier) #187

It really depends on the use case; but basically what is the surface are you flying over ?
Did you check the signal with the Benewake GUI to confirm you have these glitches on the same surface ?
On the same interface you can see as well the signal strength, that may help setting values, but generally it works as factory default.
Most of my tests are done using a quadcopter tat low velocity (5-10 M/s) over grass and I can fly up to 6 Meter no problem.

(Nathan E) #188

Grass and 2m tall corn. I can’t seem to repeat the behavior on the ground with the GUI. I’m flying at 10-15 m/s

(ppoirier) #189

Just make sure you power supply to the TFMINI is stable (might some filtering like 100 microfarad capacitor).
15 M/S might be too fast for the ToF reading averaging, try to correlate noise-vs-speed on the logs

(Nathan E) #190

I’m powering it with a Mauch BEC. I’ll have to run more tests. Do you think my settings are appropriate and correctly sent?

(ppoirier) #191

There is just one way to know for sure, looking at the log

(RickyG) #192

wow learned a big lesson today.
When running the lidar, make sure its on it’s own 5vdc bec. I have been struggling for weeks with a quad that won’t measure current and today I disconnected the lidar and current sensing started working.

Tomorrow it will be on it’s own supply…dang

(Marc Dornan) #193

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

(ppoirier) #194

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

(Marc Dornan) #195

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

(Nathan E) #196

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

(Marc Dornan) #197

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?