SlideShare a Scribd company logo

Designing An Android Sensor Subsystem and Solving Common Sensor Problems

An application developer-focused introduction to the underlying sensor system design considerations and their impact on your Android application. Common problems discussed and solved.

1 of 35
Designing An Android
 Sensor Subsystem


 Pitfalls and Considerations

        Jen Costillo
     jen@rebelbot.com
Simple Choices
               User                          Battery
            experience                     performance




7/15/2012           Costillo- OSCON 2012                 2
Established
                  or Innovative Product?
            Established                       Innovation-Driven
            • Will I be making another        • Do I have new sensors
               new product in 6                  types?
               months?                        • Are features more
            • Is the reference design            important than release
               considered good enough            date?
               for the application?           • Are money and
                                                 resources no
                                                 problem?



7/15/2012                       Costillo- OSCON 2012                      3
Forsaking Reference Designs




7/15/2012            Costillo- OSCON 2012   4
Going On Your Own
      • If you make your own,                  • But…
            – You’re on your own                    – power ↓
            – Integration pains                     – Control code size
            – Test time ↑                           – Control mechanical
            – Gesture testing                         footprint
              becomes a challenge                   – In-house expertise
            – Calibration blues
            – Larger mechanical
              footprint



7/15/2012                    Costillo- OSCON 2012                          5
Android Universe
                   Android Application                        Application
                      SensorManager
                                                              Frameworks
                          Sensor JNI
             Sensor Service      Sensor Manager
                                                               Libraries
                          Sensor HAL

            Interface Kernel
                 Driver
                                  Sensor Driver               Linux Kernel

            Sensor Hub/
            Coprocessor          Sensors                       Hardware
7/15/2012                              Costillo- OSCON 2012                  6
Ad

Recommended

Squeezing Blood From a Stone V1.2
Squeezing Blood From a Stone V1.2Squeezing Blood From a Stone V1.2
Squeezing Blood From a Stone V1.2Jen Costillo
 
Designing an android sensor subsystem costillo 20120214
Designing an android sensor subsystem costillo 20120214Designing an android sensor subsystem costillo 20120214
Designing an android sensor subsystem costillo 20120214Jen Costillo
 
Postdoc Symposium - Abram Hindle
Postdoc Symposium - Abram HindlePostdoc Symposium - Abram Hindle
Postdoc Symposium - Abram HindleICSM 2011
 
Extending Android with New Devices
Extending Android with New DevicesExtending Android with New Devices
Extending Android with New DevicesShree Kumar
 
Ssp 1 Functional Test Jan 5, 2011
Ssp 1 Functional Test Jan 5, 2011Ssp 1 Functional Test Jan 5, 2011
Ssp 1 Functional Test Jan 5, 2011ICT_FuncTestMan
 
Ideal 3D Stacked Die Test - IEEE Semiconductor Wafer Test Workshop SWTW 2013
Ideal 3D Stacked Die Test - IEEE Semiconductor Wafer Test Workshop SWTW 2013Ideal 3D Stacked Die Test - IEEE Semiconductor Wafer Test Workshop SWTW 2013
Ideal 3D Stacked Die Test - IEEE Semiconductor Wafer Test Workshop SWTW 2013Ira Feldman
 
Lessons for MEMS Test Engineers - Ira Feldman 111020
Lessons for MEMS Test Engineers - Ira Feldman 111020Lessons for MEMS Test Engineers - Ira Feldman 111020
Lessons for MEMS Test Engineers - Ira Feldman 111020Ira Feldman
 
S3 Group: Custom Mixed SIgnal SoCs
S3 Group: Custom Mixed SIgnal SoCsS3 Group: Custom Mixed SIgnal SoCs
S3 Group: Custom Mixed SIgnal SoCsS3 Group
 

More Related Content

Similar to Designing An Android Sensor Subsystem and Solving Common Sensor Problems

Introduction to OSLC and Linked Data
Introduction to OSLC and Linked DataIntroduction to OSLC and Linked Data
Introduction to OSLC and Linked Dataopenservices
 
