How is your configuration of the I2C pullup resistors on the SDA and SCL.
Pullups are needed on the end of the bus but but on all modules. If all modules have thete own Pullups than all these resistors are in parallel and it is possible that this is to much load on the port pins.
Thank You @Juergen-Fahlbusch for the response but I’m not using any resistor in my connections. Do i need to add separate resistors for all 4 rangefinders?
I’m using tf luna lidar and it’s documentation doesn’t say that i have to use any pull up resistors…..
First you have to analyse what you have. On any board or module using I2C these resistors can be mounted or not. So you have to check if our FC, your Splitter and / or your Rangfinder are equipped with these resistors and not. As you don’t sent any information about your complete HW I cannot answer this question.For the TF Luna some information maybe is available on the Benewake Homepage but it is necessary to register yourself on the page.
Did you checked what happens if you only connect one rangfinder directly to your FC. Is it the same behaviour?
@Juergen-Fahlbusch Hi sorry for the half information I’ll tell you about my full setup and problem statement now….
I’m using a pixhawk cube orange with 4 tf luna lidars connected and powered through pixhawk itself. On the i2c port of pixhawk i have connected the i2c splitter and all 4 sensors were connected to it and when i powered it for the first time all sensors worked properly but when i closed my drone(it’s a fully enclosed drone with every components packed) then my GCS gave an error “rangefinder1 not found” so i disabled rngfnd1 but then error comes for”rngfnd2 not found” and so on…..
So after that I thought this was a power issue so i connected a separate power BEC which provided 5v to the splitter and SDA & SCL were connected to pixhawk itself but now the error “rngfnd1 not found” was still there and only one was was read by the GCS.
And I’m still stuck at this part and for the resistor I read the manual it doesn’t say that i need to add any resistor but the sensors has pullups for SDA and SCL and my splitter also doesn’t have any resistor. And I couldn’t find anything related to resistor online as I don’t know how to make it’s connection.
I am also not an expert on rangfinders but I was professional electronic designer.
So missing or wrong I2C resistors is just only one possibility.
Using a additional 5V source via a BEC is also a good idea as each Rangefinder consume some hundret mA. But in this case did you also connect the GND between your FC and the rangefinder modules or only the SDA and SCL. The same GND needs to be always connected to all parts.
If you open your drone again, are the than again the rangefinders are seen by the FC again?
And is this connection stable as long your drone is open?
Some I2C splitter have the option to solder additional pullup resistors if needed. Does your splitter has this option?
What kind of measurement equipment you have? Multimeter, Oszilloscope ?
@Juergen-Fahlbusch Yes when the drone was open the connection was working but i haven’t checked it like you said it.
When i reliased that this could be a power issue then i connected a BEC for power but after your last comment I checked each sensor connecting simontaniously to pixhawk i2c and 2 of the sensors were working and detecting fine but 2 were only powering up but not able to detect.
And i have connected my voltage and gnd wire to BEC and SDL & SCA to pixhawk i2c. Are you suggesting me to connect a gnd wire also with my pixhawk i2c along with SCL & SDA?
And for the resistor part I don’t think my i2c splitter has the option to solder additional pull ups..
And i have multimeter…. I don’t know how to use oscilloscope
most modules have i2c resistors. the pixhawk also has, you dont need to add them.
does it work with only 1 lidar, if yes then the issue is with address. each i2c device needs a different and unique address and all lidars of same model have the same addresses (if you haven’t changed)
most splitters just connect in parallel, and are not a multiplexer.
but since you are saying that 2 get detected this might not exactly apply
@aksince2003 yes, I recommend to connect all GND of FC, Rangefinders and BEC together. It depends on the BEC, if it is isolated or not. Most BEC are not isolated and so the BEC GND is same as Battery and FC GND.
Which splitter are you using, can you show good photos from both sides.
For both non working sensors if you only connect them seperate to the FC. Are they t than working?
I assume your I2C adress settings was corrrect as you stated in the very begining all four rangfinder are working ok, is this changed?
Here are the images of splitter which you asked for.
And for non working sensors when I directly connected them to FC only then I found out that 2 were working and 2 weren’t. Btw the 2 non working are powering up but they are unable to detect.
And no I didn’t do anything wrong with the i2c address. I didn’t changed anything
@Ishitbh Hi thanks for the response and yeah I think I haven’t done anything wrong with the address because initially all 4 rangefinders were working when I powered them directly through pixhawk. But when I got the error “rngfnd1 not found” later in the field. Then instead of checking each sensor one by one I just thought it’s a power issue so i removed power and gnd from pixhawk and connected them to a BEC. And after setting up I was still getting the same error.
Then I checked the sensors one by one by directly connecting them to pixhawk i2c then I found out that 2 were working fine but other 2 were just powering up but not able to detect anything.
Now we have a new scenario to analyse. @Ishitbh is right, if you use more than one module on the same I2C you must have different I2C adresses for each module. As the modules from same supplier normally come with the same default address these must be changed and also mostly this don’t happen automatically. So first we must ensure that your rangefinder have seperate I2C addresses.
So I recommend first test wich each rangefinder to connect only one by one to the FC and check if it is identified by the FC and which address is used.
You can see the adresses in the mission planner tab setup >> Basis Hardware / HW ID
like:
Even with individual connection, the 2 sensor don’t work it means that either the sensor is disconfigured (very very unlikely), or the wiring sda scl has issue (check continuity using multimeter) and/or the lidar is dead (also unlikely if they are new)
So @Juergen-Fahlbusch@Ishitbh Hi, yes there was continuity error and now all 4 sensors are working when i changed the wires. But still 4 of them doesn’t work when i use them with splitter.
And Yes i have given diffrent address for each sensor as i can see in HW ID tab….. Or do i have to change this DevID also. Can you please confirm?
What happened today I just connected and powered 2 sensors through pdb and they were detecting and working but when later in afternoon when i connected all 4 then again “rngfnd1 not found” error was coming. So I then connected just 2 but error remains there……Now I’m again in same loop
This is what benewake further replied for my query so this means I can connect 4 lidars.
“ Good day !
Please note that for 4 sensors you need to provide standalone power supply, you can not power them by I2C then. Please do not use your flight control to output 5V for so many LiDARs, there’s current limitation and will affect the performance. Thanks.
Best regards. “
And what I understand that they are suggesting me to connect 4 individual BECs for all 4 sensors for a proper supply.
So did you set seperatly the different I2C adresses on the four rangfinders as written in the document:
We take two TF-Luna as an example in this passage and set the address 0x10 and 0x11 separately.
I understand this sentences, that this setting will be done by a seperate tool not by the FC but the FC also must be set to these addresses as mentioned later in the document.
The DevID is something different. It is more a kind of SerialNo of the module.
Regarding the power, yes, it depends on the FC if it can deliver enough power for all modules. So to use a seperate BEC is of course a good idea.But also in this case it depends on the BEC how many modules it can support. From the Datasheet a single TF Luna takes up to 150mA, so in total the BEC or FC must deliver more than 600mA for the four modules.
So first we must ensure that your HW and your SW settings are correct.
I have seen in the TF Luna manual that it can use either serial UART communication or I2C communication on the same pins. This is selected by pin 5 on the TF Luna. If this is GND I2C is used. Is this done on all of your four modules?
If so than connect as I requested one by one to FC and read the DevID and the Address via mission planner and report or show it here.
So step by step, I know it takes lot of time also maybe on our different local times