web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Steps counter - pedometer
Power Apps
Answered

Steps counter - pedometer

(0) ShareShare
ReportReport
Posted on by 9
Hello. Can i please get help with building an app that counts the number of steps? I already know that i have to use acceleratin.x acceleration.y acceleration.z but i do not know how to do so. Should i use timers? Compare latitudes and longitudes? Use a mathematical logical formula?
Categories:
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Haven't used Acceleration before but sounds like a cool idea. 

     

    If I was you I would start by setting up a basic app that displays the acceleration.Z (Up and down) in a label and Acc.Y (forward and back).  Then go for a quick walk and keep an eye on which way the numbers are going, and where they start when the app first loads.  That should give you an idea of when you should 'record a step'.

     

    Next, you'd also need something to keep looping to check what the values are of Z & Y.  if the loop checks and the value is higher than the limit you have set for a 'step', then get it to update a variable or something.  A timer could handle the looping every 0.5 seconds or so, and an if statement on the timer to check if the values fall inside/outside your range.

     

    My guess is it wouldn't be super accurate, but it's a good start.  To make it more accurate, potentially get the timer to loop much quicker, every 0.1 seconds.  and save the current Acc.Y to a variable.  if the new value is higher than the previous value then you'd save it as a 'step'.

     

    You could use Lat/Long, but then you'd have to do some step averaging based on the distance someone has walked.  e.g. 1 step every 1.2 metres or something.

     

  • PaulD1 Profile Picture
    2,914 on at

    I think this is a very interesting from the perspective of 'could it be done' with Power Apps, but if this is for a serious App I'd advise that you probably don't want to do this with PowerApps.

    I don't think that a timer will continue to run and record the accelerometer data if Power Apps is not running in the foreground on the device which I think makes Power Apps impractical in this scenario.

    Don't most phones these days have a low power co-processor that can track steps? Maybe you could easily access that from a native app.

  • Fbsx503 Profile Picture
    9 on at

    How do I do that from a native app and what do you mean exactly? i am kind of new to this. Can you explain more please?

  • Fbsx503 Profile Picture
    9 on at

    I tried recording the change of numbers of accY and accZ but the numbers keep on changing even if the phone is fixed on a table. is that normal? And why would I consider it a step if the value goes higher than the range? What if it gets lower? This is what I am trying to know I cant find how a single step is measured using x,y and z. Shouldn't there be a fixed formula to deduce the number of steps accurately?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard