Android Android Sensors Android Sensors: – Accelerometer – Gravity sensor – Linear Acceleration sensor – Magnetic Field sensor – Orientation.

Slides:



Advertisements
Similar presentations
Slide Ruler. ? X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.
Advertisements

Mobile Handset Sensors. Outline Overview GPS Other Sensors 2.
Use it Free: Instantly Knowing Your Phone Attitude Pengfei Zhou*, Mo Li Nanyang Technological University Guobin (Jacky) Shen Microsoft Research.
Use it Free: Instantly Knowing Your Phone Attitude Pengfei Zhou*, Mo Li Nanyang Technological University Guobin (Jacky) Shen Microsoft Research.
Sensors.  Hardware devices that take measurements of the physical environment  Some examples  3-axis Accelerometer  3-axis Magnetic field sensor 
Cosc 5/4730 Input Keyboard, touch, and Accelerometer.
Introduction to Smartphone Sensors
Android sensors.
The Accelerometer and Gyroscope
CS378 - Mobile Computing Sensing and Sensors. Sensors "I should have paid more attention in Physics 41" Most devices have built in sensors to measure.
CS378 - Mobile Computing Sensing and Sensors. Sensors "I should have paid more attention in Physics 41" Most devices have built in sensors to measure.
Phone guide for people over 65. Not Smart Phones.
Android Sensors & Async Callbacks Jules White Bradley Dept. of Electrical and Computer Engineering Virginia Tech
Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez.
Getting Started with Android APIs Ivan Wong. Motivation - “Datasheet” - Recently exposed to what’s available in Android - So let’s see what API’s are.
Mobile Application Development Selected Topics – CPIT 490
Lecture # 9 Hardware Sensor. Topics 2  SensorManger & Sensor  SensorEvent & SensorEventListener  Example Application.
Mobile Programming Lecture 9 Bound Service, Location, Sensors, IntentFilter.
1 Localization and Sensing Nilanjan Banerjee Mobile Systems Programming (Acknowledgement: Jules White) University of Arkansas Fayetteville, AR
Sensing. Possible sensors on devices – Documented in SensorEvent class Accelerometer (m/s 2 ) – acceleration in x, y, z axes Magnetic Field (micro Tesla)
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
Doodlz App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Sérgio Ronaldo Barros dos Santos (ITA-Brazil)
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
Sensors – Part I SE 395/595.
로봇을 조종하자 3/4 UNIT 17 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 스마트 폰의 센서를 사용할 수 있다. 2.
Karman filter and attitude estimation Lin Zhong ELEC424, Fall 2010.
CS378 - Mobile Computing Sensing and Sensors Part 2.
Mobile Device Development Camera and Sensors Dr.YingLiang Ma.
Sensors in android. App being more applicable Keeping track of your heart beat while jogging. Pointing the phone camera towards the night sky to know.
Current Works Corrected unit conversions in code Found an error in calculating offset (to zero sensors) – Fixed error, but still not accurately integrating.
Sensors Nasrullah Khan Niazi. Using Device Sensors The Android SDK provides access to raw data from sensors on the device.The sensors,and their precision.
Sensors For Mobile Phones  Ambient Light Sensor  Proximity Sensor  GPS Receiver Sensor  Gyroscope Sensor  Barometer Sensor  Accelerometer Sensor.
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors Date: Feb 11, 2016.
MOBILE SENSORS BY OLIVIA TUFFS-MOULDS. ACCELEROMETER An accelerometer is a device, hidden in the motherboard of a smartphone, is a sensor which detects.
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
CPE 490/590 – Smartphone Development
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
CHAPTER 8 Sensors and Camera. Chapter objectives: Understand Motion Sensors, Environmental Sensors and Positional Sensors Learn how to acquire measurement.
CS371m - Mobile Computing Sensing and Sensors.
The Doodlz app enables you to paint by dragging one or more fingers across the screen. The app provides options for setting the drawing color.
Smartphone sensors Gyroscope: The gyroscope is a sensor that can provide orientation information with great precision. Magnetometer: It is able to detect.
Mobile phone sensors. Sensors Sensors gyroscope The gyroscope is a sensor that can provide orientation information as well. This sensor can tell how.
Sensors in Android.
Vijay Kumar Kolagani Dr. Yingcai Xiao
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
Goal : Develop a software that converts arm movements into messages
Vijay Kumar Kolagani Dr. Yingcai Xiao
CS499 – Mobile Application Development
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
Mobile Handset Sensors
CS371m - Mobile Computing Sensing and Sensors.
CIS 470 Mobile App Development
Vijay Kumar Kolagani Dr. Yingcai Xiao
CIS 470 Mobile App Development
Inertial Measurement Unit (IMU) Basics
Last Time: Vectors Introduction to Two-Dimensional Motion Today:
Android Topics Sensors Accelerometer and the Coordinate System
Android Programming Tutorial
Paige Thielen, ME535 Spring 2018
CIS 493/EEC 492 Android Sensor Programming
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
CIS 493/EEC 492 Android Sensor Programming
CIS 493/EEC 492 Android Sensor Programming
Mobile Programming Sensors in Android.
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

Android

Android Sensors

Android Sensors: – Accelerometer – Gravity sensor – Linear Acceleration sensor – Magnetic Field sensor – Orientation sensor – Gyroscope – Light sensor – Proximity sensor – Temprature sensor – Pressure sensor – Other sensor Android Sensors Overview

