After connecting the TOF sensor, it shows that the sensor address is 0x29. It is a problem as two TOF sensors have the same address. Therefore, we need to pin low the "XSHUT" pin using the GPIO pin on the artemis board to turn off one sensor and allocate a new address. After giving a new address, turn on that sensor. Now, one sensor has a new address while the other use the original address.
As the robot need to detect the distance from the side and the front, I need to use two long QWIIC connectors and place two TOF sensors on the left and front side of the robot. However, if there is an obstacle on the right, there might be some problems
Here is a sketch of the wiring diagram with some notations on it.
Here is the picture of both TOF sensors connected to QWIIC breakout board.
After running "Example1_wire_I2C", the address of thw TOF sensor is shown below.
The 0x29 address which is used for TOF sensor can be seen.
In order to detect the obstacle earlier to plan the motion, I use "setDistanceModeLong()". It will lose some accuracy but I believe the range of detection is more important. Here is the collected data.
Follow the idea in the first part, I can now get the data from two TOF sensors. Here is part of the code
Here is the result. I just keep the result in millimeter(mm) to make it simple and clear.
Follow the instructions, I write a program to check the time consumed in each step. Here is the code and result
It can be observed that the time is mainly consumed in waiting for data from TOF sensor. This is the main limit factor.
Just like what I did in Lab 2, I write a method to read and store the data from TOF sensors first. Then, I add a new case to transmit the data through bluetooth to my computer. Here is part of the code and the result in jupyter lab.
I get 10 data points from Artemis board. I plot them use python.
There are several different sensors which are based on infrared transmission such as triangulation based IR distance sensor and TOF sensor. The first one is less sensitive to color and texture but has some limitations on range and accuracy. The TOF sensor has long range and high accuracy but it is more sensitive to color and texture.
Although the TOF sensor should have worse performance when facing dark objects, it does have a quite accurate result in my test. The coarse surface sometimes can affect the result, the TOF sensor will return wrong data.
Back to the main page