Chapter 7b - Sensors
Chapter 7b - Sensors
SKR4307
SEMESTER I 2022/23
1. Introduction
Not typically used to monitor device position, but they can be used with
other sensors, such as the geomagnetic field sensor – to determine a
device's position relative to the world's frame of reference (coordinate
system).
Measure acceleration and rotational forces along three axes.
• Accelerometer – measuring shake, tilt, etc.,
• Proximity sensor – measuring proximity of an object relative to the
screen of the device, gyroscope for measuring spin, turn, etc.,
• Gravity sensor – measuring force of gravity and rotational vector for
measuring device orientation.
All motion sensors return multi-
dimensional arrays of sensor values for
… cont. each SensorEvent.
E.g., during a single sensor event the
accelerometer returns acceleration force
data for the three coordinate axes, and
the gyroscope returns rate of rotation
data for the three coordinate axes.
2.2 Environmental sensor
Position sensors – useful for determining a device's physical position in the world's
frame of reference.
• E.g., can use the geomagnetic field sensor in combination with the accelerometer
to determine a device's position relative to the magnetic north pole.
… cont.
iOS – add the following key-value pair into Info.plist file inside
the ios/Runner folder in the project.
… cont.
sensor_plus plugin
https://www.fluttercampus.com/guide/283/get-gyroscope-sensor-data
-flutter/
Smartphone movement speedometer
https://www.flutterclutter.dev/flut
ter/tutorials/smartphone-moveme
nt-speedometer/2020/1685/
https://pub.dev/packages/flutter_sensors/example
References
i. https://www.javatpoint.com/android-sensor-tutorial
ii. https://www.zoftino.com/android-sensors-examples