Skip to the content.

Prelab

Before this lab, I skimmed the datasheet and manual for the Time-of-Flight (ToF) sensor that we are using, the VL53L1X. From the datasheet, I found that the device address of the ToF sensor is 0x52, and the least significant but (LSB) is used to signal the direction which information is being sent. If the LSB is high (1), then my Artemis Redboard is writing information to the ToF sensor, but if it is low (0), then my Artemis is reading information from the ToF sensor.

Additionally, since both ToF sensors have the same address, I will need to change one of their addresses so that the Artemis can interact with both of them. This can be accomplished by wiring the XSHUT pin from one of the ToF sensors to the Artemis, which enables the capability to put the ToF in standby mode, and while one ToF is in standby mode I can change the address of the other one.

Finally, I had to detemine how I would solder the Quiic cables to the ToF sensors. From looking at the Quiic MultiPort connector schematic and lining it up with my Quiic cables, I was able to determine that I need to solder the red wire to the ToF sensor’s VIN, black to GND, blue to SDA, and yellow to SCL.

Below is a diagram of how I will wire together the two ToF sensors, the IMU, the Qwiic MultiPort connector, and the Artemis:

Centered Image

Lab Tasks

1. Connect All Components to Artemis

My first task in the lab is to connect the battery, IMU, and ToF sensors to the Artemis. This was straighforward, as I had already planned how I was going to connect the Quiic cables to the ToF sensors and other connections.

Centered Image

For the purpose of testing ToF sensor functionality, I disconnect the battery, IMU, and second ToF sensor for the next step.

2. Discuss and Test Best ToF Sensor Mode

I first use the given example I2C code to ensure that I wired and soldered my ToF sensor properly:

Centered Image

From the output, I see that the address that was detected from my ToF sensor is 0x29, which does not match the ToF sensor’s built-in address (0x52). However, since the LSB is solely used for data direction, it is omitted via a right shift, which gives the address we see, 0x29. Therefore, the output is expected.

There are three modes I can use for my ToF sensors: short (1.3m), medium (3m), or long (4m). I believe that, for now, short will be the best mode because it is least sensitive to ambient light and it has the shortest timing budget (20ms). Additionally, I cannot think of many use cases for sensing objects farther than a meter away, but if the need for a longer range mode arises I can easily change it in the future.

To test the ToF sensor, i taped it to my computer and pointed it at a wall.

Centered Image

Below is my data for testing the sensor at different ranges in short mode:

Centered Image

3. Connect and Use Both ToF Sensors Simultaneously

I took code from my previous step and combine it with the proper setup for using 2 ToF sensors, disabling one so that I can change the address of the other.

Image 1 Image 2

4. Connect and Use Both ToF Sensors and IMU Simultaneously

I was unable to complete this part on time.

Reflection

From this lab, I learned about how the I2C protocol is used to allow communication of my Also, it was my first time soldering, which was a little intimidating at first, but became a lot easier after a few attempts.

Acknowledgements

I referenced past students Mikayla Lahr’s and Nila Narayan’s code for connecting both ToF sensors at the same time.