Summarize this 
Bluetooth Low Energy (BLE)
Bluetooth Low Energy, also known as “Bluetooth Smart,” was developed by the Bluetooth Special Interest Group. It has a relatively shorter range and consumes lower energy as compared to competing protocols. The BLE protocol stack is similar to the stack used in classic Bluetooth technology. It has two parts: controller and host. The physical and link layer are implemented in the controller. The controller is typically a SOC (System on Chip) with a radio. The functionalities of upper layers are included in the host [62]. BLE is not compatible with classic Bluetooth. Let us look at the differences between classic Bluetooth and BLE [63, 64].

The main difference is that BLE does not support data streaming. Instead, it supports quick transfer of small packets of data (packet size is small) with a data rate of 1 Mbps.

There are two types of devices in BLE: master and slave. The master acts as a central device that can connect to various slaves. Let us consider an IoT scenario where a phone or PC serve as the master and mobile devices such as a thermostat, fitness tracker, smart watch, or any monitoring device act as slaves. In such cases, slaves must be very power efficient. Therefore, to save energy, slaves are by default in sleep mode and wake up periodically to receive packets from the master.

In classic Bluetooth, the connection is on all the time even if no data transfer is going on. Additionally, it supports 79 data channels (1 MHz channel bandwidth) and a data rate of 1 million symbols/s, whereas, BLE supports 40 channels with 2 MHz channel bandwidth (double of classic Bluetooth) and 1 million symbols/s data rate. BLE supports low duty cycle requirements as its packet size is small and the time taken to transmit the smallest packet is as small as 80 s. The BLE protocol stack supports IP based communication also. An experiment conducted by Siekkinen et al. [65] recorded the number of bytes transferred per Joule to show that BLE consumes far less energy as compared to competing protocols such as Zigbee. The energy efficiency of BLE is 2.5 times better than Zigbee.

7.5. Low Power WiFi
The WiFi alliance has recently developed “WiFi HaLow,” which is based on the IEEE 802.11ah standard. It consumes lower power than a traditional WiFi device and also has a longer range. This is why this protocol is suitable for Internet of Things applications. The range of WiFi HaLow is nearly twice that of traditional WiFi.

Like other WiFi devices, devices supporting WiFi HaLow also support IP connectivity, which is important for IoT applications. Let us look at the specifications of the IEEE 802.11ah standard [66, 67]. This standard was developed to deal with wireless sensor network scenarios, where devices are energy constrained and require relatively long range communication. IEEE 802.11ah operates in the sub-gigahertz band (900 MHz). Because of the relatively lower frequency, the range is longer since higher frequency waves suffer from higher attenuation. We can extend the range (currently 1 km) by lowering the frequency further; however, the data rate will also be lower and thus the tradeoff is not justified. IEEE 802.11ah is also designed to support large star shaped networks, where a lot of stations are connected to a single access point.

7.6. Zigbee
It is based on the IEEE 802.15.4 communication protocol standard and is used for personal area networks or PANs [68]. The IEEE 802.15.4 standard has low power MAC and physical layers and has already been explained in Section 7.3. Zigbee was developed by the Zigbee alliance, which works for reliable, low energy, and cheap communication solutions. The range of Zigbee device communication is very small (10–100 meters). The details of the network and application layers are also specified by the Zigbee standard. Unlike BLE, the network layer here provides for multihop routing.

There are three types of devices in a Zigbee network: FFD (Fully Functional Device), RFD (Reduced Functional Device), and one Zigbee coordinator. A FFD node can additionally act as a router. Zigbee supports star, tree, and mesh topologies. The routing scheme depends on the topology. Other features of Zigbee are discovery and maintenance of routes, support for nodes joining/leaving the network, short 16-bit addresses, and multihop routing.

The framework for communication and distributed application development is provided by the application layer. The application layer consists of Application Objects (APO), Application Sublayer (APS), and a Zigbee Device Object (ZDO). APOs are spread over the network nodes. These are pieces of software, which control some underlying device hardware (examples: switch and transducer). The device and network management services are provided by the ZDO, which are then used by the APOs. Data transfer services are provided by the Application Sublayer to the APOs and ZDO. It is responsible for secure communication between the Application Objects. These features can be used to create a large distributed application.

