CPE 490/590 – Smartphone Development

Slides:



Advertisements
Similar presentations
Mobile Handset Sensors. Outline Overview GPS Other Sensors 2.
Advertisements

Sensors.  Hardware devices that take measurements of the physical environment  Some examples  3-axis Accelerometer  3-axis Magnetic field sensor 
Real-Time Sensing on Android Reliable Mobile Systems Group Fiji Systems Inc. Yin Yan, Shaun Cosgrove, Ethan Blanton, Steven Y. Ko, Lukasz Ziarek
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. Sensor Thermometer thermometer for measuring ambient temperature. However, there's a thermometer in pretty much any smartphone, and some.
Phone guide for people over 65. Not Smart Phones.
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.
Android Sensors & Async Callbacks Jules White Bradley Dept. of Electrical and Computer Engineering Virginia Tech
Win8 on Intel Programming Course Modern UI : Sensors Cédric Andreolli Intel Software.
Mobile Application Development Selected Topics – CPIT 490
Lecture # 9 Hardware Sensor. Topics 2  SensorManger & Sensor  SensorEvent & SensorEventListener  Example Application.
EMS Survey instruments The How, What and When Presented by James Tweedie, GeoMEM Ltd.
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.
A sensor for measuring the acceleration of a moving or vibrating body.
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
Sensors – Part I SE 395/595.
CS378 - Mobile Computing Sensing and Sensors Part 2.
INEMO™ Demonstration Kit DOF (Degrees of Freedom) platform  The STEVAL-MKI062V2 combines accelerometers, gyroscopes and magnetometers with pressure.
Mobile Device Development Camera and Sensors Dr.YingLiang Ma.
Ambient Light Sensor The ambient light sensor is something that can detect the brightness of the phone screen. This is helpful for if your eyes are hurting.
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.
The ambient light sensor in a smart phone is what measures how bright the light is. It’s the phones software that adjusts the brightness in the display.
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.
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.
1.Accelerometer:Accelerometer in an iPhone. Definition: An accelerometer is a sensor which measures the tilting motion and orientation of a mobile phone.
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.
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.
Make an information leaflet about what the sensors do in a Smart Phone for people over 65 years of age. You can use PowerPoint, Word or Publisher.
The sensors guide fingerprint sensors rate monitor gyroscope camera
Accelerometer based motion gestures for mobile devices Presented by – Neel Parikh Advisor Committee members Dr. Chris Pollett Dr. Robert Chun Dr. Mark.
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.
Chapter 8 Sensors and Camera. Figure 08.01: The Accelerometer can gauge the orientation of a stationary device.
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.
Android Android Sensors Android Sensors: – Accelerometer – Gravity sensor – Linear Acceleration sensor – Magnetic Field sensor – Orientation.
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.
Dead Reckoning, a location tracking app for Android™ smartphones Nisarg Patel Mentored by Adam Schofield and Michael Caporellie Introduction Results (cont.)
Vijay Kumar Kolagani Dr. Yingcai Xiao
CIS 470 Mobile App Development
Inertial Measurement Units
Android Topics Sensors Accelerometer and the Coordinate System
Android Programming Tutorial
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
Android Intents & Sensors
Mobile Programming Sensors in Android.
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

CPE 490/590 – Smartphone Development Sensors CPE 490/590 – Smartphone Development by: Michael T. Shrove

iOS

CMMotionManager A CMMotionManager object is the gateway to the motion services provided by iOS. These services provide an app with accelerometer data, rotation-rate data, magnetometer data, and other device-motion data such as attitude. These types of data originate with a device’s accelerometers and (on some models) its magnetometer and gyroscope.

Types of motion sensors Accelerometer Gyroscope Magnetometer Device Motion (Combines all three)

Example of Accelerometer

Example of Gyroscope

Example of pedometer

Example of Altitude

https://github.com/vandadnp/iOS-8-Swift-Programming-Cookbook

Android

Overview Android Sensors Overview Types of Sensors Motion Sensors Environmental Sensors Position Sensors Introduction to Sensor Framework