Software engineering principles in system software design
Software engineering principles in system software designSoftware engineering principles in system software design
Software engineering principles in system software designTech_MX
 
Micro Focus COBOL Product Strategy & Roadmap
Micro Focus COBOL Product Strategy & RoadmapMicro Focus COBOL Product Strategy & Roadmap
Micro Focus COBOL Product Strategy & RoadmapMicro Focus
 
4 metals workshop igor quintao
4   metals workshop igor quintao4   metals workshop igor quintao
4 metals workshop igor quintaoGE_Energy
 
Discover problems in your distributed system before it's too late
Discover problems in your distributed system before it's too lateDiscover problems in your distributed system before it's too late
Discover problems in your distributed system before it's too lateReal-Time Innovations (RTI)
 
Bringing RFID to Electronics with Monza X RFID Chips
Bringing RFID to Electronics with Monza X RFID ChipsBringing RFID to Electronics with Monza X RFID Chips
Bringing RFID to Electronics with Monza X RFID ChipsImpinj RFID
 
Embedded system
Embedded systemEmbedded system
Embedded systemzdyhit
 
Android internals 06 - Binder, Typical subsystem (rev_1.1)
Android internals 06 - Binder, Typical subsystem (rev_1.1)Android internals 06 - Binder, Typical subsystem (rev_1.1)
Android internals 06 - Binder, Typical subsystem (rev_1.1)Egor Elizarov
 
FUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGN
FUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGNFUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGN
FUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGNPankaj Singh
 
S3 Group: Customized SoC Solutions
S3 Group: Customized SoC Solutions S3 Group: Customized SoC Solutions
S3 Group: Customized SoC Solutions S3 Group
 
Estimating packaged software - Eric van der Vliet - NESMA najaarsbijeenkomst ...
Estimating packaged software - Eric van der Vliet - NESMA najaarsbijeenkomst ...Estimating packaged software - Eric van der Vliet - NESMA najaarsbijeenkomst ...
Estimating packaged software - Eric van der Vliet - NESMA najaarsbijeenkomst ...Nesma
 
Using HBase Coprocessors to implement Prospective Search - Berlin Buzzwords -...
Using HBase Coprocessors to implement Prospective Search - Berlin Buzzwords -...Using HBase Coprocessors to implement Prospective Search - Berlin Buzzwords -...
Using HBase Coprocessors to implement Prospective Search - Berlin Buzzwords -...Christian Gügi
 
Rocketick accelerated verilog simulations
Rocketick  accelerated verilog simulationsRocketick  accelerated verilog simulations
Rocketick accelerated verilog simulationschiportal
 
Monitoring of Web Applications and GlassFish for Performance and Availability...
Monitoring of Web Applications and GlassFish for Performance and Availability...Monitoring of Web Applications and GlassFish for Performance and Availability...
Monitoring of Web Applications and GlassFish for Performance and Availability...SL Corporation
 
GeneXus en Mitsubishi Heavy Industries (MHI) – Japón
GeneXus en Mitsubishi Heavy Industries (MHI) – JapónGeneXus en Mitsubishi Heavy Industries (MHI) – Japón
GeneXus en Mitsubishi Heavy Industries (MHI) – JapónGeneXus
 
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)Egor Elizarov
 
regmap: The power of subsystems and abstractions
regmap: The power of subsystems and abstractionsregmap: The power of subsystems and abstractions
regmap: The power of subsystems and abstractionsMark Brown
 
Sunrise Presentation, Company Overview 2012
Sunrise Presentation, Company Overview 2012Sunrise Presentation, Company Overview 2012
Sunrise Presentation, Company Overview 2012jvangombos
 

Similar to Designing An Android Sensor Subsystem and Solving Common Sensor Problems (20)

Introduction to OSLC and Linked Data
Introduction to OSLC and Linked DataIntroduction to OSLC and Linked Data
Introduction to OSLC and Linked Data
 
Software engineering principles in system software design
Software engineering principles in system software designSoftware engineering principles in system software design
Software engineering principles in system software design
 
Improve Android System Component Performance
Improve Android System Component PerformanceImprove Android System Component Performance
Improve Android System Component Performance
 
Micro Focus COBOL Product Strategy & Roadmap
Micro Focus COBOL Product Strategy & RoadmapMicro Focus COBOL Product Strategy & Roadmap
Micro Focus COBOL Product Strategy & Roadmap
 
4 metals workshop igor quintao
4   metals workshop igor quintao4   metals workshop igor quintao
4 metals workshop igor quintao
 
Discover problems in your distributed system before it's too late
Discover problems in your distributed system before it's too lateDiscover problems in your distributed system before it's too late
Discover problems in your distributed system before it's too late
 
Bringing RFID to Electronics with Monza X RFID Chips
Bringing RFID to Electronics with Monza X RFID ChipsBringing RFID to Electronics with Monza X RFID Chips
Bringing RFID to Electronics with Monza X RFID Chips
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Android internals 06 - Binder, Typical subsystem (rev_1.1)
Android internals 06 - Binder, Typical subsystem (rev_1.1)Android internals 06 - Binder, Typical subsystem (rev_1.1)
Android internals 06 - Binder, Typical subsystem (rev_1.1)
 
FUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGN
FUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGNFUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGN
FUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGN
 
S3 Group: Customized SoC Solutions
S3 Group: Customized SoC Solutions S3 Group: Customized SoC Solutions
S3 Group: Customized SoC Solutions
 
Estimating packaged software - Eric van der Vliet - NESMA najaarsbijeenkomst ...
Estimating packaged software - Eric van der Vliet - NESMA najaarsbijeenkomst ...Estimating packaged software - Eric van der Vliet - NESMA najaarsbijeenkomst ...
Estimating packaged software - Eric van der Vliet - NESMA najaarsbijeenkomst ...
 
Using HBase Coprocessors to implement Prospective Search - Berlin Buzzwords -...
Using HBase Coprocessors to implement Prospective Search - Berlin Buzzwords -...Using HBase Coprocessors to implement Prospective Search - Berlin Buzzwords -...
Using HBase Coprocessors to implement Prospective Search - Berlin Buzzwords -...
 
Rocketick accelerated verilog simulations
Rocketick  accelerated verilog simulationsRocketick  accelerated verilog simulations
Rocketick accelerated verilog simulations
 
Monitoring of Web Applications and GlassFish for Performance and Availability...
Monitoring of Web Applications and GlassFish for Performance and Availability...Monitoring of Web Applications and GlassFish for Performance and Availability...
Monitoring of Web Applications and GlassFish for Performance and Availability...
 
GeneXus en Mitsubishi Heavy Industries (MHI) – Japón
GeneXus en Mitsubishi Heavy Industries (MHI) – JapónGeneXus en Mitsubishi Heavy Industries (MHI) – Japón
GeneXus en Mitsubishi Heavy Industries (MHI) – Japón
 
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
 
regmap: The power of subsystems and abstractions
regmap: The power of subsystems and abstractionsregmap: The power of subsystems and abstractions
regmap: The power of subsystems and abstractions
 
Sunrise Presentation, Company Overview 2012
Sunrise Presentation, Company Overview 2012Sunrise Presentation, Company Overview 2012
Sunrise Presentation, Company Overview 2012
 
Sunrise presentation
Sunrise presentationSunrise presentation
Sunrise presentation
 

Recently uploaded

Dynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineeringDynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineeringMassimo Talia
 
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24Umar Saif
 
"Platform Engineering with Development Containers", Igor Fesenko
"Platform Engineering with Development Containers", Igor Fesenko"Platform Engineering with Development Containers", Igor Fesenko
"Platform Engineering with Development Containers", Igor FesenkoFwdays
 
Building Products That Think- Bhaskaran Srinivasan & Ashish Gupta
Building Products That Think- Bhaskaran Srinivasan & Ashish GuptaBuilding Products That Think- Bhaskaran Srinivasan & Ashish Gupta
Building Products That Think- Bhaskaran Srinivasan & Ashish GuptaISPMAIndia
 
