Plug the sensor to the I2C port by connecting 5V, GND , SCL, and SDA pins. Then, from the general purpose sensors
app, scan and start recording values.
The data logger can be used to measure variations in the distance , and extract parameters from periodic oscillations.
The screenshot below shows the sensor pointed at an oscillating object, and the oscillations are measured in millimeter units. The X-Axis records time relative to the latest recorded point. This data can be analysed to extract frequency, amplitude, and damping coefficients.
The SR04 uses sound pulses, and therefore requires a flat surface on the measurement surface facing it so that the reflected sound pulses are returned back to the sensor. This makes it difficult to use in traditional experiments such as pendulums with spherical bobs. The VL53L0X only needs an optically reflecting surface .
python code.