LEVERAGING ACCELEROMETERS IN MOBILE DEVICES

LEVERAGING ACCELEROMETERS IN MOBILE DEVICES

I gave this presentation at FITC "Screens" in Toronto sometime in 2009 to a room of about fifty.

D4e6eb8ffdbc19c6394eec58895509a9?s=128

Scott Janousek

April 25, 2009
Tweet

Transcript

  1. scott janousek LEVERAGING ACCELEROMETERS IN MOBILE DEVICES Scott Janousek, Hooken

    Mobile
  2. scott janousek AGENDA INTRO OVERVIEW MOBILE DEVICES & PLATFORMS OUTRO

  3. scott janousek INTRO

  4. scott janousek MINI BIO Founder & Lead Developer, Hooken Mobile

    Developer, Evangelist, Coauthor, Educator, Gadget Geek Flash > 8 years Mobile & Devices >= 4 years Symbian, webOS, Android, iPhone = Core Targets Work with OEMS, partners ... those using Flash & related tech Scott Janousek
  5. scott janousek HOW MANY PEOPLE ... ARE IPHONE DEVELOPERS? WEBOS?

    ANDROID? SYMBIAN? WINDOWS MOBILE? RIM? FLASH? OTHERS?
  6. scott janousek HOW MANY PEOPLE ... ... ARE NEW TO

    ACCELEROMETER? ... HAVE WORKED WITH AN ACCELEROMETER API? ... ON WHAT PLATFORMS?
  7. scott janousek READ THIS

  8. scott janousek JUSTIFICATION “Over 1/3 of Mobile Phones are expected

    to integrate accelerometers by 2010 ...” - iSuppli
  9. scott janousek OVERVIEW

  10. scott janousek CONTROLLER EVOLUTION “Joysticks” Embedded Accelerometers 80’s 90’s 2008

    >= 2009 Mobile Pointers
  11. scott janousek BEHIND THE SCENES

  12. scott janousek MATH & PHYSICS

  13. scott janousek THE 3RD DIMENSION

  14. scott janousek 3 AXIS COORDINATE SYSTEM X AXIS Y AXIS

    Z AXIS
  15. scott janousek GRAVITY 9.81 m/s²

  16. scott janousek BASICS MEASURES ACCELERATION OF DEVICE RELATIVE TO FREE

    FALL
  17. scott janousek PULLING G’S 7 g's = 68.64655 m /

    s2
  18. scott janousek “OLD SCHOOL” (LINEAR) “ACCELEROMETER” IN 1783 GEORGE ATWOOD

    (1746-1807) ENGLISH PHYSICIST
  19. scott janousek “NEW SCHOOL”

  20. scott janousek TYPES SINGLE AXIS ACCELEROMETERS (X OR Y OR

    Z) MULTI AXIS ACCELEROMETERS (X & Y & Z)
  21. scott janousek DETECTS ... MAGNITUDE & DIRECTION OF ACCELERATION AS

    A VECTOR QUANTITY
  22. scott janousek MEASUREMENTS Static Acceleration (aka Gravity) Tilt of an

    object Dynamic Acceleration Shock to an Object Velocity Orientation Vibration of an object
  23. scott janousek DETECTION OF ... ORIENTATION VIBRATION SHOCK

  24. scott janousek MOBILE GESTURES SWIPE postive-negative spike SHAKE oscillating wave

    ROTATE 2 axis change
  25. scott janousek HARDWARE

  26. scott janousek TYPES Capacitive Accelerometers sense a change in electrical

    capacitance, with respect to acceleration. The accelerometer senses the capacitance change between a static condition and the dynamic state. Piezoelectric Accelerometers use materials such as crystals, which generate electric potential from an applied stress. This is known as the piezoelectric effect. As stress is applied, such as acceleration, an electrical charge is created. Piezoresistive Accelerometers (strain gauge accelerometers) work by measuring the electrical resistance of a material when mechanical stress is applied Hall Effect Accelerometers measure voltage variations stemming from a change in the magnetic field around the accelerometer. Magnetoresistive Accelerometers work by measuring changes in resistance due to a magnetic field. The structure and function is similar to a Hall Effect accelerometer except that instead of measuring voltage, the magnetoresistive accelerometer measures resistance. Heat transfer Accelerometers measure internal changes in heat transfer due to acceleration. A single heat source is centered in a substrate and suspended across a cavity. Thermoresistors are spaced equally on all four sides of the suspended heat source. Under zero acceleration the heat gradient will be symmetrical. Acceleration in any direction causes the heat gradient to become asymmetrical due to convection heat transfer. Future Accelerometer Advancements In the next decade, NANO technology will create new applications and dramatically reshape this area of technology. MEMS-Based Accelerometers MEMS (Micro-Electro Mechanical System) technology is based on a number of tools and methodologies, which are used to form small structures with dimensions in the micrometer scale (one millionth of a meter). This technology is now being utilized to manufacture state of the art MEMS-Based Accelerometers.
  27. scott janousek MEMS MEMS = Microelectromechnical System Accelerometers = MEMS

    “Sensors” Motion Sensors are fraction of MEMS out there in mobile devices
  28. scott janousek USE CASES

  29. scott janousek USAGE Menu Navigation Pedometer GPS-Dead Reckoning Gaming Telephony

    Power conservation 3-D object manipulation Screen Rotation Gestures Fall Detection Scrolling Tap Detection Camera Stabilization & More!
  30. scott janousek MARKETS Navigation Medical Engineering Transport Building & Structural

    Monitoring (dynamic loads) Machinery Health Monitoring Mobile & other Electronic Devices
  31. scott janousek ... HELP US SNAP BETTER MEDIA Image Stabilization

  32. scott janousek ...MAKES LIVES JUST A TINY BIT EASIER ...

    txtr eBook Reader http://reader.txtr.com/ Kindle DX http://www.kindle.com/
  33. scott janousek Nintendo Wii Remote (3 axis accelerometer) Playstation 3

    - Dual Shock Controller (6 axis accelerometer) ... KEEPS US ENTERTAINED
  34. scott janousek ... PROTECT OUR DATA! IBM/Leveno (Active Protection System)

    Apple MacBook Pro (Sudden Motion Sensor)
  35. scott janousek ... HELP US STAY IN SHAPE! FitBit -

    http://www.fitbit.com/
  36. scott janousek ... IMPROVES MOBILE EXPERIENCES ! Android, Symbian, Windows

    Mobile, iPhone, webOS, RIM, other devices ... iPod HTC Hero iPhone BlackBerry SEMC 905C Pre Touch Diamond Omnia N97 Zune HD
  37. scott janousek CORE SMARTPHONE FEATURES Camera WiFi & 3G GPS

    TouchScreen (ideally Multi-touch) Accelerometer
  38. scott janousek MOBILE DEVICES & PLATFORMS

  39. scott janousek FLASH ENABLED MOBILE DEVICE PLATFORMS

  40. scott janousek S60 S60 Mobile Device Platform is underlying OS

    Nokia has millions of S60 (Symbian) devices on market Most SmartPhones from Nokia have accelerometers (e.g. N900, X-Series, Nokia N97, N96/95, 5800, 5500 Sport)
  41. scott janousek WAYS TO TAP ... First Party Solution Nokia

    S60 PLATFORM SERVICES 3rd Party Solutions (Flash only Solution) (Native, Flash, other platform access)
  42. scott janousek S60 PLATFORM SERVICES 1.) Download from www.forum.nokia.com: ActionScript

    Library for S60 Platform Services S60_ActionScript_API_library_1_0.zip 2.) Copy the folder to: /Users/$username/Library/Application/Support/Adobe/Flash   CS4/en/Configuration \%USERPROFILE%\Local  Settings\Application  Data\Adobe \Flash  CS3\en\Configuration\Classes\
  43. scott janousek S60 PLATFORM SERVICES //-- Import Platform Service Interface

    import com.nokia.lib.Service; //-- Create a new Service object which has Sensor data var sensors = new Service( "Service.Sensor", "ISensor" ); //-- Define input parameters for picking Rotation sensor var inParam = { SearchCriterion:"Rotation" }; //-- Define result value var outParams = sensors.FindSensorChannel( inParam );
  44. scott janousek S60 PLATFORM SERVICES //-- Define channel info (rotation)

    var channelInfo = outParams.ReturnValue; //-- Define valid values for channel info var channelId = channelInfo[0].ChannelId; var contextType = channelInfo[0].ContextType; var quantity = channelInfo[0].Quantity; var channelType = channelInfo[0].ChannelType; var location = channelInfo[0].Location; var vendorId = channelInfo[0].VendorId; var dataItemSize = channelInfo[0].DataItemSize; var channelDataTypeId = channelInfo[0].ChannelDataTypeId; var channelInfo = { " ChannelId:channelId, ContextType:contextType, Quantity:quantity, " ChannelType:channelType, Location:location, VendorId:vendorId, " DataItemSize:dataItemSize, ChannelDataTypeId:channelDataTypeId }
  45. scott janousek S60 PLATFORM SERVICES (CONT) //-- Define input parameters

    for listening rotation channel data var inParams = { ListeningType:"ChannelData", ChannelInfoMap:channelInfo }; //-- The RegisterForNotification method registers the user to receive data from //-- one sensor channel asynchronously sensors.RegisterForNotification( inParams, callBack ); //-- Because this is an asynchronous method, you need to define the callback function //-- Callback function includes all the channel data function callBack( transactionID:String, eventID:String, outParam:Object ) { " if ( outParam.ErrorCode == 0 ) { " " var channelData = outParam.ReturnValue; " " var xRot = channelData.XRotation; " " var yRot = channelData.YRotation; " " var zRot = channelData.ZRotation; " } else { " " var errorId = outParam.ErrorCode; " } }
  46. scott janousek S60 PLATFORM SERVICES EXAMPLE

  47. scott janousek KUNERI LITE Flash Lite does not (natively) support

    Accelerometer API Kuneri Lite = 3-rd Party “Extender” Kuneri Lite Accelerometer “Plug-in” http://wiki.kunerilite.net/index.php?title=Accelerometer_plugin
  48. scott janousek KUNERI LITE ARCHITECTURE Architecture Flash Lite (1.1/2.x/3.x) ActionScript

    Kuneri Lite Server Symbian C++ Kuneri Lite Plug-ins (GPS, Camera, etc) S60 on device Local HTTP calls Native Native
  49. scott janousek KUNERI LITE ACCELEROMETER API Start Sensor loadVariables("http://127.0.0.1:1001/Basic/accelerometer?klCommand=readsensor", MC

    ); Stop Sensor loadVariables("http://127.0.0.1:1001/Basic/accelerometer?klCommand=stopsensor", MC ); Read Sensor loadVariables("http://127.0.0.1:1001/Basic/accelerometer?klCommand=startsensor", MC );
  50. scott janousek KUNERI LITE EXAMPLE

  51. scott janousek FLASH 10 & ACCELEROMETER Multitouch Accelerometer * GPS

    * Other Features = TBD * Check out Mark Doherty’s session here at FITC for more info Flash Lite now, Flash 10 = 2010
  52. scott janousek SONY ERICSSON

  53. scott janousek SONY ERICSSON 18/19 new devices from Sony Ericsson

    have Accelerometers Motion sensor in games, picture UI, & auto rotation “Shaker Feature” = task switching in music player, etc Can use J2ME and/or Flash to tap into accelerometer API
  54. scott janousek NATIVE FLASH API Tapping into Accelerometer via Flash

    Lite //-- returns back X,Y,Z values from accelerometer sensor into //-- accX, accY, accZ variables (if supported on target device) loadVariables("accelerometer://data", _root ); Accessing Accelerometer via Flash Lite var sensorCheck_bool:Boolean = true; onEnterFrame = function { loadVariables("accelerometer://data", _root); if (sensorCheck_bool) { //-- only check sensor once! sensorCheck_bool = false; if (accX != undefined && accY != undefined && accZ != undefined) { //-- sensor is reporting, so continue } else { trace("No sensor is reporting! Is this a supported device?"); } } }
  55. scott janousek CAPUCHIN API TAPPING ACCELEROMETER VIA CAPUCHIN http://developer.sonyericsson.com/

  56. scott janousek CHUMBY

  57. scott janousek CHUMBY - WHAT IS IT? Fun, Open Source

    Linux Device TouchScreen, Accelerometer, Microphone, Speakers, WiFi Flash Lite 3.x User Interface & Widgets Not Portable without a “Battery Hack”! :)
  58. scott janousek CHUMBY - ORIENTATIONS Source: Developing widgets for Chumby

    with Flash Lite 3 http://www.adobe.com/devnet/devices/articles/chumby_development.html
  59. scott janousek CHUMBY - FLASH API Source: Developing Flash Lite

    Widgets for the Chumby Platform http://www.slideshare.net/scottjanousek/developing-flash-lite-widgets-for-the-chumby-platform
  60. scott janousek CHUMBY Source: Cloud Clock http://www.chumby.com/guide/widget/Cloud%20Clock

  61. scott janousek CHUMBY - SOME RESOURCES Developing widgets for Chumby

    with Flash Lite 3 Includes ActionScript 2.0 Accelerometer Class you can reuse Source: http://www.adobe.com/devnet/devices/articles/chumby_development_06.html AdvancED Flash on Devices - Flash Lite and Flash 10 Chapter 7 - Mobile and Devices Widgets on the Flash Platform (pg 203) http://advancED.flashmobilebook.com/
  62. scott janousek WEBOS

  63. scott janousek Set ability to switch orientation this.controller.listen(document, 'orientationchange', this.handleOrientation.bindAsEventListener(this));

    handleOrientation(event) { … } //.position=[1:5], .roll=float, .pitch=float Run code when orientation changes this.controller.listen(document, 'orientationchange', this.handleOrientation.bindAsEventListener(this)); handleOrientation(event) { … } //.position=[1:5], .roll=float, .pitch=float Set ability to switch orientation if (this.controller.stageController.setWindowOrientation) { this.controller.stageController.setWindowOrientation("free"); } Run code when orientation changes this.controller.listen(document, 'orientationchange', this.handleOrientation.bindAsEventListener(this)); handleOrientation(event) { … } //.position=[1:5], .roll=float, .pitch=float WEB OS
  64. scott janousek WEB OS EXAMPLE AccellBall Example

  65. scott janousek IPHONE

  66. scott janousek LIS302DL COMPONENT LIS302DL Accelerometer

  67. scott janousek IPHONE AXIS

  68. scott janousek OBJECTIVE-C & CLASSES

  69. scott janousek ACCELEROMETER SIMULATOR http://code.google.com/p/accelerometer-simulator/ http:/ / www.iphonearch.com/ topic/6/iphone- accelerometer-simulator

    http:/ /code.google.com/p/acc
  70. scott janousek IPHONE EXAMPLE http:/ /www.switchonthecode.com/tutorials iphone-application-with-interface-builder gravity tutorials ...

    http:/ /mashable.com/ 2008/12/03/iphone- games-accelerometer/ http:/ /www.tuaw.com/2007 /09/10/iphon http:/ /www.switchonthecode.com/tutoria accelerometer Gravity Tutorial from Keith Peters
  71. scott janousek ANDROID

  72. scott janousek ANDROID API Haven’t explored yet ... :( API

    exists Very similar to iPhone
  73. scott janousek

  74. scott janousek BUG COMPONENTS

  75. scott janousek BUGMOTION Module Collar to reduce motion detection field

    for “spot” detection Motion Sensor 2m range Passive Infrared (PIR) Sensor Sensing Area: 110 degrees horizontal, 93 vertical 80 zones sensitivity 10m rated detection distance Accelerometer 3-Axis accelerometer Software selectable sensitivity (2.5g/3.3g/6.7g/10g) Low non-linerarity ( less than +/- 1% FSO)
  76. scott janousek BUG COMMUNITY APPS http://www.buglabs.net/applications?tag=accelerometer

  77. scott janousek OUTRO

  78. scott janousek Q & A What are your questions?

  79. scott janousek RESOURCES My FITC 2009 Site http://fitc2009.scottjanousek.com/ SEMC Developer’s

    Site http://developer.sonyericsson.com/ Forum Nokia http://wiki.forum.nokia.com/index.php/Sensor_API http://wiki.forum.nokia.com/index.php/CS001253_-_Displaying_sensor_data_in_Flash_Lite http://wiki.forum.nokia.com/index.php/ How_to_use_S60_Platform_Services_to_create_accelerometer_based_ user_interaction_with_Adobe_Flash_Lite
  80. scott janousek RESOURCES (CONT) iPhone Resources http://www.bit-101.com/blog/?p=1824 http://www.iphonedevsdk.com/ http://www.geekpedia.com/PageView2916_iPhone-Tutorial--Reading-the-Accelerometer.html Android

    Resources Search on Android, Accelerometer on google. :) Chumby http://www.adobe.com/devnet/devices/articles/chumby_development_06.html
  81. scott janousek RESOURCES (CONT) webOS http://www.webos-internals.org/wiki/Accelerometer BugLabs http://www.buglabs.net/modules/bugmotion Audrino http://www.arduino.cc

  82. scott janousek THE “NEXT” THINGS ... iSuppli predicts the industry

    for MEMS components will grow from $460 million last year to over $1.6 billion in 2013. The company also expects technology such as gyroscopes and projectors to hit the market as early as 2010.
  83. scott janousek THE “NEXT” THINGS ... Magnetometer = Electronic Compasses

    Precise Location = Magnetometer + Accelerometer + GPS + (Camera) Next Generation = Augmented Reality + Precise Location
  84. scott janousek THANKS!