Accelerometer Provides the total force applied on the device. When device is stationary, this gives +1g (gravitational force) reading in one axis and its components on other axes. Accelerometer values minus the gravity factor gives the induced acceleration. Generally it is used to determine device orientation. The measurment unit is SI m/s 2.

Accelerometer Coordinate System

Accelerometer and Gravity All forces acting on the device will be detected by the accelerometers. F= ma If device is stationary we get the gravity value with zero acceleration, which can be saperated by low pass filter. Can We calculate distance/speed ? – D= ut + 1/2 at2 How to seperate Gravity and linear accelereation ? Used in gaming to make it interactive. Pattern recognition. pedometer

Gravity Sensor and Linear Acceleration Gravity sensor is not a saparate hardware but t’s a virtual sensor based on the accelerometers, acceleration is removed from accelerometer data. Similarly Linear acceleration is not a saparate hardware but it is based on the accelerometer, gravity is removed from accelerometer data.

Magnetic field Sensor The magnetic field sensor measures the ambient magnetic field in the x, y, and z axes. The units of the magnetic field sensor are microteslas (uT). This sensor can detect the Earth’s magnetic field and therefore tell us where north is. This sensor is also referred to as the compass Magnetic field sensor is used in combination with accelerometer. The coordinate system

Orientation sensor Measures degrees of rotation that a device makes around all three physical axes (x, y, z). As of API level 3 you can obtain the inclination matrix and rotation matrix for a device by using the gravity sensor and the geomagnetic field sensor in conjunction with the getRotationMatrix() method. There is no hardware for orientation sensor but combination of two sensor detrmine the orientation of device. Form API level 8 is is been deprecated.

Gyroscope sensor Gyroscopes measure the rate of rotation around an axis. When the device is not rotating, the sensor values will be zeroes. It gives us 3 value. – Pitch (around X – Roll (around y) – Azimuth (around z)

Gyroscope Continue... Unfortunately gyroscope is error prone over time. As time goes gyroscope introduce drift in result, but by sensor fusion(combine accelerometer and gyroscope) results can be corrected and path of movment of device can be obtain correctly. The measurment unit is SI m/s 2.

Call backs PerSecond Observe the readings Highly Accurate initially Gyro drift Used to build responsive games. "Angel of rotation using Gyroscope(GyroRaw.java)”

Light Sensor Located at front of mobile near to front facing camera. gives a reading of the light level detected by the light sensor of the device. As the light level changes, the sensor readings change. The units of the data are in SI lux units Range is from 0 to maximum value for sensor.

Proximity Sensor The proximity sensor either measures the distance that some object is from the device (in centimeters) or represents a flag to say whether an object is close or far. Some proximity sensors will give a value ranging from 0.0 to the maximum in increments, while others return either 0.0 or he maximum value only. Interesting fact about proximity sensors : the proximity sensor is sometimes the same hardware as the light sensor. Android still treats them as logically separate sensors.

Temprature Sensor The old temperature sensor provided a temperature reading and also returned just a single value in values[0]. This sensor usually read an internal temperature, such as at the battery. Till API level 13 From API level 14 it is replaced by TYPE_AMBIENT_TEMPERATURE. The new sensor tell us about the room temprature in degree Celsius.

Pressure sensor This sensor measures barometric pressure, which could detect altitude can be used for weather predictions. The unit of measurement for a pressure sensor is atmospheric pressure in hPa (millibar).

Other Sensor Rotation Vector The rotation vector represents the orientation of the device as a combination of an angle and an axis, in which the device has rotated through an angle θ around an axis (x, y, or z). Humidity sensor Measures the relative ambient humidity in percent (%).

Sensor fusion Sensor fusion is a technique to filter the data and obtain the result by combining two or more sensor's data. Well known algorithem for sensor fusion  Kalman filter alogrithem  Complimentary filter algorithem

Measures Device's Angle by Accelerometer Generally Accelerometer use for measure device rotation around axis(x, y, or z). By Combining of Accelerometer orientation sensor and magnetic field sensor correct device orientation can be obtain. Android sensor framwork provide methods like getRotationMatrix() and getOrientationMatrix() which tell us the device rotation reltive to ground on all axis. Earth Coordinate System

Sensor Framework Android has provided sensor Framework managed by following classes  Sensor  SensorManager  SensorEvent  SensorEventListener Framework has provided call back to obtain sensor data.

SensorFramework continue... SensorEventListener async call back Call back retrive data at different duration  Normal 20mS  Game 20mS  Fast 0mS Accuracy of rerieved data can be Low,Medium or High SensorManager Your App Sensor Event Register Callback

public class SensorActivity extends Activity implements SensorEventListener { private SensorManager mSensorManager; private Sensor public final void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); MSensorManager =(SensorManager) getSystemService(Context.SENSOR_SERVICE); mLight = mSensorManager.getDefaultSensor(Sensor.TYPE_LIGHT); } Sensor example

SensorEventListener call public final void onAccuracyChanged(Sensor sensor, int accuracy) { // Do something here if sensor accuracy changes. public final void onSensorChanged(SensorEvent event) { // The light sensor returns a single value. // Many sensors return 3 values, one for each axis. float lux = event.values[0]; }

@Override protected void onResume() { super.onResume(); mSensorManager.registerListener(this, mLight, SensorManager.SENSOR_DELAY_NORMAL); protected void onPause() { super.onPause(); mSensorManager.unregisterListener(this); } Good Habits for sensors