7.7. Integration of RFID and WSN
RFID and wireless sensor networks (WSN) are both important technologies in the IoT domain. RFID can only be used for object identification, but WSNs serve a far greater purpose. The two are very different but merging them has many advantages. The following components can be added to RFID to enhance its usability:
(a)	Sensing capabilities
(b)	Multihop communication
(c)	Intelligence

RFID is inexpensive and uses very little power. That is why its integration with WSN is very useful. The integration is possible in the following ways [69, 70]:
(a)	Integration of RFID tags with sensors: RFID tags with sensing capabilities are called sensor tags. These sensor tags sense data from the environment and then the RFID reader can read this sensed data from the tag. In such cases, simple RFID protocols are used, where there is only single hop communication. RFID sensing technologies can be further classified on the basis of the power requirement of sensor tags as explained earlier in the section on RFIDs (active and passive) (see Section 5.5).
(b)	Integration of RFID tags with WSN nodes: the communication capabilities of sensor tags are limited to a single hop. To extend its capabilities, the sensor tag is equipped with a wireless transceiver, little bit of Flash memory, and computational capabilities such that it can initiate communication with other nodes and wireless devices. The nodes can in this fashion be used to form a wireless mesh network. In such networks, sensor tags can communicate with each other over a large range (via intermediate hops). With additional processing capabilities at a node, we can reduce the net amount of data communicated and thus increase the power efficiency of the WSN.
(c)	Integration of RFID readers with WSN nodes: this type of integration is also done to increase the range of RFID tag readers. The readers are equipped with wireless transceivers and microcontrollers so that they can communicate with each other and therefore, the tag data can reach a reader, which is not in the range of that tag. It takes advantage of multihop communication of wireless sensor network devices. The data from all the RFID readers in the network ultimately reaches a central gateway or base station that processes the data or sends it to a remote server.

These kinds of integrated solutions have many applications in a diverse set of domains such as security, healthcare, and manufacturing.

7.8. Low Power Wide-Area-Networks (LPWAN)
Let us now discuss a protocol for long range communication in power constrained devices. The LPWAN class of protocols is low bit-rate communication technologies for such IoT scenarios.

Let us now discuss some of the most common technologies in this area.
 	Narrow band IoT: it is a technology made for a large number of devices that are energy constrained. It is thus necessary to reduce the bit rate. This protocol can be deployed with both the cellular phone GSM and LTE spectra. The downlink speeds vary between 40 kbps (LTE M2) and 10 Mbps (LTE category 1).
 	Sigfox: it is one more protocol that uses narrow band communication (10 MHz). It uses free sections of the radio spectrum (ISM band) to transmit its data. Instead of 4G networks, Sigfox focuses on using very long waves. Thus, the range can increase to a 1000 kms. Because of this the energy for transmission is significantly lower (0.1%) than contemporary cell phones.
 	Again the cost is bandwidth. It can only transmit 12 bytes per message, and a device is limited to 140 messages per day. This is reasonable for many kinds of applications: submarine applications, sending control (emergency) codes, geolocation, monitoring remote locations, and medical applications.
 	Weightless: it uses a differential binary phase shift keying based method to transmit narrow band signals. To avoid interference, the protocol hops across frequency bands (instead of using CSMA). It supports cryptographic encryption and mobility. Along with frequency hopping, two additional mechanisms are used to reduce collisions. The downlink service uses time division multiple access (TDMA) and the uplink service uses multiple subchannels that are first allocated to transmitting nodes by contacting a central server. Some applications include smart meters, vehicle tracking, health monitoring, and industrial machine monitoring.
 	Neul: this protocol operates in the sub-1 GHz band. It uses small chunks of the TV whitespace spectrum to create low cost and low power networks with very high scalability. It has a 10 km range and uses the Weightless protocol for communication.
 	LoRaWAN: this protocol is similar to Sigfox. It targets wide area network applications and is designed to be a low power protocol. Its data rates can vary from 0.3 kbps to 50 kbps, and it can be used within an urban or a suburban environment (2–5 kms range in a crowded urban area). It was designed to serve as a standard for long range IoT protocols. It thus has features to support multitenancy, enable multiple applications, and include several different network domains.

7.9. Lightweight Application Layer Protocols
Along with physical and MAC layer protocols, we also need application layer protocols for IoT networks. These lightweight protocols need to be able to carry application messages, while simultaneously reducing power as far as possible.

