1 of 37

Mobile Handset Sensors

Week 13 & 14

By: Dr. Mohammad Shoab

2 of 37

Outline

  • Overview
  • GPS
  • Other Sensors

2

3 of 37

Sensor

  • A sensor is a converter that measures a physical quantity and converts it into a signal which can be read by an instrument

3

Visual Sensor

Ultrasound Sensor

Infrared Sensor

4 of 37

Mobile Handset Sensor

  • Modern mobile handset not only serves as the key computing and communication device, but it also comes with a rich set of embedded sensors
  • Enabling new applications across a wide variety of domains, such as transportation, social networks, environmental monitoring, healthcare, etc.
  • Giving rise to new research areas such as mobile sensing, mobile data mining, etc.

4

5 of 37

Sensor Categories (1)

  • Hardware-based sensors
    • Physical components built into a handset
    • They derive their data by directly measuring specific environmental properties
  • Software-based sensors
    • Not physical devices, although they mimic hardware-based sensors
    • They derive their data from one or more hardware-based sensors

5

6 of 37

Sensor Categories (2)

  • Motion sensors
    • Measure acceleration forces and rotational forces along three axes, e.g., accelerometer, gyroscope, etc.
  • Position sensors
    • Measure the physical position of a device, e.g., GPS, proximity sensor, etc.
  • Environmental sensors
    • Measure various environmental parameters, e.g., light sensor, thermometer, etc.

6

7 of 37

Sensor List

7

Sensor

Function Type

Software-based or Hardware-based

Accelerometer

Motion Sensor

Hardware-based

Gyroscope

Motion Sensor

Hardware-based

Gravity

Motion Sensor

Software-based

Rotation Vector

Motion Sensor

Software-based

Magnetic Field

Position Sensor

Hardware-based

Proximity

Position Sensor

Hardware-based

GPS

Position Sensor

Hardware-based

Orientation

Position Sensor

Software-based

Light

Environmental Sensor

Hardware-based

Thermometer

Environmental Sensor

Hardware-based

Barometer

Environmental Sensor

Hardware-based

Humidity

Environmental Sensor

Hardware-based

8 of 37

Sensors in Android OS

8

Applications

Application Framework

Libraries

Linux Kernel

GPS

Driver

Accelerometer Driver

Gyroscope

Driver

Thermometer

Driver

Other Drivers

Hardware

GPS

Accelerometer

Gyroscope

Thermometer

….

Android

OS

9 of 37

Outline

  • Overview
  • GPS
  • Other Sensors

9

10 of 37

GPS (1)

  • Need connect to 3 satellites for 2D positioning, 4 satellites for 3D positioning
  • More visible satellites increase precision
  • Typical precision 20-50m; maximum precision: 10m

10

11 of 37

GPS (2)

  • Location service using GPS in Android consists of five architectural components

11

12 of 37

GPS (3)

  • GPS chip: Radio frequency receiver that directly communicates with GPS satellites

12

13 of 37

GPS (4)

13

  • GPS Driver
    • Communicates with the GPS chip
    • Provides low level APIs to high level software

14 of 37

GPS (5)

  • GPS Engine
    • The heart of the system
    • It uses configuration parameters to configure GPS
    • It instructs the GPS driver to detect multiple GPS satellites
    • Timing information can be got from NTP servers via internet (fast) or directly downloaded from Satellites (slow)
    • The GPS chip locks onto satellites using the timing information

14

15 of 37

GPS (6)

  • Android Location Service
    • It consists of Android framework classes like location manager that provide services to applications

15

16 of 37

GPS (7)

  • User Application
    • Location-based applications like Google maps, Navigation, etc.

16

17 of 37

GPS (8)

  • Disadvantages
    • GPS does not work indoors
    • GPS quickly kills your battery
    • Building reflect and occlude satellite signals (reducing precision of positioning in urban environments)
  • Alternative positioning: GPS, cell towers, Wi-Fi or combination of them

17

18 of 37

GPS (9)

  • An example to obtain the locations (not all application do this way)

18

19 of 37

Outline

  • Overview
  • GPS
  • Other Sensors

19

20 of 37

Sensor Coordinate System

  • Most of the sensors use the same coordinate system
  • When a device’s screen is facing the user
    • The X axis is horizontal and points to the right
    • The Y axis is vertical and points up
    • The Z axis pints toward outside of the screen face

20

21 of 37

Accelerometer (1)

  • Measure proper acceleration (acceleration it experiences relative to freefall)
  • Units: g

21

22 of 37

Accelerometer (2)

  • Acceleration is measured on 3 axes
  • Note that the force of gravity is always included in the measured acceleration
    • When the device is sitting on the table stationary, the accelerometer reads a magnitude of 1g
    • When the device is in free fall, the accelerometer reads a magnitude of 0g
  • To measure the real acceleration of the device, the contribution of the force of gravity must be removed from the reading, for example, by calibration

22

23 of 37

Accelerometer (3)

  • When the device is lying flat
    • gives +1g (gravitational force) reading on Z axis
  • Stationary device, after 45 degree rotation
    • Same magnitude, but rotated

23

24 of 37

Gravity Sensor

  • Gravity sensor is not a separate hardware
  • It is a virtual sensor based on the accelerometer
  • It is the result when real acceleration component is removed from the reading

24

25 of 37

Gyroscope (1)

  • Measures the rate of rotation (angular speed) around an axis
  • Speed is expressed in rad/s on 3 axis
  • When the device is not rotating, the sensor values will be zeros

25

26 of 37

Gyroscope (2)

  • It gives us 3 values
    • Pitch value (rotation around X axis)
    • Roll value (rotation around Y axis)
    • Yaw value (rotation around Z axis)

26

27 of 37

Gyroscope (3)

  • Unfortunately, gyroscope is error prone over time.
  • As time goes, gyroscope introduces drift in result
  • By sensor fusion (combining accelerometer and gyroscope), results can be corrected and path of movement of device can be obtained correctly

27

28 of 37

Magnetic Field Sensor

  • Measures direction and strength of earth’s magnetic field
  • Strength is expressed in tesla: T

  • Typical application: compass

28

29 of 37

Proximity Sensor (1)

  • A proximity sensor can detect the presence of nearby objects without physical contact
  • It often emits an electromagnetic field (e.g., infrared) and looks for changes in the field or return signal
  • It is usually used by mobile device

to determine how far a person’s

head is from the face of a handset

    • E.g., a user is making a phone call

29

30 of 37

Proximity Sensor (2)

  • The measured results could be different based on different devices
    • Most proximity sensors return the absolute distance in centimeters (cm)
    • Some return only a flag that represents near or far
    • Some return either 0.0 or the maximum value only

30

31 of 37

Light Sensor (1)

  • It gives a reading of the light level detected by the light sensor of the device
  • Located at front of mobile device near to front facing camera
  • The units are in SI lux units

31

32 of 37

Light Sensor (2)

  • The device uses the data to adjust the display’s brightness automatically
    • When ambient light is plentiful, the screen’s brightness is pumped up and when it is dark, the display is dimmed down
    • High-end Samsung galaxy phones use an advanced light sensor that can measure white, red, green, and blue light independently to fine tune image representation

32

33 of 37

Thermometer

  • The thermometer here measures ambient temperature outside of the device
  • In fact, there’s thermometer in almost every mobile device and some handsets might have more than one of them. However, they are used to monitor the temperature inside the device and its battery to detect overheating

33

34 of 37

Pressure Sensor

  • Some higher-end mobile devices have a built-in pressure sensor (barometer) which can measure atmospheric pressure
  • The data is used to determine how high the device is above sea level, which in turn can help improve GPS accuracy

34

35 of 37

Thank You

35

36 of 37

Exercise

Q1. What is sensor?

Q2. Explain category 1 sensors.

Q3. Explain category 2 sensors.

Q4. Explain accelerometer sensor.

Q5. Explain gravity sensor.

Q6. Explain gyroscope.

Q7. Explain proximity sensor.

Q8. Accelerometer is a

  1. Software sensor
  2. Hardware sensor
  3. Framework
  4. Document

Q9. Orientation sensor is a

  1. Software sensor
  2. Hardware sensor
  3. Framework
  4. Document

36

37 of 37

Q10. Most of the sensors use the same

  1. Software
  2. Hardware
  3. Coordinate system
  4. Electronics

Q11. Acceleration is measured on

  1. Azimuth
  2. Pitch
  3. Y axis
  4. X axis

Q12. Measures the rate of rotation (angular speed) around an axis

  1. Gyroscope
  2. Accelerometer
  3. Gravity meter
  4. Thermometer

Q13. It is usually used by mobile device to determine how far a person’s head is from the face of a handset

  1. Gyroscope
  2. Accelerometer
  3. Gravity meter
  4. Proximity sensor

37