Distance can be measured by sending a pulse of light to the target and measuring the time interval to receive the reflected signal. The VL53L0X is a sensor which is capable of measuring distance by this method. It emits a short and harmless laser pulse which is reflected from the object in front, and returns to the sensor. It measures the time taken for the round trip of this laser pulse, and calculated distance.
It works well between distances of 5cm to 50cm
This can be used for various oscillating mechanics experiments such as coupled pendulum, mass spring system etc
The VL53L0X accuracy can vary up to 7% based on the total distance, and reflectance of the object. Refer to the datasheet. However, it has several advantages over the SR04 in that it can measure distances to curved as well as sloping surfaces. It can also measure through glass partitions.