Can I measure velocity from an accelerometer? How accurately?
The sensor in itself can't provide you the velocity. I have used it accelerometers in a couple of projects the easiest way to get the velocity is to constantly monitor acceleration changes and calculate velocity instantaneaously.
In order to do so follow these instruction. Pleas note that this is only 1 axis reading in actual case you will have to perform this for all three axis i.e. x,y and z.
I hope you are aware of the equation of motion (V = Vo + at)... The sensor will provide you value of acceleration at any given time. But acceleration can vary quite significantly during a huge time intervals so keep the time intervals 't' small. Lets say t = 10ms (depends on you). So calculate V after every 10ms intervale and this will give you current velocity at any given time. But what about Vo? As you know it is refered to as initial velocity so in the beginning it will be 0. Immediately after first reading when you are about to take second reading the Vo will change to the previous V calculated and hence forth.
This means Vo at any given interval is actually the V calculated in the previous interval.
I tried this method in my project when using accelerometer. hope it helps you as well.
I work with Arduino-based autopilot modules, which usually use similar sensors in addition to GPS data to maintain a reasonable estimate of its position/velocity/acceleration. If you were to add other sensors (i.e. a GPS) to your project, it might be worth looking into Extended Kalman Filters (https://github.com/simondlevy/TinyEKF), which are usually able to provide fairly accurate results.
If you're only using an accelerometer, EKF would probably be overkill, so you could look into other noise-reduction techniques. For example, using a weighted average of the last two readings:
// alpha is value between 0 and 1
acceleration = alpha * readAccelerationSensor() + (1 - alpha) * lastSensorReading
Another strategy to filter out noise would be to take multiple sensor readings at each time step and use the median value to integrate for velocity.
I don't think that will be possible. If my understanding of accelerometers is correct, they measure acceleration. Then you have a situation when the speed is constant. Acceleration = 0, according to Newton's laws.
You would have to keep track of changes in acceleration then perform math to maintain the state. As @Chris Stratton suggest, that will lead to keep integrating the error to the very likely situation of getting a meaningless value.
However, I have never worked with an accelerometer before, so it can be possible at a certain extent.
It would be great to hear from someone who actually tried this.