HELP ultasonic sensor HC-SR04

Hello everybody :slight_smile:

I'm a mechanical engineer currently studying sixth semester of my career and I'm having a mechanical vibrations curse.

Our first homework was to assembly a pretty simple system consisting of 2 disks(pulleys), 2 springs and a mass. The problem is that my teacher wants us to use an arduino and an ultrasonic sensor or accelerometer to graph the oscillations of the mass. I already bought an ultrasonic sensor HC-SR04 and an arduino mega, the problem is that I have no idea how to do this.

Somehow I need to use the SR04 to sense vertical displacement of the mass and graph it versus time but I really have no clue how to do this :confused: can someone help me ? PLEASE :confused:

thank you !! :slight_smile:

PD the whole objective of this experiment is to determine the damping coefficient of the system

What sample rate do you need?

I think something around 10-20 samples p/ second will do

what do you think ?