Question

I am developing an application to count the steps of the user while putting the phone in the pocket of his pants. And I need to know which is better to use, Should I use the accelerometer Sensor or the GyroScope sensor. Also I have tried the accelerometer sensor, and it worked but I'm asking to check whether the GyroScope is more accurate to this function or the accelerometer? Thanks in advance for help.

Was it helpful?

Solution

I think you may have already seen my ideas on this subject, but for completeness, I think it's good to record them here.

I think the best results will come from using all sensors available. However, I got reasonable results from just using accelerometer data, see my answer here. What I did was to get a lot of friends to walk for me, and I counted how many steps they took. As they were walking, my Android device was logging all sensor output. I then developed a program in C# (because that's my favourite language) that analysed all the log files, and hence optimised a methodology for counting steps that I then ported to Android java.

Whatever sensors you end up using, logging a whole load of data and then analyzing to work out how best to count the steps is what I would recommend.

OTHER TIPS

Accelerometer sensor detects accelerations along an axis, meanwhile gyroscope can detect rotations, so they have different (and complementary) uses

Take a look a this more detailed explanation of their differences, and the values you can filter from their raw data https://github.com/hadimichael/V-Tracker/wiki/Hardware

You can try this.. it perfectly works for me..

        var motionmanager = CMMotionManager()
        motionManager.deviceMotionUpdateInterval = 0.1
        motionManager.startDeviceMotionUpdatesToQueue(NSOperationQueue.currentQueue(), withHandler:{
            deviceManager, error in

            var accelerationThreshold:Double = 1;
            var userAcceleration:CMAcceleration = deviceManager.userAcceleration;
            if(fabs(userAcceleration.x) > accelerationThreshold) || (fabs(userAcceleration.y) > accelerationThreshold) || (fabs(userAcceleration.z) > accelerationThreshold)
            {
                println("LowPassFilterSignal")
            }
        })
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top