sensors overview Most Android-powered devices have built-in sensors that measure motion, orientation, and various environmental conditions. These sensors are capable of providing raw data with high precision and accuracy, and are useful if you want to monitor three-dimensional device movement or positioning, or you want to monitor changes in the ambient environment near a device.

sensor examples For example, a game might track readings from a device's gravity sensor to infer complex user gestures and motions, such as tilt, shake, rotation, or swing. Likewise, a weather application might use a device's temperature sensor and humidity sensor to calculate and report the dewpoint, or a travel application might use the geomagnetic field sensor and accelerometer to report a compass bearing.

types of sensors Motion Sensors Environmental Sensors Position Sensors

Motion Sensors These sensors measure acceleration forces and rotational forces along three axes. This category includes accelerometers, gravity sensors, gyroscopes, and rotational vector sensors.

Environment sensors These sensors measure various environmental parameters, such as ambient air temperature and pressure, illumination, and humidity. This category includes barometers, photometers, and thermometers.

Position sensors These sensors measure the physical position of a device. This category includes orientation sensors and magnetometers.

sensors You can access sensors available on the device and acquire raw sensor data by using the Android sensor framework. For example, you can use the sensor framework to do the following: Determine which sensors are available on a device. Determine an individual sensor's capabilities, such as its maximum range, manufacturer, power requirements, and resolution. Acquire raw sensor data and define the minimum rate at which you acquire sensor data. Register and unregister sensor event listeners that monitor sensor changes.

Introduction to sensor framework The Android sensor framework lets you access many types of sensors. Some of these sensors are hardware-based and some are software-based. Hardware-based sensors are physical components built into a handset or tablet device. They derive their data by directly measuring specific environmental properties, such as acceleration, geomagnetic field strength, or angular change. Software-based sensors are not physical devices, although they mimic hardware-based sensors. Software-based sensors derive their data from one or more of the hardware-based sensors and are sometimes called virtual sensors or synthetic sensors. The linear acceleration sensor and the gravity sensor are examples of software-based sensors.

Sensor Manager You can use this class to create an instance of the sensor service. This class provides various methods for accessing and listing sensors, registering and unregistering sensor event listeners, and acquiring orientation information. This class also provides several sensor constants that are used to report sensor accuracy, set data acquisition rates, and calibrate sensors.

Sensor You can use this class to create an instance of a specific sensor. This class provides various methods that let you determine a sensor's capabilities.

Sensor event The system uses this class to create a sensor event object, which provides information about a sensor event. A sensor event object includes the following information: the raw sensor data the type of sensor that generated the event the accuracy of the data the timestamp for the event.

Sensor eventListener You can use this interface to create two callback methods that receive notifications (sensor events)z; sensor values change sensor accuracy changes.

Devices Few Android-powered devices have every type of sensor. For example, most handset devices and tablets have an accelerometer and a magnetometer, but fewer devices have barometers or thermometers. Also, a device can have more than one sensor of a given type. For example, a device can have two gravity sensors, each one having a different range.

motion sensors The Android platform provides several sensors that let you monitor the motion of a device. Two of these sensors are always hardware-based (the accelerometer and gyroscope), and three of these sensors can be either hardware-based or software- based (the gravity, linear acceleration, and rotation vector sensors).

motion sensors Accelerometer Gravity Gyroscope Linear acceleration Rotation Vector http://developer.android.com/ guide/topics/sensors/sensors _motion.html

Using the accelerometer An acceleration sensor measures the acceleration applied to the device, including the force of gravity. The following code shows you how to get an instance of the default acceleration sensor: private SensorManager mSensorManager; private Sensor mSensor;   ... mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);

Accelerometer++ Conceptually, an acceleration sensor determines the acceleration that is applied to a device (Ad) by measuring the forces that are applied to the sensor itself (Fs) using the following relationship: Ad = - ∑Fs / mass However, the force of gravity is always influencing the measured acceleration according to the following relationship: Ad = -g - ∑F / mass

