Multiranger deck

Discussions about all things Bitcraze
Post Reply
Pdotdeep
Beginner
Posts: 9
Joined: Sun Oct 13, 2019 3:58 pm

Multiranger deck

Post by Pdotdeep » Wed Dec 25, 2019 7:35 am

Hi I wish to use the multiranger deck outside of the context of a crazyflie. I wish to connect it to a raspberry pi using i2C and read the sensor values through it for some other application. Is this possible? if yes which pins should i connect to?



kimberly
Bitcraze
Posts: 253
Joined: Fri Jul 06, 2018 11:13 am

Re: Multiranger deck

Post by kimberly » Fri Dec 27, 2019 10:41 am

Hi!

So if you check out this page: https://www.bitcraze.io/docs/cf2_expansiondecks/, you can see which pins the multiranger usen(under deck pin allocation), which is indeed i2c. On the same page under 'Expansion port pinout', you can see which pins are what from the crazyflie point of view, but the same goes for the deck ofcourse.

The multi-ranger gets it's power from VCOM but be very careful to not give it anything more than 3.0 V. Anything more will break the deck!

arnaud
Bitcraze
Posts: 2275
Joined: Tue Feb 06, 2007 12:36 pm

Re: Multiranger deck

Post by arnaud » Fri Dec 27, 2019 11:37 am

You can also find the schematic and datasheets on the wiki: https://wiki.bitcraze.io/projects:crazy ... ultiranger.

3V3 of the raspberry pi should work well and you need to feed 5V to VCOM.

Though, you definitely cannot use the deck with a 5V system like an Arduino UNO. The deck has to be used with a 3V system only.

Pdotdeep
Beginner
Posts: 9
Joined: Sun Oct 13, 2019 3:58 pm

Re: Multiranger deck

Post by Pdotdeep » Sat Dec 28, 2019 12:01 pm

arnaud wrote:
Fri Dec 27, 2019 11:37 am
3V3 of the raspberry pi should work well and you need to feed 5V to VCOM.


Wait do you mean u cannot use 5V?

Pdotdeep
Beginner
Posts: 9
Joined: Sun Oct 13, 2019 3:58 pm

Re: Multiranger deck

Post by Pdotdeep » Sun Dec 29, 2019 10:07 am

Also the datasheet doesnt really seem to have alot of details regarding the details of the data that is transmitted and the device addresses. I did an i2C scan using an Arduino and got a bunch of addresses(see below). (Right now i am powering the multiranger deck using the cf itself just be extra cautious and to get see if i am able to read and interpret the data that i am getting from the sensors ) but i am unsure as to how many bytes of data i am supposed to be probing for and other details like the internal register address where i should read the data from and so on.

I2C device : 0x20
I2C device : 0x31
I2C device : 0x32
I2C device : 0x33
I2C device : 0x34
I2C device : 0x35
I2C device : 0x50
done


Can anyone provide help here?

arnaud
Bitcraze
Posts: 2275
Joined: Tue Feb 06, 2007 12:36 pm

Re: Multiranger deck

Post by arnaud » Tue Jan 07, 2020 10:29 am

No you cannot use this board with 5V system, you should not connect it to a 5V I2C bus (ie. an I2C bus with 5V pull-up), if you do so you risk damaging the sensors (and the Crazyflie is you are connect to it).

As I mentioned, you can power VCOM with 5V, but you should use a 3.3V I2C bus connected to the board (you might be able to make a 5V to 3.3V I2C converter, otherwise the easiest is to use a 3V3 arduino board).

The multiranger deck contains a brunch of VL53L1x, it is true that the protocol documentation is sparse for them as ST wants us to use their lib instead of talking directly to the chips (this is what we are doing in the Crazyflie). There is existing VL53L1x drivers for Arduino, a quick google search got me this one:https://github.com/pololu/vl53l1x-arduino.

I assumes you kept the Crazyflie connected when scanning the I2C bus. What you are seeing is the 5 VL53L1x (0x31 to 0x35), 0x20 is the I/O expander that is on the deck and 0x50 should be the config EEPROM on the Crazyflie board.

The problem the I/O expander is solving is that the VL53 do not have address configuradion, instead it has a 'shutdown' pin and there is an I2C command to set the I2C address. At startup, all VL53 are shut-down by the IO expander and the Crazyflie will switch them ON and set their address one by one. You can see the startup sequence in the Crazyflie firmware, sensors are initialized there: https://github.com/bitcraze/crazyflie-f ... ger.c#L153 and the vl53l1xInit function is the one that changes the address: https://github.com/bitcraze/crazyflie-f ... .c#L63-L70.

Post Reply