SlideShare a Scribd company logo
SENSORS AND
LOCATION BASED SERVICES
  ChinmayVS @ B.A.(U).G

       14 JAN 2012
Sensors & location based services
• Compass
  - Bearing

• Gyroscope, Accelerometer
  - Detect motion.

• Barometer
  - Calculate Altitude.

• nGPS
  http://goo.gl/RWEKL (Experimental.)

                          SENSORS AND LOCATION BASED SERVICES   2
cvs@BA(U)G$ who am i

• Android >2yrs. Remember                   anyone?


•            - sensors development. 10million+ units sold.



• Presently working @

                                 PathPartnerTech.com




                        SENSORS AND LOCATION BASED SERVICES   3
“Sense-ors” on Android
     A sensor (also called detector) is a device that measures
a physical quantity and converts it into a signal which can be read by
                  an observer or by an instrument.

                                    1.    ACCELEROMETER
                                    2.    GYROSCOPE
                                    3.    MAGNETIC_FIELD
               REAL
                                    4.    LIGHT
                                    5.    PRESSURE
                                    6.    AMBIENT_TEMP
                                    7.    RELATIVE_HUMIDITY

                                    8.    PROXIMITY
             VIRTUAL                9.    LINEAR_ACCELERATION
                                    10.   GRAVITY
                                    11.   ROTATION_VECTOR


            DEPRECEATED
                                    12. TEMPERATURE
                                    13. ORIENTATION


                      Sensors and location based services                4
“Sense-ors” on Android
     A sensor (also called detector) is a device that measures
a physical quantity and converts it into a signal which can be read by
                  an observer or by an instrument.

                                   1.    ACCELEROMETER
                                   2.    GRAVITY
            MOTION
                                   3.    LINEAR_ACCELERATION
                                   4.    GYROSCOPE

                                   5.    MAGNETIC FIELD
           POSITION                6.    ORIENTATION
                                   7.    PROXIMITY
                                   8.    ROTATION VECTOR

                                   9.    LIGHT
                                   10.   BAROMETER
        ENVIRONMENT                11.   AMBIENT TEMPERATURE
                                   12.   RELATIVE HUMIDITY
                                   13.   TEMPERATURE


                     Sensors and location based services                 5
Sensors in Android applications


  • Use-cases of sensors in apps:
  1.   Active-Input
  2.   Passive-Input           Application developer
  3.   Active-Passive
  4.   Auto-Rotate             Android window manager




               Sensors and location based services      6
Sensors in Android applications (1/4)

• Active input




                  Sensors and location based services   7
Sensors in Android applications (2/4)

• Passive input




                  Sensors and location based services   8
Sensors in Android applications (3/4)

• Active-passive




                   Sensors and location based services   9
Sensors in Android applications (4/4)

• Auto-rotate




                 Sensors and location based services   10
Compass : Bearing (Azimuth)




                                                90o
                                         180o




       Sensors and location based services            11
Compass : Bearing

• iPad as in-flight navigator. Android?

• Magnetic north != Geographic North

• WiFi / Network provider + Compass = GPS?

      POSITION (LAT, LONG) + BEARING




                     Sensors and location based services   12
Compass : Magnetic Declination




        Sensors and location based services   13
Accelerometer, Gyroscope : Motion

• |Accelerometer| != 9.8  Motion

• Initial bearing + rotation of device,

     POSITION (LAT, LONG) + BEARING + SPEED




                  Sensors and location based services   14
Barometer : Altitude
• Remember this ?
  “ WiFi / Network provider + Compass = GPS”

  now how about,

  “ WiFi / Network provider + Compass + Barometer ”

  POSITION (LAT, LONG) + BEARING + SPEED + ALTITUDE > GPS




                       Sensors and location based services   15
nGPS : World Geomagnetic model




         Sensors and location based services   16
Using Sensors in your app




SensorEvent           http://goo.gl/hWOQu

SensorManager         http://goo.gl/1DRUv


Examples :
http://goo.gl/AVBDV
http://goo.gl/eKq6a



                              Sensors and location based services   17
