82
Motion Sensing & Fitness Tracking Accelerometer & M7/M8 Chip

How iPhone detects movement using sensors

Embed Size (px)

Citation preview

Page 1: How iPhone detects movement using sensors

Motion Sensing

& Fitness

TrackingAccelerometer & M7/M8 Chip

Page 2: How iPhone detects movement using sensors

● Motion sensing in the iPhone is

usually thought of as the

Accelerometer

Intro

Page 3: How iPhone detects movement using sensors

● Motion sensing in the iPhone is

usually thought of as the

Accelerometer (and that’s

probably the most-used sensor)

Intro

Page 4: How iPhone detects movement using sensors

● But there are actually 3 sensors in

the iPhone:

● Accelerometer

● Gyroscope

Intro

Page 5: How iPhone detects movement using sensors

● But there are actually 3 sensors in

the iPhone:

● Accelerometer

● Gyroscope

● Compass

Intro

Page 6: How iPhone detects movement using sensors

● There are 4 sensors in the iPhone

6:

● Accelerometer

● Gyroscope

● Compass

● Barometer

Intro

Page 7: How iPhone detects movement using sensors

● Apps can access raw data from

any of the sensors individually

Intro

Page 8: How iPhone detects movement using sensors

● But a lot more interesting stuff can

happen when the data from

multiple sensors is combined

Intro

Page 9: How iPhone detects movement using sensors

● Sometimes the app must combine

or analyze the data itself

Intro

Page 10: How iPhone detects movement using sensors

● Other times the phone will

combine or analyze the signals

automatically

Intro

Page 11: How iPhone detects movement using sensors

● The M7 chip in the iPhone 5s is

one example of the phone doing

some processing before passing

info on to an app

Intro

Page 12: How iPhone detects movement using sensors

● The iPhone 6 has the next-

generation chip, the M8, and it

does the same thing

Intro

Page 13: How iPhone detects movement using sensors

● The M7/M8 chip is mainly geared

toward all-day activity tracking in

the background, particularly

fitness activity

Intro

Page 14: How iPhone detects movement using sensors

1. Accelerometer

Page 15: How iPhone detects movement using sensors

● The accelerometer measures

acceleration in any of 3 directions

Accelerometer Overview

Page 16: How iPhone detects movement using sensors

● The accelerometer measures

acceleration in any of 3 directions

● Note that it measures

acceleration, not movement

Accelerometer Overview

Page 17: How iPhone detects movement using sensors

● So an app can usually tell if the phone has moved in a direction by looking

at whether it accelerated in that direction

Measuring Movement

Page 18: How iPhone detects movement using sensors

● But it can’t tell how far it moved in that direction just from the

accelerometer data

Measuring Movement

Page 19: How iPhone detects movement using sensors

Accelerometer Details

● The accelerometer works like a little mass suspended inside the phone by

springs

Page 20: How iPhone detects movement using sensors

Accelerometer Details

● When the phone accelerates, the springs temporarily get stretched

different amounts

Page 21: How iPhone detects movement using sensors

Accelerometer Details

● When the phone accelerates, the springs temporarily get stretched

different amounts

● By measuring the different amount of stretching, the phone can tell how

fast the phone has accelerated

Page 22: How iPhone detects movement using sensors

Accelerometer Details

● The accelerometer inside the

iPhone is not actually a tiny box

with a ball inside, but it’s not

actually all that different

Page 23: How iPhone detects movement using sensors

Accelerometer Details

● The accelerometer inside the

iPhone is not actually a tiny box

with a ball inside, but it’s not

actually all that different

● It’s made of silicon instead of

metal, but it still has one part that

is stationary and another part that

is relatively free-floating, and the

phone measures when these two

parts move relative to each other

Page 24: How iPhone detects movement using sensors

Accelerometer & Gravity

● When the phone is motionless but

not falling, the weight hangs down

toward to the bottom of the phone

Page 25: How iPhone detects movement using sensors

Accelerometer & Gravity

● When the phone is motionless but

not falling, the weight hangs down

toward to the bottom of the phone

● This causes the accelerometer to

register the force holding the

phone up against gravity as

acceleration

Page 26: How iPhone detects movement using sensors

Accelerometer & Gravity

● The accelerometer only shows 0

acceleration in all 3 directions is

when the phone is in free-fall

Page 27: How iPhone detects movement using sensors

Accelerometer & Gravity

● The phone can use this

information to detect the force of

gravity on the phone and

determine which way is “up”

Page 28: How iPhone detects movement using sensors

Accelerometer & Gravity

● The phone can use this

information to detect the force of

