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

| Description | Worth |
| 1 mass | Ground |
| 2 Supply voltage | 4.6V-6V |
| 3 UART Input | TXD |
| 4 UART Send | RXD |
Serial port data
| Description | Worth |
|---|---|
| Building rate | 115200 |
| Data bits | 8 |
| Stop bits | 1 |
| Parity check | N/A |
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.

| Arduino | GY530 |
| 5V | Vehicle Identification Number |
| Ground | Ground |
| Pin D0 | TX |
| Pin D1 | RX |
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.
| Arduino | GY530 |
| 5V | Vehicle Identification Number |
| Ground | Ground |
| Pin D11 | TX |
| Pin D10 | RX |
Test programme
Select, compile and upload test program to Arduino. Possibly change pins and serial port.

Here is my draft
https://github.com/sfambach/TF-Mini-Lidar
And this is what comes out on the console:

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
- GY-530 VL53L0X Laser Rangefinder
- RC car with PS2 controller
- Arduino – HC-SR04 Distance Sensor
- Controlling the US-100 distance sensor with a Raspberry Pi 3
- US-100
- HC-SR04 Distance Sensor
- US-015
Sources
TFMini Library with ESP Adaptation
https://learn.sparkfun.com/tutorials/tfmini—micro-lidar-module-hookup-guide/all