# Velocity from acceleration equation

I've been working with an accelerometer, and was assigned the job of trying to find the velocity from the accelerometer, I take acceleration data every 10 ms (sampling rate 100KHz) and I used the equation : Vf = V0 + a*t, where t is 10 ms

V0 is 0 at first, and then it takes the old Vf value

I tried moving the accelerometer in Y+ and then Y- direction, using only the y-axis.

And it works okay, see the figure below :

but I recently saw that this equation is designed to be used in an application with a constant acceleration, how come it works for me? Or am I wrong here?

Let's look at where that equation comes from: $$a_\mathrm{ave} = \frac{\Delta v}{\Delta t}$$
The average acceleration during a time interval is how much the velocity changed, $$\Delta v = v_f - v_i$$ divided by the length of the time interval $$\Delta t$$. If $$a$$ is constant than $$a_\mathrm{ave}$$ is just $$a$$.
We can solve that equation for $$v_f$$ and get your equation: $$a_\mathrm{ave} = \frac{v_f - v_i}{\Delta t} \implies v_f = v_i + a_\mathrm{ave} \Delta t$$
The key here is that for $$a$$ to equal $$a_\mathrm{ave}$$, it doesn't need to be constant over the whole time of the experiment. It only needs to be constant over each $$10$$ ms interval. If the time interval is short enough, then $$a$$ will be approximately constant, and the equation is a good model for what's going on.
In practice your accelerometer likely determines $$a$$ by averaging over the $$10$$ ms time interval between outputs. So it's probably telling you the average acceleration in each interval anyway.