I’m primarily talking about stuff like step counters, but also health apps measuring your heart rate, how many stairs you take, the length of your steps, and so on. I’m honest when you tell me to explain it to me like I’m five years old, this one boggles my mind.
The most basic way to measure movement is with an accelerometer. It’s a little component inside your phone that has a small weight with a known mass connected to springs. When the phone moves or rotates, the weight moves, and the tension on the springs changes. The tension is either constant (you rotated your phone and are now holding it in the new position) or temporary (you moved in a direction and stopped. There are other ways this can be done, but this is the most conceptually simple.
Steps, length of step, distance moved, and heart rate can be estimated from analyzing the movement in various ways.
For example, to detect a step, your phone might see movement slightly up and forward, then down, then a jarring impact. Heart rate can be estimated based on your entered weight in an app, your speed of movement, how long you’ve been moving, and averages for people of your weight moving in those ways. This is a very inaccurate way to measure your heart rate, however. A better way would be by a sensor located on your wrist, arm, or chest, which is what smart watches often do.
Movement measured by an accelerometer can quickly become inaccurate, because small errors add up over time, so for movement over longer distances, phones generally use GPS (communication with a satellite positioning system) which is accurate to within about 5 meters.
If GPS isn’t available, but the phone is connected to multiple cell phone towers, then it’s possible to triangulate the position of the phone given the tower locations. If we know the distance and direction to the towers, and the position of the towers, then we can find the location of the phone by basically adding an offset to one of the tower locations.
There are other, more niche ways to measure positions without triangulation or GPS, but they’re generally used for autonomous robotics - laser positioning with reflectors, ultra-wode-band positioning with special sensors, or visual positioning with cameras surrounding the region in which the robot will be working.
Let me know if you have any further questions.
Deestan@lemmy.world 2 months ago
It has three sensors that notice if it is changing speed up/down, left/right or back/forth.
A step will result in a speed increase up (foot go from still to up), followed by a sharp speed increase down (foot go from up to down), then “up” again (foot go from down to stop).
Going up a stair causes the same but different timing between the speed changes.
If you are on Android, the Physics Toolbox Suite can let you look at the exact values it is measuring.
Slovene@feddit.nl 2 months ago
Foot go up, foot go down. You can’t explain that!
Sidyctism2@discuss.tchncs.de 2 months ago
fucking feet, how do they work?
suction@lemmy.world 2 months ago
You don’t have to!
moody@lemmings.world 2 months ago
In addition to that, it uses GPS, WiFi, and Bluetooth signals to pinpoint your location very precisely, and can use that to calculate the distances you travel and the number of steps it takes you to get there.
It can also put all of these data points together to tell things like your height and weight. It can only guesstimate things like your heart rate based on your age and BMI, but smartwatches these days have actual heart rate monitors, and pulse and oxygen meters built-in and can share that data with your phone.
meco03211@lemmy.world 2 months ago
Well how about that. I’ve debated making my own pedometer app. I’m assuming there are tutorials online how to do that, but this might be fun to just play with for a bit.