TFmini Lidar connection


#1

Hi,

I purchased a TFmini-s lidar from amazon which seems affordable and popular:
Amazon.com: MakerFocus TFmini-s Micro Lidar Module 0.1-12M Lidar Range Finder Sensor Obstacle Avoidance Sensor Tiny Module 1000Hz Single Point UART I2C IO Compatible with Pixhawk Ar duino and Raspberry Pi : Electronics

included came a 4pin UART or a 4 pin I2C:
image

The Ardupilot documentation says I can connect the lidar to the pixhawk 6 pin serial port but I only have the 4 pin I showed before.
Benewake TFmini / TFmini Plus lidar — Copter documentation (ardupilot.org)
Noticed that the pixhawk “USB” or simply called “I2C” has 4 pins, can I use that instead of the serial 4/5?
or can I use the other connectivity such as using the pins that can connect to the serial raspberry pi?

this doc explains someone connected to an arduino using serial or purchased a USB which I dont have yet: image

Also in mission planner, I dont see the range finder parameters such as address


#2

You can directly connect to the Pixhawk or RPi I2C connector, but I would recommend using a splitter as in the video since you might want to add other devices.
The RNGFND parameters should appear once you select the type as described in the course video.
Also :


And don’t forget to configure I2C in raspi-config if you use the RPi.


#3

understood, Ended up just cutting in half one of the 6 pins connectors I had leftover from the kit.
the connectivity to pixhawk is exactly as the picture now. I do see a little red light inside the lidar so assume got it right.

enabled i2c in RPI raspi config, rebooted,

when I run i2cdetect -y 1 I get zero connectivity. is all: – -- – --

how can I enable or test the lidar connected to pixhawk inside rpi?


#4

sorry everyone,
I found that I pulled too hard in one of the little cables that came out the plastic ensemble connecting to the pixhawk. After changing it, I configured the mission planned and seems to be working.

noticed that for my telemetry measurements I should now start reading altitude from “sonar range” parameter instead of “altitude” as it doesn’t overtake the “altitude” parameter. That one keeps using the barometer.

that said, when I run the i2c detect in RPI is still clear of results. is it because I am using a UART connection via serial 4 port in pixhawk?


#5

UART and I2C are two different protocols. Good you are getting output on MP.