Sensor app-dev Tips and tricks

 Sensor calibration.
  1. one-turn deserves another (axes-calib)
  2. zero-calib

 Polling rate fastest/game/ui/normal?

 Sensor fusion
     Hard-way
     Easy-way (Invensense ) http://goo.gl/bHmDe

 Lessons from WindowOrientationListener.java
   Android/frameworks/base/core/java/android/view/WindowOrientationListener.java

 When to register/unregister SensorEventListener
 When to acquire/release Wakelocks


                               Sensors and location based services                 18
WindowOrientationListener.java

 Low-pass filter the tilt and orientation angles to avoid "twitchy" behaviour.

 When the orientation angle reaches a certain threshold, transition

 These thresholds have some hysteresis built-in to avoid oscillation.

 Use the magnitude to judge the accuracy of the data.
     Under ideal conditions, the magnitude should equal to that of gravity.
     When it differs significantly, we know the device is under external acceleration

 Use the tilt angle to judge the accuracy of orientation data.
     When the tilt angle is high in magnitude, we distrust the orientation data.
     When the device is flat, small physical motion = large changes in orientation angle.



                                  Sensors and location based services                        19
App-dev Tips and tricks



                                      register
                                sensorEventListener
                                  acquire wakelock


                                  release wakelock

                                    unregister
                                sensorEventListener




     Sensors and location based services              20
Thank You!!

         Questions?

android-porting             android-developers

android-kernel              android-platform




             CONTACT ME




      Sensors and location based services        21

More Related Content

What's hot (20)

PPTX
Android Sensor and Framework - AWARE
DarrenJin
 
PDF
Generic sensors for the Web
Kenneth Rohde Christiansen
 
PPTX
Design of Arduino based fire fighting Robot
Nilanjan Mandal
 
PPT
Fire fighting robot using 8051 microcontroller
vibs1893
 
PPTX
Motion sensing and detection
Nirav Soni
 
PPTX
Human presence detection based room light controller using pir2.pptx [repaired]
nikhilsinghia
 
DOCX
Automatic Altitude Control of Quadroto3
isaac chang
 
PPTX
motion sensing technology
Santosh Kumar
 
PPTX
fire fighting robot
ranjitha mudhiraj
 
PPTX
Fire Fighting Robot
Saadullah74
 
PPTX
Automatic fire fighting robot
MaulikGoyani5
 
PPTX
Mebin progress
focusandiscover
 
PDF
IRJET- Fire Fighting Robot using Arduino
IRJET Journal
 
PDF
IRJET-Android Controlled Firefighting Robot using Arduino
IRJET Journal
 
PPT
Fire Fighting Robot by saurabh
Saurabh Kumar
 
PPTX
Human Detection Robot
സുധീഷ് എസ്
 
PPTX
Sensors by khaleel
khaleel basha
 
PPTX
Fire fighting robot ppt
athmeg
 
PPTX
Sensors and its type by ss
sundas Shabbir
 
PPTX
Fire fighting robot
vijay kumar
 
Android Sensor and Framework - AWARE
DarrenJin
 
Generic sensors for the Web
Kenneth Rohde Christiansen
 
Design of Arduino based fire fighting Robot
Nilanjan Mandal
 
Fire fighting robot using 8051 microcontroller
vibs1893
 
Motion sensing and detection
Nirav Soni
 
Human presence detection based room light controller using pir2.pptx [repaired]
nikhilsinghia
 
Automatic Altitude Control of Quadroto3
isaac chang
 
motion sensing technology
Santosh Kumar
 
fire fighting robot
ranjitha mudhiraj
 
Fire Fighting Robot
Saadullah74
 
Automatic fire fighting robot
MaulikGoyani5
 
Mebin progress
focusandiscover
 
IRJET- Fire Fighting Robot using Arduino
IRJET Journal
 
IRJET-Android Controlled Firefighting Robot using Arduino
IRJET Journal
 
Fire Fighting Robot by saurabh
Saurabh Kumar
 
Human Detection Robot
സുധീഷ് എസ്
 