"Testing of Helm Charts or There and Back Again", Yura Rochniak
"Testing of Helm Charts or There and Back Again", Yura Rochniak"Testing of Helm Charts or There and Back Again", Yura Rochniak
"Testing of Helm Charts or There and Back Again", Yura RochniakFwdays
 
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner,  Challenge Like a VC by former CPO, TripadvisorAct Like an Owner,  Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner, Challenge Like a VC by former CPO, TripadvisorProduct School
 
My sample product research idea for you!
My sample product research idea for you!My sample product research idea for you!
My sample product research idea for you!KivenRaySarsaba
 
Power of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfPower of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfkatalinjordans1
 
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsEvangelia Mitsopoulou
 
My Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceMy Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceVijayananda Mohire
 
Digital Transformation Strategy & Plan Templates - www.beyondthecloud.digital...
Digital Transformation Strategy & Plan Templates - www.beyondthecloud.digital...Digital Transformation Strategy & Plan Templates - www.beyondthecloud.digital...
Digital Transformation Strategy & Plan Templates - www.beyondthecloud.digital...MarcovanHurne2
 
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions..."How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...Fwdays
 
How we think about an advisor tech stack
How we think about an advisor tech stackHow we think about an advisor tech stack
How we think about an advisor tech stackSummit
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Product School
 
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...Adrian Sanabria
 
How AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptxHow AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptxInfosec
 
Campotel: Telecommunications Infra and Network Builder - Company Profile
Campotel: Telecommunications Infra and Network Builder - Company ProfileCampotel: Telecommunications Infra and Network Builder - Company Profile
Campotel: Telecommunications Infra and Network Builder - Company ProfileCampotelPhilippines
 
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Product School
 
Imaging and Design for the Online Environment Part 1.pptx
Imaging and Design for the Online Environment Part 1.pptxImaging and Design for the Online Environment Part 1.pptx
Imaging and Design for the Online Environment Part 1.pptxPower Point
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Product School
 

Recently uploaded (20)

Dynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineeringDynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineering
 
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
 
"Platform Engineering with Development Containers", Igor Fesenko
"Platform Engineering with Development Containers", Igor Fesenko"Platform Engineering with Development Containers", Igor Fesenko
"Platform Engineering with Development Containers", Igor Fesenko
 
Building Products That Think- Bhaskaran Srinivasan & Ashish Gupta
Building Products That Think- Bhaskaran Srinivasan & Ashish GuptaBuilding Products That Think- Bhaskaran Srinivasan & Ashish Gupta
Building Products That Think- Bhaskaran Srinivasan & Ashish Gupta
 
"Testing of Helm Charts or There and Back Again", Yura Rochniak
"Testing of Helm Charts or There and Back Again", Yura Rochniak"Testing of Helm Charts or There and Back Again", Yura Rochniak
"Testing of Helm Charts or There and Back Again", Yura Rochniak
 
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner,  Challenge Like a VC by former CPO, TripadvisorAct Like an Owner,  Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
 
My sample product research idea for you!
My sample product research idea for you!My sample product research idea for you!
My sample product research idea for you!
 
Power of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfPower of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdf
 
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applications
 
My Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceMy Journey towards Artificial Intelligence
My Journey towards Artificial Intelligence
 
Digital Transformation Strategy & Plan Templates - www.beyondthecloud.digital...
Digital Transformation Strategy & Plan Templates - www.beyondthecloud.digital...Digital Transformation Strategy & Plan Templates - www.beyondthecloud.digital...
Digital Transformation Strategy & Plan Templates - www.beyondthecloud.digital...
 
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions..."How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
 
How we think about an advisor tech stack
How we think about an advisor tech stackHow we think about an advisor tech stack
How we think about an advisor tech stack
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
 
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...
Avoiding Bad Stats and the Benefits of Playing Trivia with Friends: PancakesC...
 
How AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptxHow AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptx
 
Campotel: Telecommunications Infra and Network Builder - Company Profile
Campotel: Telecommunications Infra and Network Builder - Company ProfileCampotel: Telecommunications Infra and Network Builder - Company Profile
Campotel: Telecommunications Infra and Network Builder - Company Profile
 
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
 
