## 2017년 4월 19일 수요일

### Re: Accelerometer

This is my final year project
I need to develop a mobile application to measure walking speed.
I use pedometer to get steps count, accelerometer to get acceleration.

My formula:
acceleration = square root [ (x^2) + (y^2) +(z^2) ]
speed = acceleration/time

This is the problem:
I get the step count after 60s.
For example, I walked 105 steps in 60s. But my speed is 600 m/s.

I think there is an issue/problem with my formula or accelerometer. But I am not sure what is the reason.

--
There is no way that the pedometer can give you accurate results. It depends very much on the value you give to the stride (average length of a step) and how consistent you walk.
Some pedometers calibrate the stride using GPS, but I do not think that is true for the AI2 pedometer component.
There are some descriptions on the web, for example this one:

--
My formula:
acceleration = square root [ (x^2) + (y^2) +(z^2) ]
speed = acceleration/time

What are x, y, z ?  Distances?

And why do you use the word "acceleration" for distance?
Speed = distance / time, not acceleration/time.

--
I should not speak for GROOT, but I think he means accelerometer values which are given in 3 dimensions, when you wiggle your phone.
But then there is also the GyroscopeSensor, the OrientationSensor and the Pedometer. I lost track of which is for what.

--
I am trying to measure walking speed.
So, i used pedometer to get the step counts,
clock as timer and
accelerometer to get the XYZ motion to get acceleration.
my question is, what is wrong with my coding?
because the speed shown in the picture does not make sense. it is impossible to travel 700meter per second

I am sorry if my explanation is confusing.

--
If you assume that most values are in milliseconds instead of seconds, are values more appropriate then?
--

What if you were jumping up and down on a pogo stick, but not going any where?
You would have a big average root mean square acceleration, but no distance.

The critical data here is the number of steps, and a missing datum, your stride length, needed to calibrate the calculation
distance = strides * stride length.

A stride is roughly a meter, judging by my size 12 (American) shoes.

So set a global variable named MetersPerStride to 1,

Hours = Minutes / (60 Minutes per hour)
Meters Per Hour = Strides * MetersPerStride / Hours

So for 105 strides in 60s = 1 minute your
Hours = 1/60,
Meters Per Hour = 105 * 1 / (1/60)
Meters Per Hour = 105 * 60
Meters Per Hour = 6300  (Thank you, Google)

--
Or use the pedometer component, where you can set the stride size. And which counts the steps for you. By default the stride length is 0.73 and for me that is rather large, but then I am fairly small.

--
The accelerometer only tells you the tilting of your phone, while it is at one place. As ABG says, it is irrelevant.
I did not try to use the GyroscopeSensor. Maybe that is the one you need, it tells you X,Y, or Z angular velocity, that sounds more like speed.

--
Maybe this is also interesting for you: http://funf.org/
They have resources for all kinds of sensors..
--