from displacement to velocity

HI Everyone

I am new about Arduino and I have a problem about a project.

I am using a Ping acoustic sensor to measure displacements. My program was taken by the example associated to the sensor.
What I would like to do, it is to pass fromdisplacement to velocity and then make the FFT of the signal.
I know I can pass from displacement to velocity through the derivative but I don’t have any idea how to do it in Arduino or how to sample the signal.
Any help or idea?



You need the time. Velocity is displacement over time. What is the timing between pulses. ( Curr Disp - Prev Disp ) / delta time.

then make the FFT of the signal.

An FFT of which signal?

Give us some more example of your work if you have any. Such as some code and circuit configuration.

Hi all,

thanks for the answers and sorry if i disappered for a bit.

This is the code written for the project. The data are acquired using a rugged arduino and it uses an acoustic sensor HC SR04.

At the moment the software reads the displacements on the serial monitor and it makes an average of the acquired signal. I would like to use this signal which represents the displacement to derive the velocity and make the FFT.

Thanks for the help.


Measure_distance.ino (1.08 KB)

While velocity is mathematically the first derivative of displacement vs. time you don't need any calculus to do this. You just need to divide displacement by time.