How to convert accelerometer sensor data to step counter?

1.3k Views Asked by At

I want to build a step counter widget with flutter but don't know how can I convert the accelerometer sensor data of X, Y and Z axis to the step counter with the help of sensor flutter package.

1

There are 1 best solutions below

0
On

I think trying to do this accurately from accelerometer data may be tricky, so you may be better trying to do it natively in a plugin. For example, Android has a Step Counter sensor type:

https://developer.android.com/reference/android/hardware/Sensor#TYPE_STEP_COUNTER

If you insist on doing it from the accelerometer data, I think you probably want to count the direction changes (count every other one), but I expect making it accurate (eg. trying to ignore things that aren't steps) will be non-trivial.