A firmware + hardware project that uses a Texas Instruments MSP432E401Y microcontroller, a VL53L1X Time-of-Flight sensor, and a 28BYJ-48 stepper motor to scan indoor spaces and generate 3D reconstructions. Data is processed on a PC using MATLAB visualization.
- 128 distance measurements per 360° rotation using VL53L1X ToF sensor
- Stepper motor control with 2.81° increments per step for precise scanning
- I²C communication between MCU and sensor, UART @ 115200 baud to PC
- MATLAB visualization pipeline to reconstruct 3D environments layer-by-layer
- Cost-efficient build (~$300) using off-the-shelf components
- TI MSP432E401Y Microcontroller (receiver programmed in C & Assembly)
- VL53L1X Time-of-Flight sensor (940 nm laser emitter/receiver)
- 28BYJ-48 Stepper Motor + ULN2003 Driver
- 3D Printed Mount for sensor and motor assembly
- Power Supply:
- MCU: 4.75–5.25 V (USB Micro-B)
- ToF Sensor: 2.6–5.5 V
- Motor: 5–12 V
- The stepper motor rotates the ToF sensor 360° while capturing 128 measurements per rotation.
- Sensor data (distance in mm) is preprocessed and sent to the microcontroller over I²C.
- The MCU relays data to the PC via UART (115200 baud).
- A MATLAB script converts polar measurements into XYZ coordinates and reconstructs the scan.
- The user shifts the device along the X-axis (default: 30 cm per step) to build full 3D models.
- Firmware:
- Written in C and Assembly for TI MSP432E401Y
- Implements I²C sensor communication, UART serial output, and stepper motor control
- MATLAB Script:
- Serial communication with MCU
- Real-time point cloud reconstruction with
scatter3andplot3 - Adjustable displacement and scan depth
A scanned hallway compared to the real environment:
| MATLAB Scan Output | Real Hallway |
|---|---|
![]() |
![]() |
- Connect the MSP432E401Y to PC via USB.
- Upload firmware to MCU via Keil uVision.
- Open MATLAB and set the correct COM port in
main.m. - Run the script "2dx_studio_8c.c" → press Enter + PJ0 button on MCU to start scan.
- Move device along X-axis and repeat for each layer.
- View final 3D visualization in MATLAB.