Imaging and Design for the Online Environment Part 1.pptx
Imaging and Design for the Online Environment Part 1.pptxImaging and Design for the Online Environment Part 1.pptx
Imaging and Design for the Online Environment Part 1.pptx
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
 

Designing An Android Sensor Subsystem and Solving Common Sensor Problems

  • 1. Designing An Android Sensor Subsystem Pitfalls and Considerations Jen Costillo jen@rebelbot.com
  • 2. Simple Choices User Battery experience performance 7/15/2012 Costillo- OSCON 2012 2
  • 3. Established or Innovative Product? Established Innovation-Driven • Will I be making another • Do I have new sensors new product in 6 types? months? • Are features more • Is the reference design important than release considered good enough date? for the application? • Are money and resources no problem? 7/15/2012 Costillo- OSCON 2012 3
  • 4. Forsaking Reference Designs 7/15/2012 Costillo- OSCON 2012 4
  • 5. Going On Your Own • If you make your own, • But… – You’re on your own – power ↓ – Integration pains – Control code size – Test time ↑ – Control mechanical – Gesture testing footprint becomes a challenge – In-house expertise – Calibration blues – Larger mechanical footprint 7/15/2012 Costillo- OSCON 2012 5
  • 6. Android Universe Android Application Application SensorManager Frameworks Sensor JNI Sensor Service Sensor Manager Libraries Sensor HAL Interface Kernel Driver Sensor Driver Linux Kernel Sensor Hub/ Coprocessor Sensors Hardware 7/15/2012 Costillo- OSCON 2012 6
  • 7. Application Frameworks Libraries Linux Kernel HARDWARE Hardware 7/15/2012 Costillo- OSCON 2012 7
  • 8. Hardware Architecture 7/15/2012 Costillo- OSCON 2012 8
  • 9. Sampling Rates: The 3 Rates Under-sampling Over-sampling • Inaccurate, sluggish • Accurate, smooth response response • Slight power savings • Power-hungry Sampling Rate 7/15/2012 Costillo- OSCON 2012 9
  • 10. Wake up events and power considerations Application Internal External Processor only Coprocessor Processor D C Reference supported Reference supported More processor selection Most power hungry Most work done for More outcome control you Most customized Footprint impact 7/15/2012 Costillo- OSCON 2012 10
  • 11. Hardware Summary Power Latency = Consumption Max(sensorsn) Sensor = Σ sensorsn + + dedicated Solution any dedicated processing processor time • Use tie-breaker criteria 7/15/2012 Costillo- OSCON 2012 11
  • 12. Application Frameworks Libraries Linux Kernel KERNEL Hardware 7/15/2012 Costillo- OSCON 2012 12
  • 13. Kernel Driver Application Processor Peripheral Shared Interface Memory Microcontroller Sensor Coprocessor 7/15/2012 Costillo- OSCON 2012 13
  • 14. Application Frameworks Libraries Linux Kernel LIBRARIES AND SERVICES Hardware 7/15/2012 Costillo- OSCON 2012 14
  • 15. Sensor HAL and Services • HAL device/<vendor>/<board name>/libsensors • Service frameworks/base/services/sensorservice • Manager frameworks/base/libs/gui 7/15/2012 Costillo- OSCON 2012 15
  • 16. Sensor Fusion Libraries Linux Kernel Sensor Hub Sensors http://en.wikipedia.org/wiki/Sensor_fusion https://www.llnl.gov/news/newsreleases/2010/NR-10-01-06.html 7/15/2012 Costillo- OSCON 2012 16
  • 17. Gesture Detection Algorithm Application Android Processor SensorService Co- Sensor Hub Processor Sensors MPU with Barometer Proximity Gyro/Accel Compass 7/15/2012 Costillo- OSCON 2012 17
  • 18. Gesture Detection Comparison Make Buy Application • Powerful processor Minimal Off-load AppPro Schedule Impact In-house Already Tested expertise &tuned Complete Compact code solution Sensor hub • Off-load to cheaper power • Wake up Event Handling 7/15/2012 Costillo- OSCON 2012 18
  • 19. Calibration Use of Calibration Gesture in the Compass App By Catch.com 7/15/2012 19 Costillo- OSCON 2012
  • 20. Application Frameworks Libraries Linux Kernel FRAMEWORKS Hardware 7/15/2012 Costillo- OSCON 2012 20
  • 21. Virtual Sensors • Leverages 1+ physical or other virtual sensors • Multiple Options – Google (version 3) – Reference Vendor – Sensor Vendors 7/15/2012 Costillo- OSCON 2012 21
  • 22. Android Virtual Sensors Accel Gravity Gravity Linear Accel Accel 7/15/2012 Costillo- OSCON 2012 22
  • 23. Android Virtual Sensors Gyro Accel Orientation Compass Accel Rotation 7/15/2012 Costillo- OSCON 2012 23
  • 24. Virtual Sensors Challenges Sensor 1 • Garbage In- Garbage Out • Latency Sensor Virtual 2 Output • Non-Synchronized samples Sensor 1 • Implementation Virtual Dependencies 1 • Multi-vendor problems, Sensor Virtual 2 2 verify Vendor ID http://www.invensense.com/midc/presentations/James%20Lim.pdf 7/15/2012 Costillo- OSCON 2012 24
  • 25. Application Frameworks Libraries Linux Kernel APPLICATIONS Hardware 7/15/2012 Costillo- OSCON 2012 25
  • 26. Using Sensors mSensorManager = getSystemService(Context.SENSOR_SERVICE); mSensorManager.registerListener( mSensorListener, mSensorManager.getDefaultSensor( Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL); void onSensorChanged(SensorEvent event) { // get sensor data float x = event.values[SensorManager.DATA_X]; } 7/15/2012 Costillo- OSCON 2012 26
  • 27. Using Sensor (Continued) SensorManager.getRotationMatrix( m_rotationMatrix, null, m_Mag, m_Accels); SensorManager.getOrientation( m_rotationMatrix, m_orientation); float yaw_deg = m_orientation[0] * 57.2957795f; float pitch_deg = m_orientation[1] * 57.2957795f; float roll_deg = m_orientation[2] * 57.2957795f; 7/15/2012 Costillo- OSCON 2012 27
  • 28. Types of Sensor Problems • Bias • Drift • Settling Time • Jitter/Noise • Environmental Interference 7/15/2012 Costillo- OSCON 2012 28
  • 29. Bias • Problem: Data is off by a constant value. • Sources: – static calibration failure • Solutions: – Calculate linear offset at start of application – Recalibrate locally 7/15/2012 Costillo- OSCON 2012 29
  • 30. Drift • Problem: Shift of data without cause • Sources: – Magnetic interference – Poor HW calibration • Solutions: – Increase smoothing techniques 7/15/2012 Costillo- OSCON 2012 30
  • 31. Settling Time • Problem: Extended time before finalized steady data. • Sources: – Latency – Sensitivity • Solutions: – Limit additional processing 7/15/2012 Costillo- OSCON 2012 31
  • 32. Noise • Problem: Data jumps around constantly • Sources: – Sensor – Calibration – Poor filtering • Solutions: – High pass filter – Linear averaging – FFT 7/15/2012 Costillo- OSCON 2012 32
  • 33. Environmental Interference • Problem: Inconsistent results • Sources: – Magnetometer – EMI • Solutions: – Reference Device – Calibration gesture 7/15/2012 Costillo- OSCON 2012 33
  • 34. Best Practices in Application Development • Select the right sensor for the job. • Use the Correct Data Rate. – UI or GAMING are the most common. • Use Sensor In Context • Customize for your hardware and system capabilities • Magnetometer-based sensors are the most touchy. • Keep the Gesture UI simple. 7/15/2012 Costillo- OSCON 2012 34
  • 35. QUESTIONS? JEN@REBELBOT.COM Additional resources http://processors.wiki.ti.com/index.php/Android_Sensor_PortingGuide http://www.kandroid.org/online-pdk/guide/sensors.html http://invensense.com/midc/ http://developer.android.com/reference/android/hardware/SensorEvent.html 7/15/2012 Costillo- OSCON 2012 35