TF Mini Laser Rangefinder

Last Updated on 29. January 2024 by Suffocation

At this point, I'm testing a rather expensive sensor for over €36, which leaves the other distance meters in the dust ;). The sensor has a tiny connector (GH1.25-4p SMT type). Two cables are included for this. One with two GH1.25-4p connectors and one with the usual pin header, which allows the sensor to be operated directly on the Arduino. The sensor is supplied with 4.6V – 6V. Therefore, use on 3.3V microcontrollers is only possible via a logic level converter.

I actually wanted to test the I²C version, unfortunately the UART version arrived here, which is why I'm presenting it now. Since I couldn't find any documentation on the I²C version, I'm still not sure if I²C would also be possible with the current sensor. If you know more, leave a comment. )

Facts

Sensor name TF Mini
Type Lidar
Distance [mm] 30 – 12000
Accuracy [mm] Off. <6m > entf. >6m = 60
Angle [Degrees] 2,3
Voltage [V] 4,5 – 6
Current [mA] 120
Dimensions (L/W/D) [mm] 42 x 15 x16
Weight [g] 4,7
Interface UART
Frequency/ Wavelength 940 nm

Connections

TFMini BSource: Data sheet
DescriptionWorth
1 massGround
2 Supply voltage 4.6V-6V
3 UART InputTXD
4 UART SendRXD
TFMini Connections with Label

Serial port data

DescriptionWorth
Building rate 115200
Data bits8
Stop bits1
Parity checkN/A
TFMini connection data for the serial interface

Areas of application

  • Distance measurement
  • Cartography (up to 12m)
  • For drones for altitude determination
  • Pass control
  • Contactless triggering

Views

Programming

Libraries

Arduino

I'm Librarian Are there also some libraries for the FTMini? I had problems with the one from Peter Jansen. That's why I chose the second entry for my first test.

Alternatives

Ultimately, I got Peter Jansen's lib working. So here's the link to the library and the bugfix.

https://github.com/opensensinglab/tfmini

Bugfix: https://github.com/opensensinglab/tfmini/issues/9

ESPx

The Peter Jansen library should also work with the ESP, although for this, all Serial.print(ln)’s from the .cpp file will probably have to be removed.See alsoI’ve forked the project and incorporated both the print line IDs and the checksum bug fixes. Unfortunately, I haven't been able to test it yet.

https://github.com/sfambach/tfmini_esp

Wiring

Here is the wiring of the sensor via the UART. Unfortunately, the sensor looks a bit different from the original, so please note the pin assignment in the table below.

TFMini Schematic Connection
ArduinoGY530
5VVehicle Identification Number
GroundGround
Pin D0TX
Pin D1RX
Connecting TF Mini to Arduino

Since the UART is also usually needed for console output, using a software UART is recommended for the Leonardo/Uno board. With this, the RX/TX pins can be chosen almost freely, for example pins 10/11.

ArduinoGY530
5VVehicle Identification Number
GroundGround
Pin D11TX
Pin D10RX
Connecting TF Mini to Arduino

Test programme

Select, compile and upload test program to Arduino. Possibly change pins and serial port.

Selection Example Program of the TFMini Library

Here is my draft

https://github.com/sfambach/TF-Mini-Lidar

And this is what comes out on the console:

TFMini Console Output

Problems

No connection

Check the wiring and simply swap RX and TX.

Miscellaneous

Telegramm Aufbau

[0x59, 0x59, Length low, Length high, Strength low, Strength high, reserved, Signal Quality, checksum]

  • Every telegram starts with two bytes 0x59 and ends with the checksum
  • Distance = (High length << 8) + Low length.
  • Strength = (Strength high << 8) + strength low.
  • Reserved = means not in use.
  • Signal Quality = 0, 255.
  • For the checksum, all bytes are summed up, exclusively of the checksum and the header (length low + length high +.

Test programmes (UPDATE 19.07.2021)

I have created a GIT repository with a few test programs that are intended to facilitate commissioning.

https://github.com/sfambach/TF-Mini-Lidar

Frizing Parts

There's a Fritzing part on Git, but unfortunately, it doesn't quite fit.

https://github.com/PulsedLight3D/LIDAR-Lite-Fritzing-Part

Conclusion

The sensor works and has an unbeatable range. Unfortunately, it's not very precise and the price is also very high at ~€36. However, if you need to go beyond a sonar sensor's range of 4 metres and require quick measurements, you'll find an ally in this sensor.

Similar

Sources

Manufacturer's website

Technical Support for TF-MINI

Data sheet

Fritzingpart

TFMini on Git

TFMini Library with ESP Adaptation

Arduino Library

https://learn.sparkfun.com/tutorials/tfmini—micro-lidar-module-hookup-guide/all

https://github.com/opensensinglab/tfmini/issues/6

Leave a Reply

Your email address will not be published. Required fields are marked *