SparkFun Forums 

Where electronics enthusiasts find answers.

Questions &/or issues related to products in the Distance & Infrared category should be posted in this forum.
By agcopley
Hello all,

In my stupidity, I bought a qwiic enabled TF Mini Lidar when I really wanted
the non-qwiic enabled version. What would be the easiest way of de-qwiic ifying
the sensor? Does Spark have a cable that would plug directly into the TF Mini and
give me 4 pins?. I tried support but didnt get a reply

Many thanks in advance!
By agcopley
Hmmm, it's a nice idea, but the power booster on the Qwiic Lidar doesnt have a female Qwiic connector!
I could splice the wires or use a Qwiic adaptor, but decided
to go the whole hog and buy the Qwiic Pi hat, which would, in theory, allow me to connect more than 1 Lidar

Unfortunately I couldn't get it to work:
After installing the relevant software and attaching the Pi hat:

Ran i2cdetect -y 1 and device detected at address 10
Ran i2cget -y 1 0x10 with result Error : read failed (tried with both my TF Minis)
Ran ic2detect -y 1 and device No Longer detected
Tried with both Minis connected ic2dtect only shows 1 at address 0x10 (the other not detected)

Now I am at a loss and don't want to buy any more kit in case the problem is at a lower level, e.g. the I2c programming
of the Lidar or the Pi Hat itself

Any advice welcome!
User avatar
By TS-Chris
Are you plugging your I2C cable directly into the module, or do you have the boot board connected and you're connecting to the module through that?
User avatar
By TS-Chris
OK, your connections look correct. I doubt that the Qwiic Hat is the issue though since it really doesn't have anything on the board that could fail and cause trouble.

One thing that could be a problem though is that the Qwiic Hat can only provide up to 600mA of current and it looks like the TFMini needs up to 800mA to operate. What I think might be causing you trouble is there's enough current to see the TFMini, but not enough to actually make it function. You're probably going to need to come up with an external 3.3 volt power source for the TFMini that can provide the needed current. Sadly, we don't have a board that does that.
User avatar
By ramonm
I am not too sure that it is good practice to post a similar question on someone else's thread. If I am trespassing, please excuse my ignorance.

I am having a similar issue with the TFMini qwiic where I am unable to get the device to work for me. I think that I am correctly connecting the device because I can issue a i2cdetect and I get a 0x10 from the address block. I am writing a simple C program that reads a distance and I have tried several different combinations of one of your Arduino examples (I am attempting to translate the code from Arduino sketch to C for the Raspberry Pi). I also looked at the datasheet for the qwiic device but I have not made it work. The Arduino sample sets the connection speed to 115,200 bouds but I have no way of doing that from my wiringPi library and perhaps that is the issue.

I am not directly connecting the TFMini qwiic to the Raspberry Pi. Instead, I am making this connections to a breadboard that is connected to both devices.

Here is what I do:
#define I2C_ADDR 0x10
int main()
if (wiringPiSetup () == -1) exit(1);

fd = wiringPiI2CSetup( I2C_ADDR);
wiringPiI2CWrite(fd, 0x01); // From your example and datasheet this should be setting MSB
wiringPiI2CWrite(fd, 0x02); // This should be setting up LSB
wiringPiI2CWrite(fd, 7); // Data length 7 bytes for distance

int x = wiringPiI2CRead(fd);

The x gets a -1 and the device stops working until I re-plug the power.

Any help will be greatly appreciated.
User avatar
By ramonm
I have the exact same issue that agcoplay has but I should be able to supply power from a difference source to the TFMini (I have a buck converter). I will try it and let you know my results.
By agcopley
Broke out the power cables on the 5v side of the TF lidar and powered up directly from the 5v Raspberry rail (disconnected Qwiic hat from Pi and connected to i2c on Pi with some jumpers, allowing me connect to Pi 5v headers)...

Exactly the same result and the Pi 5v has no problem in supplying 800ma!

Ran i2cdetect -y 1 and device detected at address 10
Ran i2cget -y 1 0x10 with result Error : read failed
Ran ic2detect -y 1 and device No Longer detected

So the suspicion of TF-Chris is looking suspect.
Next step is to bypass Qwiic Pi hat completely.
By agcopley
Ok, bypassed qwiic hat completely, breaking out Gnd, 5v, SCL,SDA on the 5v side of the TF (eliminating booster)
and the result is still the same

Ran i2cdetect -y 1 and device detected at address 10
Ran i2cget -y 1 0x10 with result Error : read failed
Ran ic2detect -y 1 and device No Longer detected

I'm looking for some Sparkfun input here, becasue I am now at a loss
User avatar
By TS-Chris
We've never tried to use the TF Mini with a Pi before so we don't have any examples of how to talk to it or what to expect when you enter the commands you're using.

I'd suggest testing the TF Mini with an Arduino according to the directions in our hookup guide as a sanity check to see if the device is working. Let us know what happens with that and we will go from there.
By agcopley

Tried with arduino 101 and sketch provided and with same result on Serial Monitor
'read fail'.

Power all checks out with transmitter led visible in the TF. Basically these
are duds and I need to escalate this. Chris can you provide a contact in SParkfun so
I can get some resolution?

User avatar
By TS-Chris
Have you tried with an Uno or SparkFun RedBoard like we use in the tutorial?

That would be the baseline for determining if the sensor is working correctly.

If you duplicate the setup in the tutorial and you're still having trouble, fill out the form on the right hand side of this page and include your order number and in the "why do you want a RMA" box put a brief description of the issue and the URL to this page and we can get a RMA setup for you.
By agcopley
1. 90 days have passed since my order (I have wasted 3 months trying to get a solution) so the RMA is no good for me
2. It'll cost me as much to send the units back as it cost to buy them
3. All of your solutions seem to suggest buying more of your kit
4. The basemark for the TF Lidar i2c is NOT that it only works with your setup (nowhere did I read this in your website). The device is i2c enabled or its not.

To sum up
I give up