gravity on the phone and

determine which way is “up”

● This is then used for things like

switching around the screen

display orientation

Page 29: How iPhone detects movement using sensors

Using Accelerometer Data

● When an app wants to start using

accelerometer data, it tells the

phone to start start sending

updates at given intervals

Page 30: How iPhone detects movement using sensors

Using Accelerometer Data

● When an app wants to start using

accelerometer data, it tells the

phone to start start sending

updates at given intervals

● Then it processes each update as

it comes in or saves them and

analyzes them to suit its needs

Page 31: How iPhone detects movement using sensors

Accelerometer Sensitivity

● The accelerometer is extremely

sensitive

Page 32: How iPhone detects movement using sensors

Accelerometer Sensitivity

● The accelerometer is extremely

sensitive

● Any amount of movement at all

will be picked up

Page 33: How iPhone detects movement using sensors

Accelerometer Sensitivity

● The accelerometer is extremely

sensitive

● Any amount of movement at all

will be picked up

● This results in a noisy signal that

usually needs to be processed in

order to be useful

Page 34: How iPhone detects movement using sensors

Accelerometer Frequency

● The accelerometer’s response rate is also extremely fast

Page 35: How iPhone detects movement using sensors

Accelerometer Frequency

● The accelerometer’s response rate is also extremely fast

● An app can get updates from the accelerator as often as 100 times a

second

Page 36: How iPhone detects movement using sensors

Accelerometer Frequency

● The accelerometer’s response rate is also extremely fast

● An app can get updates from the accelerator as often as 100 times a

second

● The amount of data available, combined with the noisiness, makes working

with the raw accelerometer data fairly complex and not for the faint of heart

Page 37: How iPhone detects movement using sensors

2. Gyroscope

Page 38: How iPhone detects movement using sensors

● The Gyroscope detects spinning

or rotating motion of the phone

Gyroscope Overview

Page 39: How iPhone detects movement using sensors

● The Gyroscope detects spinning

or rotating motion of the phone

● The Accelerometer won’t pick this

up except as noise

Gyroscope Overview

Page 40: How iPhone detects movement using sensors

● If the phone rotates, the

accelerometer won’t pick up the

movement except as noise

● The Gyroscope detects this kind

of spinning or rotation

● The Gyroscope has 3 axes just

like the accelerometer

Gyroscope Overview

Page 41: How iPhone detects movement using sensors

● Apps use the gyroscope just like

they use the accelerometer

Using Gyroscope Data

Page 42: How iPhone detects movement using sensors

● Apps use the gyroscope just like

they use the accelerometer

● When an app wants to start using

gyroscope data, it tells the phone

to start start sending updates at

given intervals

Using Gyroscope Data

Page 43: How iPhone detects movement using sensors

● Apps use the gyroscope just like

they use the accelerometer

● When an app wants to start using

gyroscope data, it tells the phone

to start start sending updates at

given intervals

● Then it processes each update as

it comes in or saves them an

analyzes them to suit its needs

Using Gyroscope Data

Page 44: How iPhone detects movement using sensors

● Detecting turning motion is

especially important for video

games on mobile devices

Gyroscope for Video Games

Page 45: How iPhone detects movement using sensors

4. Compass

Page 46: How iPhone detects movement using sensors

Compass

● The compass in the iPhone works

just like a traditional compass

Page 47: How iPhone detects movement using sensors

Compass

● The compass in the iPhone works

just like a traditional compass

● It just shows which direction the

phone is pointing

Page 48: How iPhone detects movement using sensors

Compass

● The compass in the iPhone works

just like a traditional compass

● It just shows which direction the

phone is pointing

● Technical name is the

magnetometer

Page 49: How iPhone detects movement using sensors

Compass

● The compass in the iPhone works

just like a traditional compass

● It just shows which direction the

phone is pointing

● Technical name is the

magnetometer (because it works

by detecting the presence of a

magnetic field in 3 dimensions)

Page 50: How iPhone detects movement using sensors

Compass Limitations

● It’s the least accurate and reliable

of the 3 sensors

Page 51: How iPhone detects movement using sensors

Compass Limitations

● It’s the least accurate and reliable

of the 3 sensors

● Susceptible to inference from

other electronics nearby

Page 52: How iPhone detects movement using sensors

Compass Limitations

● It’s the least accurate and reliable

of the 3 sensors

● Susceptible to inference from

other electronics nearby

● That’s why the Apple Compass

app needs calibration

Page 53: How iPhone detects movement using sensors

5. Barometer

Page 54: How iPhone detects movement using sensors

Barometer Intro