OMA Lightweight M2M (LWM2M) is one such protocol. It defines the communication protocol between a server and a device. The devices often have limited capabilities and are thus referred to as constrained devices. The main aims of the OMA protocol are as follows:
(1)	Remote device management.
(2)	Transferring service data/information between different nodes in the LWM2M network.

All the protocols in this class treat all the network resources as objects. Such resources can be created, deleted, and remotely configured. These devices have their unique limitations and can use different kinds of protocols for internally representing information. The LWM2M protocol abstracts all of this away and provides a convenient interface to send messages between a generic LWM2M server and a distributed set of LWM2M clients.

This protocol is often used along with CoAP (Constrained Application Protocol). It is an application layer protocol that allows constrained nodes such as sensor motes or small embedded devices to communicate across the Internet. CoAP seamlessly integrates with HTTP, yet it provides additional facilities such as support for multicast operations. It is ideally suited for small devices because of its low overhead and parsing complexity and reliance on UDP rather than TCP.

8. Middleware
Ubiquitous computing is the core of the Internet of Things, which means incorporating computing and connectivity in all the things around us. Interoperability of such heterogeneous devices needs well-defined standards. But standardization is difficult because of the varied requirements of different applications and devices. For such heterogeneous applications, the solution is to have a middleware platform, which will abstract the details of the things for applications. That is, it will hide the details of the smart things. It should act as a software bridge between the things and the applications. It needs to provide the required services to the application developers [20] so that they can focus more on the requirements of applications rather than on interacting with the baseline hardware. To summarize, the middleware abstracts the hardware and provides an Application Programming Interface (API) for communication, data management, computation, security, and privacy.

The challenges, which are addressed by any IoT middleware, are as follows: [20, 71, 72].
(1)	Interoperability and programming abstractions: for facilitating collaboration and information exchange between heterogeneous devices, different types of things can interact with each other easily with the help of middleware services. Interoperability is of three types: network, semantic, and syntactic. Network interoperability deals with heterogeneous interface protocols for communication between devices. It insulates the applications from the intricacies of different protocols. Syntactic interoperability ensures that applications are oblivious of different formats, structures, and encoding of data. Semantic interoperability deals with abstracting the meaning of data within a particular domain. It is loosely inspired by the semantic web.
(2)	Device discovery and management: this feature enables the devices to be aware of all other devices in the neighborhood and the services provided by them. In the Internet of Things, the infrastructure is mostly dynamic. The devices have to announce their presence and the services they provide. The solution needs to be scalable because the devices in an IoT network can increase. Most solutions in this domain are loosely inspired by semantic web technologies. The middleware provides APIs to list the IoT devices, their services, and capabilities. In addition, typically APIs are provided to discover devices based on their capabilities. Finally, any IoT middleware needs to perform load balancing, manage devices based on their levels of battery power, and report problems in devices to the users.
(3)	Scalability: a large number of devices are expected to communicate in an IoT setup. Moreover, IoT applications need to scale due to ever increasing requirements. This should be managed by the middleware by making required changes when the infrastructure scales.
(4)	Big data and analytics: IoT sensors typically collect a huge amount of data. It is necessary to analyze all of this data in great detail. As a result a lot of big data algorithms are used to analyze IoT data. Moreover, it is possible that due to the flimsy nature of the network some of the data collected might be incomplete. It is necessary to take this into account and extrapolate data by using sophisticated machine learning algorithms.
(5)	Security and privacy: IoT applications are mostly related to someone’s personal life or an industry. Security and privacy issues need to be addressed in all such environments. The middleware should have built in mechanisms to address such issues, along with user authentication, and the implementation of access control.
(6)	Cloud services: the cloud is an important part of an IoT deployment. Most of the sensor data is analyzed and stored in a centralized cloud. It is necessary for IoT middleware to seamlessly run on different types of clouds and to enable users to leverage the cloud to get better insights from the data collected by the sensors.
(7)	Context detection: the data collected from the sensors needs to be used to extract the context by applying various types of algorithms. The context can subsequently be used for providing sophisticated services to users.