Sensors by khaleel
khaleel basha
 
Fire fighting robot ppt
athmeg
 
Sensors and its type by ss
sundas Shabbir
 
Fire fighting robot
vijay kumar
 

Similar to Sensors and location based services (20)

PPTX
Working with Windows Phone sensors, gps and maps
Malin De Silva
 
PPT
iwatchjr | Mobile Handset Sensors Coordinate System
iwatchjr
 
PPTX
Tk2323 lecture 10 sensor
MengChun Lam
 
PDF
Better motion control using accelerometer/gyroscope sensor fusion
Gabor Paller
 
PPTX
Sensors 9
Michael Shrove
 
PPT
Sensing Mobile Devices talk from QCon London 2013
Adam Blum
 
PDF
Electronic tour guide
Haneen Droubi
 
DOCX
Sensor android
Tarun Bamba
 
PDF
Motion recognition with Android devices
Gabor Paller
 
PDF
Get Moving with Core Motion
jblocksom
 
PDF
Week12.pdf
MuhammadMehran36
 
PDF
Android gps, location services, camera and sensors - Paramvir Singh
Paramvir Singh
 
PDF
How the Nintento Wii’s motion plus technology has opened the door to a wave o...
HitReach
 
PPT
INS3_ Inertial Navigation Systems _ 4 sensors.ppt
MazinAlsaedi1
 
PPTX
Base sensor
Grail Papat-iw
 
PDF
Input Output devices for Processing IoT Data
xdpavon45
 
PDF
Sensors in Android (old)
Ahsanul Karim
 
PPTX
Avi Itzkovitch- Designing with sensors
inUse
 
PPTX
Android location and sensors API
eleksdev
 
PDF
Panel: Affordable options for Indoor location and elevation
HitReach
 
Working with Windows Phone sensors, gps and maps
Malin De Silva
 
iwatchjr | Mobile Handset Sensors Coordinate System
iwatchjr
 
Tk2323 lecture 10 sensor
MengChun Lam
 
Better motion control using accelerometer/gyroscope sensor fusion
Gabor Paller
 
Sensors 9
Michael Shrove
 
Sensing Mobile Devices talk from QCon London 2013
Adam Blum
 
Electronic tour guide
Haneen Droubi
 
Sensor android
Tarun Bamba
 
Motion recognition with Android devices
Gabor Paller
 
Get Moving with Core Motion
jblocksom
 
Week12.pdf
MuhammadMehran36
 
Android gps, location services, camera and sensors - Paramvir Singh
Paramvir Singh
 
How the Nintento Wii’s motion plus technology has opened the door to a wave o...
HitReach
 
INS3_ Inertial Navigation Systems _ 4 sensors.ppt
MazinAlsaedi1
 
Base sensor
Grail Papat-iw
 
Input Output devices for Processing IoT Data
xdpavon45
 
Sensors in Android (old)
Ahsanul Karim
 
Avi Itzkovitch- Designing with sensors
inUse
 
Android location and sensors API
eleksdev
 
Panel: Affordable options for Indoor location and elevation
HitReach
 
Ad

Recently uploaded (20)

PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Python basic programing language for automation
DanialHabibi2
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Ad