● Only available in iPhone 6 and 6

Plus

Page 55: How iPhone detects movement using sensors

Barometer Intro

● Only available in iPhone 6 and 6

Plus

● Calculates elevation by

measuring air pressure

Page 56: How iPhone detects movement using sensors

Barometer Intro

● Only available in iPhone 6 and 6

Plus

● Calculates elevation by

measuring air pressure

● Lower air pressure indicates

higher elevation

Page 57: How iPhone detects movement using sensors

Barometer Intro

● Only available in iPhone 6 and 6

Plus

● Calculates elevation by

measuring air pressure

● Lower air pressure indicates

higher elevation

● Accurate to within 3-5 meters

Page 58: How iPhone detects movement using sensors

Reliability

● Reliable method of calculating

elevation

Page 59: How iPhone detects movement using sensors

Reliability

● Reliable method of calculating

elevation (used by airplanes)

Page 60: How iPhone detects movement using sensors

Reliability

● Reliable method of calculating

elevation (used by airplanes)

● But weather also causes changes

in air pressure

Page 61: How iPhone detects movement using sensors

Reliability

● Reliable method of calculating

elevation (used by airplanes)

● But weather also causes changes

in air pressure

● Pressure at one spot on the

ground is not constant

Page 62: How iPhone detects movement using sensors

Changes in Elevation

● Phone does NOT provide

absolute elevation (“above sea

level”)

Page 63: How iPhone detects movement using sensors

Changes in Elevation

● Phone does NOT provide

absolute elevation (“above sea

level”)

● Phone only provides CHANGES

in elevation over time

Page 64: How iPhone detects movement using sensors

● Apps use the barometer just like

they use the accelerometer and

other sensors

Using Barometer Data

Page 65: How iPhone detects movement using sensors

● Apps use the barometer just like

they use the accelerometer and

other sensors

● When an app wants to start using

barometer data, it tells the phone

to start start sending updates

Using Barometer Data

Page 66: How iPhone detects movement using sensors

● Apps use the barometer just like

they use the accelerometer and

other sensors

● When an app wants to start using

barometer data, it tells the phone

to start start sending updates

● The phone sends an update

whenever it detects a change in

elevation

Using Barometer Data

Page 67: How iPhone detects movement using sensors

6. M7/M8 Chip

Page 68: How iPhone detects movement using sensors

M7 Chip

● It’s not an additional sensor

Page 69: How iPhone detects movement using sensors

M7 Chip

● It’s not an additional sensor

● It’s just the phone looking at

existing sensors and packaging

up that data in an easy-to-use

format

Page 70: How iPhone detects movement using sensors

Separate Processor

● It’s an additional low-power

processor dedicated to gathering

data from the motion sensors

Page 71: How iPhone detects movement using sensors

Separate Processor

● It’s an additional low-power

processor dedicated to gathering

data from the motion sensors

● Totally separate from the phone’s

main processor

Page 72: How iPhone detects movement using sensors

M7 Data Provided

● M7 offers 2 things to apps

Page 73: How iPhone detects movement using sensors

M7 Data Provided

● M7 offers 2 things to apps

● 1. Motion Activity

Page 74: How iPhone detects movement using sensors

M7 Data Provided

● M7 offers 2 things to apps

● 1. Motion Activity -- is the iPhone

user

● Walking

● Running

● In a moving vehicle

● Stationary

Page 75: How iPhone detects movement using sensors

M7 Data Provided

● M7 offers 2 things to apps

● 1. Motion Activity

● 2. Step Counter

Page 76: How iPhone detects movement using sensors

M7 Data Provided

● M7 offers 2 things to apps

● 1. Motion Activity

● 2. Step Counter

● Count how many steps the iPhone users

takes

Page 77: How iPhone detects movement using sensors

Background Running

● It’s separate and smaller so it can

run in the background when the

phone’s screen is off and no apps

are running

Page 78: How iPhone detects movement using sensors

Background Running

● It’s separate and smaller so it can

run in the background when the

phone’s screen is off and no apps

are running

● It analyzes the data and stores

the stats for apps to access later

Page 79: How iPhone detects movement using sensors

Background Running

● It’s separate and smaller so it can

run in the background when the

phone’s screen is off and no apps

are running

● It analyzes the data and stores

the stats for apps to access later

● Aimed at providing data for all-day

fitness trackers

Page 80: How iPhone detects movement using sensors

For more information on iPhone development and general tech concepts

explained in plain English, check out Technerva

Please submit feedback to [email protected]

Fin.

Page 81: How iPhone detects movement using sensors

Glossary