Accelerometer += 1 For this reason, when the device is sitting on a table (and not accelerating), the accelerometer reads a magnitude of g = 9.81 m/s2. Similarly, when the device is in free fall and therefore rapidly accelerating toward the ground at 9.81 m/s2, its accelerometer reads a magnitude of g = 0 m/s2. Therefore, to measure the real acceleration of the device, the contribution of the force of gravity must be removed from the accelerometer data. This can be achieved by applying a high-pass filter. Conversely, a low-pass filter can be used to isolate the force of gravity.

low pass filter applied public void onSensorChanged(SensorEvent event){   // In this example, alpha is calculated as t / (t + dT),   // where t is the low-pass filter's time-constant and   // dT is the event delivery rate.   final float alpha = 0.8;   // Isolate the force of gravity with the low-pass filter.   gravity[0] = alpha * gravity[0] + (1 - alpha) * event.values[0];   gravity[1] = alpha * gravity[1] + (1 - alpha) * event.values[1];   gravity[2] = alpha * gravity[2] + (1 - alpha) * event.values[2];   // Remove the gravity contribution with the high-pass filter.   linear_acceleration[0] = event.values[0] - gravity[0];   linear_acceleration[1] = event.values[1] - gravity[1];   linear_acceleration[2] = event.values[2] - gravity[2]; }

environmental sensors The Android platform provides four sensors that let you monitor various environmental properties. You can use these sensors to monitor relative ambient humidity, illuminance, ambient pressure, and ambient temperature near an Android-powered device. All four environment sensors are hardware-based and are available only if a device manufacturer has built them into a device. With the exception of the light sensor, which most device manufacturers use to control screen brightness, environment sensors are not always available on devices. Because of this, it's particularly important that you verify at runtime whether an environment sensor exists before you attempt to acquire data from it

environmental sensors Ambient Temperature Light Pressure Relative Humidity Temperature http://developer.android.com/ guide/topics/sensors/sensors _environment.html

How does environmental sensors differ? Unlike most motion sensors and position sensors, which return a multi-dimensional array of sensor values for each SensorEvent, environment sensors return a single sensor value for each data event. For example, the temperature in °C or the pressure in hPa. Also, unlike motion sensors and position sensors, which often require high-pass or low-pass filtering, environment sensors do not typically require any data filtering or data processing.

Position sensors The Android platform provides two sensors that let you determine the position of a device: the geomagnetic field sensor and the orientation sensor. The Android platform also provides a sensor that lets you determine how close the face of a device is to an object (known as the proximity sensor). The geomagnetic field sensor and the proximity sensor are hardware- based. Most handset and tablet manufacturers include a geomagnetic field sensor. Likewise, handset manufacturers usually include a proximity sensor to determine when a handset is being held close to a user's face (for example, during a phone call). The orientation sensor is software-based and derives its data from the accelerometer and the geomagnetic field sensor.

Position sensors Magnetic Field Orientation Proximity http://developer.android. com/guide/topics/sensor s/sensors_position.html

Position sensors++ Position sensors are useful for determining a device's physical position in the world's frame of reference. For example, you can use the geomagnetic field sensor in combination with the accelerometer to determine a device's position relative to the magnetic North Pole. You can also use the orientation sensor (or similar sensor-based orientation methods) to determine a device's position in your application's frame of reference. Position sensors are not typically used to monitor device movement or motion, such as shake, tilt, or thrust

Examples

Get sensormanager

Get a list of all sensors

Get default sensor for the type

Monitoring sensor events To monitor raw sensor data you need to implement two callback methods that are exposed through the SensorEventListener interface: onAccuracyChanged() onSensorChanged()

Monitor sensor events A sensor's accuracy changes In this case the system invokes the onAccuracyChanged() method, providing you with a reference to the Sensor object that changed and the new accuracy of the sensor. A sensor reports a new value In this case the system invokes the onSensorChanged() method, providing you with a SensorEvent object. A SensorEvent object contains information about the new sensor data, including: the accuracy of the data, the sensor that generated the data, the timestamp at which the data was generated, and the new data that the sensor recorded.

Example

Questions????