Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

Scott Janousek

April 25, 2009
Tweet

More Decks by Scott Janousek

Other Decks in Technology

Transcript

  1. 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
  2. scott janousek HOW MANY PEOPLE ... ARE IPHONE DEVELOPERS? WEBOS?

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

    ACCELEROMETER? ... HAVE WORKED WITH AN ACCELEROMETER API? ... ON WHAT PLATFORMS?
  4. scott janousek JUSTIFICATION “Over 1/3 of Mobile Phones are expected

    to integrate accelerometers by 2010 ...” - iSuppli
  5. scott janousek TYPES SINGLE AXIS ACCELEROMETERS (X OR Y OR

    Z) MULTI AXIS ACCELEROMETERS (X & Y & Z)
  6. scott janousek MEASUREMENTS Static Acceleration (aka Gravity) Tilt of an

    object Dynamic Acceleration Shock to an Object Velocity Orientation Vibration of an object
  7. 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.
  8. scott janousek MEMS MEMS = Microelectromechnical System Accelerometers = MEMS

    “Sensors” Motion Sensors are fraction of MEMS out there in mobile devices
  9. 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!
  10. scott janousek MARKETS Navigation Medical Engineering Transport Building & Structural

    Monitoring (dynamic loads) Machinery Health Monitoring Mobile & other Electronic Devices
  11. scott janousek ...MAKES LIVES JUST A TINY BIT EASIER ...

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

    - Dual Shock Controller (6 axis accelerometer) ... KEEPS US ENTERTAINED
  13. 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
  14. scott janousek CORE SMARTPHONE FEATURES Camera WiFi & 3G GPS

    TouchScreen (ideally Multi-touch) Accelerometer
  15. 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)
  16. scott janousek WAYS TO TAP ... First Party Solution Nokia

    S60 PLATFORM SERVICES 3rd Party Solutions (Flash only Solution) (Native, Flash, other platform access)
  17. 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\
  18. 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 );
  19. 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 }
  20. 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; " } }
  21. 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
  22. 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
  23. 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 );
  24. 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
  25. 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
  26. 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?"); } } }
  27. 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”! :)
  28. scott janousek CHUMBY - ORIENTATIONS Source: Developing widgets for Chumby

    with Flash Lite 3 http://www.adobe.com/devnet/devices/articles/chumby_development.html
  29. 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
  30. 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/
  31. 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
  32. 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
  33. 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)
  34. 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
  35. 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
  36. 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.
  37. scott janousek THE “NEXT” THINGS ... Magnetometer = Electronic Compasses

    Precise Location = Magnetometer + Accelerometer + GPS + (Camera) Next Generation = Augmented Reality + Precise Location