There are many middleware solutions available for the Internet of Things, which address one or more of the aforementioned issues. All of them support interoperability and abstraction, which is the foremost requirement of middleware. Some examples are Oracle’s Fusion Middleware, OpenIoT [21], MiddleWhere [22], and Hydra [23]. Middlewares can be classified as follows on the basis of their design [72]:
(1)	Event based: here, all the components interact with each other through events. Each event has a type and some parameters. Events are generated by producers and received by the consumers. This can be viewed as a publish/subscribe architecture, where entities can subscribe for some event types and get notified for those events.
(2)	Service oriented: service oriented middlewares are based on Service Oriented Architectures (SOA), in which we have independent modules that provide services through accessible interfaces. A service oriented middleware views resources as service providers. It abstracts the underlying resources through a set of services that are used by applications. There is a service repository, where services are published by providers. The consumers can discover services from the repository and then bind with the provider to access the service. Service oriented middleware must have runtime support for advertising services by providers and support for discovering and using services by consumers.
 	HYDRA [23] is a service oriented middleware. It incorporates many software components, which are used in handling various tasks required for the development of intelligent applications. Hydra also provides semantic interoperability using semantic web technologies. It supports dynamic reconfiguration and self-management.
(3)	Database oriented: in this approach, the network of IoT devices is considered as a virtual relational database system. The database can then be queried by the applications using a query language. There are easy to use interfaces for extracting data from the database. This approach has issues with scaling because of its centralized model.
(4)	Semantic: semantic middleware focuses on the interoperation of different types of devices, which communicate using different formats of data. It incorporates devices with different data formats and ontologies and ties all of them together in a common framework. The framework is used for exchanging data between diverse types of devices. For a common semantic format, we need to have  adapters for communication between  devices because; for each device, we need adapters to map  standards to one abstract standard [73]. In such a semantic middleware [74], a semantic layer is introduced, in which there is a mapping from each resource to a software layer for that resource. The software layers then communicate with each other using a mutually intelligible language (based on the semantic web). This technique allows multiple physical resources to communicate even though they do not implement or understand the same protocols.
(5)	Application specific: this type of middleware is used specifically for an application domain for which it is developed because the whole architecture of this middleware software is fine-tuned on the basis of requirements of the application. The application and middleware are tightly coupled. These are not general purpose solutions.

8.1. Popular IoT Middleware
8.1.1. FiWare
FiWare is a very popular IoT middleware framework that is promoted by the EU. It has been designed keeping smart cities, logistics, and shop floor analytics in mind. FiWare contains a large body of code, reusable modules, and APIs that have been contributed by thousands of FiWare developers. Any application developer can take a subset of these components and build his/her IoT application.

A typical IoT application has many producers of data (sensors), a set of servers to process the data, and a set of actuators. FiWare refers to the information collected by sensors as context information. It defines generic REST APIs to capture the context from different scenarios. All the context information is sent to a dedicated service called a context broker. FiWare provides APIs to store the context and also query it. Moreover, any application can register itself as a context consumer, and it can request the context broker for information. It also supports the publish-subscribe paradigm. Subsequently, the context can be supplied to systems using context adapters whose main role is to transform the data (the context) based on the requirements of the destination nodes. Moreover, FiWare defines a set of SNMP APIs via which we can control the behavior of IoT devices and also configure them.

The target applications are provided APIs to analyze, query, and mine the information that is collected from the context broker. Additionally, with advanced visualization APIs, it is possible to create and deploy feature rich applications very quickly.

8.1.2. OpenIoT
OpenIoT is another popular open source initiative. It has 7 different components. At the lowest level, we have a physical plane. It collects data from IoT devices and also does some preprocessing of data. It has different APIs to interface with different types of physical nodes and get information from them.

The next plane is the virtualized plane, which has 3 components. We first have the scheduler, which manages the streams of data generated by devices. It primarily assigns them to resources and takes care of their QoS requirements. The data storage component manages the storage and archival of data streams. Finally, the service delivery component processes the streams. It has several roles. It combines data streams, preprocesses them, and tracks some statistics associated with these streams such as the number of unique requests or the size of each request.

The uppermost layer, that is, the application layer, also has 3 components: request definition, request presentation, and configuration. The request definition component helps us create requests to be sent to the IoT sensors and storage layers. It can be used to fetch and query data. The request presentation component creates mashups of data by issuing different queries to the storage layer, and finally the configuration component helps us configure the IoT devices.

