The accelerometer senses the motion and acceleration of a mobile phone. It typically measures changes in the velocity of the smartphone in three dimensions. There are many types of accelerometers. In a mechanical accelerometer, we have a seismic mass in a housing, which is tied to the housing with a spring. The mass takes time to move and is left behind as the housing moves, so the force in the spring can be correlated with the acceleration. In a capacitive accelerometer, capacitive plates are used with the same setup. With a change in velocity, the mass pushes the capacitive plates together, thus changing the capacitance. The rate of change of capacitance is then converted into acceleration. In a piezoelectric accelerometer, piezoelectric crystals are used, which when squeezed generate an electric voltage. The changes in voltage can be translated into acceleration. The data patterns captured by the accelerometer can be used to detect physical activities of the user such as running, walking, and bicycling.
The gyroscope detects the orientation of the phone very precisely. Orientation is measured using capacitive changes when a seismic mass moves in a particular direction.
Camera and Microphone
The camera and microphone are very powerful sensors since they capture visual and audio information, which can then be analyzed and processed to detect various types of information. To make sense of the audio data, technologies such as voice recognition and acoustic features can be exploited
The magnetometer detects magnetic fields. This can be used as a digital compass and in applications to detect the presence of metals.
The GPS (Global Positioning System) detects the location of the phone, which is one of the most important pieces of contextual information for smart applications. The location is detected using the principle of trilateration. The distance is measured from three or more satellites (or mobile phone towers in the case of A-GPS) and coordinates are computed.
The light sensor detects the intensity of ambient light. It can be used for setting the brightness of the screen automatically depending upon the intensity of ambient light.
The proximity sensor uses an infrared (IR) LED, which emits IR rays. These rays bounce back when they strike some object. Based on the difference in time, we can calculate the distance. In this way, the distance to different objects from the phone can be measured. For example, we can use it to determine when the phone is close to the face while talking. It can also be used in applications in which we have to trigger some event when an object approaches the phone.
Some smartphones such as Samsung’s Galaxy S4 also have a thermometer, barometer, and humidity sensor to measure the temperature, atmospheric pressure, and humidity.