This Project was done for the course COMPENG 2DX3
This system generates a 3D visualization of distance measurements sent by a VL531LX Time Of Flight (ToF) sensor connected to a MSP432E401Y microcontroller. The UART communication line between the PC and MSP432E401Y microcontroller is established by running the python code. This initializes the ToF sensor and prompts the user to enter the current position of the device on the x-axis and the number of desired YZ slices that will be measured. Then, the push of the pull-up resistor (start button) triggers the MOT-28BYJ48 stepper motor to begin rotating 360 degrees clockwise with the ToF sensor mounted. The ToF sensor measures the distance within a single vertical Y-Z plane and this data is sent to the MSP432E401Y microcontroller via I2C protocol. This process can be interrupted by pushing a second button. These measurements are then read by the PC and are stored as y, z coordinates. Using the Open3D library in Python, the spatial information is mapped and a 3D graph is generated. Figure below demonstrates an example of a simulated hallway with 6 YZ planes each with their own respective x coordinates.
How does the ToF sensor work?
To configure the VL531LX ToF sensor to calculate distance measurements, the UART communication between the PC and the MSP432E401Y microcontroller must be established first. Firstly, the python code is ran, this initializes UART between the PC and the microcontroller and outputs a HIGH to the microcontroller. An external button press is now required to start the system. The external button press initiates a 360-degree rotation of the stepper motor with the ToF sensor mounted. The motor rotates in intervals of 11.25 degrees to obtain 32 distance measurements from the ToF sensor.
To obtain distance measurements, the ToF sensor uses LIDAR by emitting pulses of infrared laser light at 940nm. These pulses are generated by the vertical-cavity surface-emitting laser (VCSEL). To obtain a distance measurement, the ToF sensor measures the time taken for emitted pulses of light to reach the nearest object and be reflected to the detector. This reflected signal is collected by the ToF receiver. As a result, the time delay between the emitted and received periodic signal is measured.
Once one full rotation is completed, the distance measurements are sent to the microcontroller via I2C protocol.