9. Applications of IoT
There are a diverse set of areas in which intelligent applications have been developed. All of these applications are not yet readily available; however, preliminary research indicates the potential of IoT in improving the quality of life in our society. Some uses of IoT applications are in home automation, fitness tracking, health monitoring, environment protection, smart cities, and industrial settings.

9.1. Home Automation
Smart homes are becoming more popular today because of two reasons. First, the sensor and actuation technologies along with wireless sensor networks have significantly matured. Second, people today trust technology to address their concerns about their quality of life and security of their homes (see Figure 8).


Figure 8
 
Block diagram of a smart home system.
In smart homes, various sensors are deployed, which provide intelligent and automated services to the user. They help in automating daily tasks and help in maintaining a routine for individuals who tend to be forgetful. They help in energy conservation by turning off lights and electronic gadgets automatically. We typically use motion sensors for this purpose. Motion sensors can be additionally used for security also.

For example, the project, MavHome [75], provides an intelligent agent, which uses various prediction algorithms for doing automated tasks in response to user triggered events and adapts itself to the routines of the inhabitants. Prediction algorithms are used to predict the sequence of events [76] in a home. A sequence matching algorithm maintains sequences of events in a queue and also stores their frequency. Then a prediction is made using the match length and frequency. Other algorithms used by similar applications use compression based prediction and Markov models.

Energy conservation in smart homes [77] is typically achieved through sensors and context awareness. The sensors collect data from the environment (light, temperature, humidity, gas, and fire events). This data from heterogeneous sensors is fed to a context aggregator, which forwards the collected data to the context aware service engine. This engine selects services based on the context. For example, an application can automatically turn on the AC when the humidity rises. Or, when there is a gas leak, it can turn all the lights off.

Smart home applications are really beneficial for the elderly and differently abled. Their health is monitored and relatives are informed immediately in case of emergencies. Floors are equipped with pressure sensors, which track the movement of an individual across the smart home and also help in detecting if a person has fallen down. In smart homes, CCTV cameras can be used to record events of interest. These can then be used for feature extraction to find out what is going on.

In specific, fall detection applications in smart environments [78–80] are useful for detecting if elderly people have fallen down. Yu et al. [80] use computer vision based techniques for analyzing postures of the human body. Sixsmith et al. [79] used low cost infrared sensor array technology, which can provide information such as the location, size, and velocity of a target object. It detects dynamics of a fall by analyzing the motion patterns and also detects inactivity and compares it with activity in the past. Neural networks are employed and sample data is provided to the system for various types of falls. Many smartphone based applications are also available, which detect a fall on the basis of readings from the accelerometer and gyroscope data.

There are many challenges and issues with regard to smart home applications [81]. The most important is security and privacy [82] since all the data about the events taking place in the home is being recorded. If the security and trustworthiness of the system are not guaranteed, an intruder may attack the system and may make the system behave maliciously. Smart home systems are supposed to notify the owners in case they detect such abnormalities. This is possible using AI and machine learning algorithms, and researchers have already started working in this direction [83]. Reliability is also an issue since there is no system administrator to monitor the system.

9.2. Smart Cities
9.2.1. Smart Transport
Smart transport applications can manage daily traffic in cities using sensors and intelligent information processing systems. The main aim of intelligent transport systems is to minimize traffic congestion, ensure easy and hassle-free parking, and avoid accidents by properly routing traffic and spotting drunk drivers. The sensor technologies governing these types of applications are GPS sensors for location, accelerometers for speed, gyroscopes for direction, RFIDs for vehicle identification, infrared sensors for counting passengers and vehicles, and cameras for recording vehicle movement and traffic. There are many types of applications in this area (refer to [84]):
(1)	Traffic surveillance and management applications: vehicles are connected by a network to each other, the cloud, and to a host of IoT devices such as GPS sensors, RFID devices, and cameras. These devices can estimate traffic conditions in different parts of the city. Custom applications can analyze traffic patterns so that future traffic conditions can be estimated. Yu et al. [85] implement a vehicle tracking system for traffic surveillance using video sequences captured on the roads.
 	Traffic congestion detection can also be implemented using smartphone sensors such as accelerometers [86] and GPS sensors. These applications can detect movement patterns of the vehicle while the user is driving. Such kind of information is already being collected by Google maps and users are using it to route around potentially congested areas of the city.