Sensors and location based services

  • 1. SENSORS AND LOCATION BASED SERVICES ChinmayVS @ B.A.(U).G 14 JAN 2012
  • 2. Sensors & location based services • Compass - Bearing • Gyroscope, Accelerometer - Detect motion. • Barometer - Calculate Altitude. • nGPS http://goo.gl/RWEKL (Experimental.) SENSORS AND LOCATION BASED SERVICES 2
  • 3. cvs@BA(U)G$ who am i • Android >2yrs. Remember anyone? • - sensors development. 10million+ units sold. • Presently working @ PathPartnerTech.com SENSORS AND LOCATION BASED SERVICES 3
  • 4. “Sense-ors” on Android A sensor (also called detector) is a device that measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument. 1. ACCELEROMETER 2. GYROSCOPE 3. MAGNETIC_FIELD REAL 4. LIGHT 5. PRESSURE 6. AMBIENT_TEMP 7. RELATIVE_HUMIDITY 8. PROXIMITY VIRTUAL 9. LINEAR_ACCELERATION 10. GRAVITY 11. ROTATION_VECTOR DEPRECEATED 12. TEMPERATURE 13. ORIENTATION Sensors and location based services 4
  • 5. “Sense-ors” on Android A sensor (also called detector) is a device that measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument. 1. ACCELEROMETER 2. GRAVITY MOTION 3. LINEAR_ACCELERATION 4. GYROSCOPE 5. MAGNETIC FIELD POSITION 6. ORIENTATION 7. PROXIMITY 8. ROTATION VECTOR 9. LIGHT 10. BAROMETER ENVIRONMENT 11. AMBIENT TEMPERATURE 12. RELATIVE HUMIDITY 13. TEMPERATURE Sensors and location based services 5
  • 6. Sensors in Android applications • Use-cases of sensors in apps: 1. Active-Input 2. Passive-Input Application developer 3. Active-Passive 4. Auto-Rotate Android window manager Sensors and location based services 6
  • 7. Sensors in Android applications (1/4) • Active input Sensors and location based services 7
  • 8. Sensors in Android applications (2/4) • Passive input Sensors and location based services 8
  • 9. Sensors in Android applications (3/4) • Active-passive Sensors and location based services 9
  • 10. Sensors in Android applications (4/4) • Auto-rotate Sensors and location based services 10
  • 11. Compass : Bearing (Azimuth) 90o 180o Sensors and location based services 11
  • 12. Compass : Bearing • iPad as in-flight navigator. Android? • Magnetic north != Geographic North • WiFi / Network provider + Compass = GPS? POSITION (LAT, LONG) + BEARING Sensors and location based services 12
  • 13. Compass : Magnetic Declination Sensors and location based services 13
  • 14. Accelerometer, Gyroscope : Motion • |Accelerometer| != 9.8  Motion • Initial bearing + rotation of device, POSITION (LAT, LONG) + BEARING + SPEED Sensors and location based services 14
  • 15. Barometer : Altitude • Remember this ? “ WiFi / Network provider + Compass = GPS” now how about, “ WiFi / Network provider + Compass + Barometer ” POSITION (LAT, LONG) + BEARING + SPEED + ALTITUDE > GPS Sensors and location based services 15
  • 16. nGPS : World Geomagnetic model Sensors and location based services 16
  • 17. Using Sensors in your app SensorEvent http://goo.gl/hWOQu SensorManager http://goo.gl/1DRUv Examples : http://goo.gl/AVBDV http://goo.gl/eKq6a Sensors and location based services 17
  • 18. Sensor app-dev Tips and tricks  Sensor calibration. 1. one-turn deserves another (axes-calib) 2. zero-calib  Polling rate fastest/game/ui/normal?  Sensor fusion  Hard-way  Easy-way (Invensense ) http://goo.gl/bHmDe  Lessons from WindowOrientationListener.java Android/frameworks/base/core/java/android/view/WindowOrientationListener.java  When to register/unregister SensorEventListener  When to acquire/release Wakelocks Sensors and location based services 18
  • 19. WindowOrientationListener.java  Low-pass filter the tilt and orientation angles to avoid "twitchy" behaviour.  When the orientation angle reaches a certain threshold, transition  These thresholds have some hysteresis built-in to avoid oscillation.  Use the magnitude to judge the accuracy of the data.  Under ideal conditions, the magnitude should equal to that of gravity.  When it differs significantly, we know the device is under external acceleration  Use the tilt angle to judge the accuracy of orientation data.  When the tilt angle is high in magnitude, we distrust the orientation data.  When the device is flat, small physical motion = large changes in orientation angle. Sensors and location based services 19
  • 20. App-dev Tips and tricks register sensorEventListener acquire wakelock release wakelock unregister sensorEventListener Sensors and location based services 20
  • 21. Thank You!! Questions? android-porting android-developers android-kernel android-platform CONTACT ME Sensors and location based services 21