5. Sensors and Actuators
5.1. Mobile Phone Based Sensors
First of all, let us look at the mobile phone, which is ubiquitous and has many types of sensors embedded in it. In specific, the smartphone is a very handy and user friendly device that has a host of built in communication and data processing features. With the increasing popularity of smartphones among people, researchers are showing interest in building smart IoT solutions using smartphones because of the embedded sensors. Some additional sensors can also be used depending upon the requirements. Applications can be built on the smartphone that uses sensor data to produce meaningful results. Some of the sensors inside a modern smartphone are as follows.
- The accelerometer senses the motion and acceleration of a mobile phone. It typically measures changes in 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.
- 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 contextual information. For example, we can infer a user's current environment and the interactions that she is having. 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 and other applications in which some action is to be taken depending on the intensity of ambient light. For example, we can control the lights in a room.
- 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, respectively.
We have studied many smart applications that use sensor data collected from smartphones. For example, activity detection is achieved by applying machine learning algorithms to the data collected by smartphone sensors. It detects activities such as running, going up and down stairs, walking, driving, and cycling. The application is trained with patterns of data using data sets recorded by sensors when these activities are being performed.
Many health and fitness applications are being built to keep track of a person's health continuously using smartphones. They keep track of users' physical activities, diet, exercises, and lifestyle to determine the fitness level and give suggestions to the user accordingly. Wang et al. describe a mobile application that is based completely on a smartphone. They use it to assess the overall mental health and performance of a college student. To track the location and activities in which the student is involved, activity recognition (accelerometer) and GPS data are used. To keep a check on how much the student sleeps, the accelerometer and light sensors are used. For social life and conversations, audio data from a microphone is used. The application also conducts quick questionnaires with the students to know about their mood. All this data can be used to assess the stress levels, social life, behavior, and exercise patterns of a student.
Another application by McClernon and Choudhury detects when the user is going to smoke using context information such as the presence of other smokers, location, and associated activities. The sensors provide information related to the user's movement, location, visual images, and surrounding sounds. To summarize smartphone sensors are being used to study different kinds of human behavior and to improve the quality of human life.