(2)	Applications to ensure safety: smart transport does not only imply managing traffic conditions. It also includes safety of people travelling in their vehicles, which up till now was mainly in the hands of drivers. There are many IoT applications developed to help drivers become safer drivers. Such applications monitor driving behavior of drivers and help them drive safely by detecting when they are feeling drowsy or tired and helping them to cope with it or suggesting rest [87, 88]. Technologies used in such applications are face detection, eye movement detection, and pressure detection on the steering (to measure the grip of the driver’s hands on the steering).
 	A smartphone application, which estimates the driver’s driving behavior using smartphone sensors such as the accelerometer, gyroscope, GPS, and camera, has been proposed by Eren et al. [89]. It can decide whether the driving is safe or rash by analyzing the sensor data.
(3)	Intelligent parking management (see Figure 9): in a smart transportation system, parking is completely hassle free as one can easily check on the Internet to find out which parking lot has free spaces. Such lots use sensors to detect if the slots are free or occupied by vehicles. This data is then uploaded to a central server.
(4)	Smart traffic lights: traffic lights equipped with sensing, processing, and communication capabilities are called smart traffic lights. These lights sense the traffic congestion at the intersection and the amount of traffic going each way. This information can be analyzed and then sent to neighboring traffic lights or a central controller. It is possible to use this information creatively. For example, in an emergency situation the traffic lights can preferentially give way to an ambulance. When the smart traffic light senses an ambulance coming, it clears the path for it and also informs neighboring lights about it. Technologies used in these lights are cameras, communication technologies, and data analysis modules. Such systems have already been deployed in Rio De Janeiro.
(5)	Accident detection applications: a smartphone application designed by White et al. [90] detects the occurrence of an accident with the help of an accelerometer and acoustic data. It immediately sends this information along with the location to the nearest hospital. Some additional situational information such as on-site photographs is also sent so that the first responders know about the whole scenario and the degree of medical help that is required.


Figure 9
 
Block diagram of a smart parking system.
9.2.2. Smart Water Systems
Given the prevailing amount of water scarcity in most parts of the world, it is very important to manage our water resources efficiently. As a result most cities are opting for smart solutions that place a lot of meters on water supply lines and storm drains. A good reference in this area is the paper by Hauber-Davidson and Idris [91]. They describe various designs for smart water meters. These meters can be used to measure the degree of water inflow and outflow and to identify possible leaks. Smart water metering systems are also used in conjunction with data from weather satellites and river water sensors. They can also help us predict flooding.

9.2.3. Examples of Smart Cities
Barcelona and Stockholm stand out in the list of smart cities. Barcelona has a CityOS project, where it aims to create a single virtualized OS for all the smart devices and services offered within the city. Barcelona has mainly focused on smart transportation (as discussed in Section 9.2.1) and smart water. Smart transportation is implemented using a network of sensors, centralized analysis, and smart traffic lights. On similar lines Barcelona has sensors on most of its storm drains, water storage tanks, and water supply lines. This information is integrated with weather and usage information. The result of all of this is a centralized water planning strategy. The city is able to estimate the water requirements in terms of domestic usage and industrial usage and for activities such as landscaping and gardening.

Stockholm started way back in 1994, and its first step in this direction was to install an extensive fiber optic system. Subsequently, the city added thousands of sensors for smart traffic and smart water management applications. Stockholm was one of the first cities to implement congestion charging. Users were charged money, when they drove into congested areas. This was enabled by smart traffic technologies. Since the city has a solid network backbone, it is very easy to deploy sensors and applications. For example, recently the city created a smart parking system, where it is possible to easily locate parking spots nearby. Parking lots have sensors, which let a server know about their usage. Once a driver queries the server with her/his GPS location, she/he is guided to the nearest parking lot with free slots. Similar innovations have taken place in the city’s smart buildings, snow clearance, and political announcement systems.

9.3. Social Life and Entertainment
Social life and entertainment play an important role in an individual’s life. Many applications have been developed, which keep track of such human activities. The term “opportunistic IoT” [92] refers to information sharing among opportunistic devices (devices that seek to make contact with other devices) based on movement and availability of contacts in the vicinity. Personal devices such as tablets, wearables, and mobile phones have sensing and short range communication capabilities. People can find and interact with each other when there is a common purpose.

Circle Sense [93] is an application, which detects social activities of a person with the help of various types of sensor data. It identifies the social circle of a person by analyzing the patterns of social activities and the people present in those activities. Various types of social activities and the set of people participating in those activities are identified. It uses location sensors to find out where the person is and uses Bluetooth for searching people around her. The system has built in machine learning algorithms, and it gradually improves its behavior with learning.

Affective computing [94] is a technology, which recognizes, understands, stimulates, and responds to the emotions of human beings. There are many parameters, which are considered while dealing with human affects such as facial expressions, speech, body gestures, hand movements, and sleep patterns. These are analyzed to figure out how a person is feeling. The utterance of emotional keywords is identified by voice recognition and the quality of voice by looking at acoustic features of speech.

One of the applications of affective computing is Camy, an artificial pet dog [95], which is designed to interact with human beings and show affection and emotions. Many sensors and actuators are embedded in it. It provides emotional support to the owner, encourages playful and active behavior, recognizes its owner, and shows love for her and increases the owner’s communication with other people. Based on the owner’s mood, Camy interacts with the owner and gives her suggestions.

Logmusic [96] is an entertainment application, which recommends music on the basis of the context, such as the weather, temperature, time, and location.

9.4. Health and Fitness
IoT appliances have proven really beneficial in the health and wellness domains. Many wearable devices are being developed, which monitor a person’s health condition (see Figure 10).


Figure 10
 
Block diagram of a smart healthcare system.
Health applications make independent living possible for the elderly and patients with serious health conditions. Currently, IoT sensors are being used to continuously monitor and record their health conditions and transmit warnings in case any abnormal indicators are found. If there is a minor problem, the IoT application itself may suggest a prescription to the patient.

IoT applications can be used in creating an Electronic Health Record (EHR), which is a record of all the medical details of a person. It is maintained by the health system. An EHR can be used to record allergies, surges in blood sugar and blood pressure.

Stress recognition applications are also fairly popular [97]. They can be realized using smartphone sensors. Wang et al. describe an application [30], which measures the stress level of a college student and is installed on the student’s smartphone. It senses the locations the student visits during the whole day, the amount of physical activity, amount of sleep and rest, and her/his interaction and relationships with other people (audio data and calls). In addition, it also conducts surveys with the student by randomly popping up a question in the smartphone. Using all of this data and analyzing it intelligently, the level of stress and academic performance can be measured.

In the fitness sector, we have applications that monitor how fit we are based on our daily activity level. Smartphone accelerometer data can be used for activity detection by applying complex algorithms. For example, we can measure the number of steps taken and the amount of exercise done by using fitness trackers. Fitness trackers are available in the market as wearables to monitor the fitness level of an individual. In addition, gym apparatus can be fitted with sensors to count the number of times an exercise is performed. For example, a smart mat [98] can count the number of exercise steps performed on it. This is implemented using pressure sensors on the mat and then by analyzing the patterns of pressure, and the shape of the contact area.

9.5. Smart Environment and Agriculture
Environmental parameters such as temperature and humidity are important for agricultural production. Sensors are used by farmers in the field to measure such parameters and this data can be used for efficient production. One application is automated irrigation according to weather conditions.

Production using greenhouses [99] is one of the main applications of IoT in agriculture. Environmental parameters measured in terms of temperature, soil information, and humidity are measured in real time and sent to a server for analysis. The results are then used to improve crop quality and yield.

Pesticide residues in crop production are detected using an Acetylcholinesterase biosensor [100]. This data is saved and analyzed for extracting useful information such as the sample size, time, location, and amount of residues. We can thus maintain the quality of the crop. Moreover, a QR code can be used to uniquely identify a carton of farm produce. Consumers can scan the QR code and check the amount of pesticides in it (via a centralized database) online before buying.

Air pollution is an important concern today because it is changing the climate of the earth and degrading air quality. Vehicles cause a lot of air pollution. An IoT application proposed by Manna et al. [39] monitors air pollution on the roads. It also tracks vehicles that cause an undue amount of pollution. Electrochemical toxic gas sensors can also be used to measure air pollution. Vehicles are identified by RFID tags. RFID readers are placed on both sides of the road along with the gas sensors. With this approach it is possible to identify and take action against polluting vehicles.