Keywords

1 Introduction

Commercial and residential buildings account for about 60% of the world’s electricity consumption [3]. In USA, about 40% of energy is consumed by buildings [4] whereas this amount was 20% in China by 2015, but it has been growing fast in the last decade [11]. This is an alarming situation as most of the world’s energy matrix is made up of non-renewable sources, such as coal, oil, and natural gas, which have a negative impact on the Earth.

In Brazil, a survey conducted by the Brazilian Association of Energy Conservation Service Companies revealed a waste of electricity equal to 143.6 million GWh between 2014 and 2016, which is equivalent to more than US$ 16 billion. One of the main reasons for this situation is the outdated industrial machinery, lamps, and home appliances in buildings and homes.

Air conditioners particularly contribute to high energy consumption due to intensive use resulted from the climatic conditions observed in tropical countries (such as Brazil) during most part of the year, as well as the great diffusion of these types of equipment in both commercial and academic buildings. This situation worsens when these devices are misused or used in unsupervised ways, e.g. when they remain turned on for several hours in environments that are not in use. Even if a building is designed and built in an ecologically, energy efficiently way, a significant portion of energy can be wasted if there is no energy management or it is inadequately performed during the operation of the building [11].

As a response to this scenario, modern ways to reduce energy consumption have been proposed through the development of environmental monitoring and control systems, without compromising quality of life and economic development. This leads to the concept of smart buildings, which refer to buildings able to minimize energy consumption and improve the experience and productivity of users in these environments [8]. Smart buildings are related to the Internet of Things (IoT) paradigm, which envisions a myriad of physical objects embedded with sensors and actuators connected by wireless networks and communicating through the Internet. Besides the interconnection with each other and with other physical and/or virtual resources, these smart objects can perform several processes, capture environmental variables, and react to external stimuli.

Aiming to contribute to energy efficiency in university rooms, this work presents Smart Place, an environment management system to automatically control air conditioners while avoiding waste of electricity and providing greater comfort to people in such environments. Smart Place consists of hardware to control air conditioners based on data collected by motion, temperature, and humidity sensors, as well as video cameras. The system is integrated with FIWARE [2], an European initiative intended to provide an interoperable middleware platform made up of several generic components to leverage the development of smart cities, IoT, and Future Internet applications. Furthermore, Smart Place has a Web platform for managing devices and monitored environments. The system is part of the smart campus solutions developed under the Smart Metropolis Project at the Federal University of Rio Grande do Norte (UFRN), Natal, Brazil, being currently deployed at fifteen rooms and laboratories in the university.

The remainder of this paper is structured as follows. Section 2 briefly discusses related work. Section 3 introduces Smart Place and its operation in terms of hardware, software, and integration with the FIWARE platform. Section 4 describes some of the results from the deployment of Smart Place in different locations and its contribution to existing solutions. Finally, Sect. 5 brings some concluding remarks.

2 Related Work

The existing literature reports a significant number of studies aiming to use control systems to make environments smarter, reduce the waste of energy, and provide more comfort to their users. This section describes five of these studies and relates them to the proposal presented in this paper. All of them were retrieved from the IEEEXplore electronic database, which is one of the most used publication sources in Computing and Engineering. We have prioritized work published in the last two years and selected the studies that have presented energy saving as goal, a hardware prototype, and means of accessing collected data.

The home automation system proposed by Havard et al. [5] aims to avoid waste of energy and increase the level of security of residential or commercial leases by monitoring environmental variables related to temperature, humidity, lighting, etc. The prototype of the unit responsible for gauging these data is composed of an ESP32 device and a BME680 sensor to measure temperature, pressure, humidity, and presence of gas. To send the obtained data, a network based on the LoRaWAN protocol is used due to its long range and low energy consumption. All measured data are stored into a database within the Amazon Web Services cloud service. Data are used in an application that analyzes them and performs actions such as decreasing or increasing the temperature of the air conditioner, switching on or off the lighting of an environment, informing the resident if there is a gas leakage, etc.

Malche and Maheshwary [6] proposed a smart domestic system to be implemented in smart cities in India. This system is based on the FLIP IoT platform, whose architecture encompasses four layers, namely (i) devices, (ii) gateway, (iii) cloud, and (iv) client application. The device layer is composed of an Arduino Nano controller, a Wi-Fi/Bluetooth communication module, sensors, and actuators. The gateway layer consists of a local processing unit that uses Raspberry Pi 3. The cloud layer integrates a Mosquitto MQTT broker, a MongoDB database, and a Node.js system to process data and create services for the client application layer. The client application layer provides control and monitoring through a dashboard. The FLIP device is connected to sensors, lights, air conditioners, cameras, and door and window systems. The system can also send notifications to users, as well as control lights and air conditioners based on temperature and humidity levels of the environment.

Medina and Manera [7] developed a project to automatically control air conditioners through a wireless sensor and actuator network based on the DigiMesh protocol. The system consists of a central unit that controls all air conditioners connected to the network, an actuator module, and a temperature monitoring module. The central control unit configures the days and hours at which the devices will be turned on or off, as well as it performs diagnoses of them. The temperature monitoring module is responsible for collecting data about the local temperature and humidity. The actuator module receives messages from the central control unit indicating if the current operating time of the air conditioner is within the working period, besides a message from the temperature monitor informing the most suitable temperature for that operation. The PIR sensor detects motion and the actuator sends an infrared signal to the air conditioner, turning it on at the last temperature set. Once it is turned on, the temperature of the device will be constantly adjusted according to the external temperature and air humidity.

Nguyen-ANH and Le-Trung [9] proposed RFL-IoT, a framework for reconfiguring IoT systems with focus on intelligent context management based on fuzzy logic. The RFL-IoT architecture is structured in three layers, (i) physical, (ii) middleware, and (iii) application. The physical layer is composed of an ESP8266 device and sensors that capture humidity and temperature data from the environment, which are sent to the middleware layer via the MQTT protocol. The middleware layer is responsible for persisting and publishing data collected by the physical layer, where the fuzzy logic is placed to use collected data towards deciding about the reconfiguration of the device. Such a reconfiguration concerns resetting the device controller firmware, thus modifying its internal behavior. At the application layer, administrators can view collected data at real-time and the time to reconfigure the device and make changes to the reconfiguration rules. The authors reported a significant reduction regarding the use of electricity and the cost and time for reconfiguring a device.

To reduce the energy consumption of homes and buildings, Song et al. [10] developed a smart air conditioning control system composed of a smart meter to control air conditioners, a gateway, and a server. The system uses the ZigBee protocol to perform communication between the gateway and the control devices. The smart meter consists of temperature and humidity sensors, an infrared emitter and receiver used to control the air conditioner and receive information from the gateway, an electrical switch, a power meter that detects the energy consumption of the air conditioner at real-time, and a ZigBee module. This device receives control information from the gateway to turn the air conditioner on or off and to increase or decrease the temperature of the device. Next, it sends an infrared signal to the air conditioner based on the received commands. The server receives temperature and power consumption information from the gateway and it analyzes these data to make control decisions. These decisions will compose a strategy for energy usage to avoid overconsumption.

The aforementioned works bring interesting concepts in the studied context, all of them aiming to save energy and concerning means of displaying data for management or monitoring in a graphical user interface. Table 1 presents a comparison of the works regarding the issues discussed in this paper.

Table 1. Important issues addressed by related work

As presented in Table 1, most works do not encompass important issues inherent to the environment automation scenario and application of IoT concepts. The use of an IoT middleware platform is important because it abstracts away the specificities of the integrated physical devices, provides the system with greater interoperability regarding other solutions, and contributes to ease application development, but most of the works neglects this issue. The Malche and Maheshwary [6] and Nguyen-ANH and Le-Trung’s [9] works are the only ones that use a middleware platform, but the former does not use a platform that allows customizing the solution, whereas the latter uses a platform that was proposed in the authors’ previous works. Regarding the other issues, the proposals of Havard et al. [5] and Medina and Manera [7] do not have a graphical user interface, thus hampering setup and monitoring by an end-user. In particular, Havard et al. [5] did not also concern adapting the prototype to different scenarios. All these issues were considered in the development of Smart Place and they will be discussed in Sect. 4.

3 Smart Place

Smart Place was designed to automatically control air conditioning devices and keep them turned on upon detecting the presence of people in the monitored environment or when it is expected to be used within fifteen minutes after the detection of no occupants in the room. If these conditions are not met, then the device must be turned off. This is due to the fact that frequently turning the air conditioner on and off can result in greater energy consumption and reduce its service life. Smart Place is inserted into the context of a set of applications developed to create a smart campus at the Federal University of Rio Grande do Norte (UFRN), Natal, Brazil.

The system is composed of: (i) a hardware device, which is responsible for collecting data related to the environment and sending commands to air conditioning devices; (ii) a middleware platform, which provides services such as context management, devices management, and data persistence; and (iii) a Web platform capable of accessing persisted data from devices and making them available for system’s users through querying interfaces. These elements are illustrated in Fig. 1 and detailed in Sects. 3.1 to 3.3

Fig. 1.
figure 1

Overview of Smart Place.

3.1 Hardware Devices

The hardware device is a component aimed to monitor and control air conditioners. This component is composed of a Raspberry Pi microcomputer that (i) acts on the air conditioners by sending infrared signals and (ii) manages data measured by different sensors plugged on the microcomputer to measure environmental variables such as motion, temperature, and humidity, as well as a camera for image capturing. Raspberry Pi also runs the decision algorithm that decides about the actuation action according to data received from sensors and the camera. Both measurements coming from sensors and the camera as well as decisions about acting on the air conditioning devices are forwarded to the underlying middleware platform.

Figure 2 shows a customized 3D-printed structure to host the hardware device with sensors, actuators, and camera, all attached to Raspberry Pi. The hardware device must be deployed in positions that allow for better monitoring the room and actuation on air conditioners. The infrared signal must reach all air conditioners and the camera should have the widest range of vision. The camera should also preferentially have a frontal view of occupants to achieve greater accuracy in counting people.

Fig. 2.
figure 2

Hardware device deployed in a room.

To support the decision process, the device is configured to access a third-party system, e.g., a system that registers the scheduled use for the rooms. Data from this system are locally saved in the Raspberry Pi to offline use until the end of the current academic term, when they will be updated. If the presence sensor detects motion in the room, then images provided by the camera are not used for deciding about the activation of the air conditioner.

Algorithm 1 depicts the procedure for controlling air conditioners based on both data gathered from sensors and images from camera. To turn on/off an air conditioner, the Raspberry Pi’s local system is programmed to execute a set of actions based on the periodic verification of the motion sensor and the camera. When the sensor detects motion, the room management service is queried to verify whether an activity is scheduled for that time. If yes, then the system turns on the air conditioner. Otherwise, if no movement is detected or there is no scheduled activity, the system checks the images from the camera to verify people presence in the room. In case of confirming people presence, the air conditioner is also activated. The difference between these two methods is due to the precision of the motion sensor and the camera. As the motion sensor is more error-prone than the camera, a more rigid methodology is adopted: data from camera are used to double check the presence when no movement is indicated by the motion sensor or when there is a movement in a the room that is not scheduled to have an activity.

figure a

The decision about turning off an air conditioner involves frequently verifying the motion sensor, capturing images from the camera, and processing images every three seconds for monitoring the amount of people in the monitored environment. After fifteen minutes without motion and no people in the images, the device is turned off. To regulate the temperature, the system analyzes each new measurement from the temperature sensor to verify if it is \(\pm 1\,^\circ \)C when compared to the previously configured value (normally \(23\,^\circ \)C \(\equiv \) \(73.4\,^\circ \)F). If the temperature is outside that threshold, then the system sends a signal to the device to adjust the temperature. Figure 3 depicts the communication flows involving the hardware device.

Fig. 3.
figure 3

Hardware measurement and actuation flow.

The environments at which the system may be deployed are very heterogeneous. Hence, an essential system requirement is complying with the plurality of characteristics of these environments. Some characteristics that may vary in each deployment environment are different amounts and models of air conditioners, different room sizes, and the need of using the camera. Such a heterogeneity is handled through a configuration file for each room deployment, which specifies the elements that the device will use. This file is loaded and interpreted at the beginning of the device execution. This strategy allows using a unique base code to different air conditioners and a flexible implementation to control each room.

As rooms may have different sizes or may be divided into (sub)spaces, it would be hard for a single device to monitor the observed environment variables and act on more than one air conditioner in the same room. Therefore, a device distribution strategy needs to be used in the environment. Multiple hardware devices are deployed at the room while maintaining the status of a single device to the system. This happens through the distribution of control units as agents with different roles in different locations of the monitored environment. In this configuration, an agent assumes the role of master and the others become slaves. Slaves are simpler microcontrollers, which are connected only to the temperature, motion, and humidity sensors to reduce the system’s overall implementation cost. Figure 4 shows an example of how organizing devices as master and slaves to control the air conditioners in a room.

Fig. 4.
figure 4

Devices distributed in a master-slave organization.

The communication among agents is wireless, using the MQTT protocol (the master acts as an MQTT broker). Slaves report to the master whenever there are changes in the monitored environment. The master is responsible for deciding about turning on/off or updating the temperature of the air conditioner in each space within the room.

3.2 Middleware

As middleware infrastructure, Smart Place uses the European platform FIWARE, which was chosen due to the fact of being a generic, open-source solution, as well as providing many reusable, interoperable components to ease system development in different application domains, the so-called Generic Enablers (GEs). FIWARE encompasses GEs for different purposes, such as context entity management, device management, historical data storage, entity event processing, security, creation of dashboards, etc.

Some FIWARE GEs are indispensable to develop IoT-based applications, which involves an interaction among physical devices and the need of integrating applications to share data and entities related to the application domain. Three FIWARE GEs are used in Smart Place, namely Orion Context Broker, IoT Agent, and Cygnus. Orion Context Broker is responsible for managing context entities and subscriptions of parties interested in its state changes. The IoT Agent is responsible for device management and communication among devices that use distinct communication protocols. Cygnus binds state changes events to databases that are responsible for storing these event data.

Figure 5 illustrates the FIWARE elements that are the main bridge between hardware devices and the Web platform. The Web platform receives and processes user requests for triggering actions or querying stored data regarding events and devices’ data.

Fig. 5.
figure 5

Communication with FIWARE GEs within Smart Place.

The hardware device uses the MQTT protocol to send the monitored variables (temperature, humidity, presence, number of people) to an MQTT broker instance, Mosquitto [1]. Data are then forwarded from the MQTT broker to the FIWARE IoT Agent, at which working devices are registered. Deployments of FIWARE GEs may contain multiple IoT Agents, each one supporting a different set of IoT communication protocols. This allows employing protocols different from MQTT to be used in hardware devices to communicate with the platform.

Once the device registered at the IoT Agent (associated with the physical device) receives a new measurement from the physical counterpart, the measurement is sent to the entity that represents and stores the attributes of the device at Orion Context Broker. The value of the attribute associated with the sent measurement is updated. Next, an entity update notification is sent to all components subscribed to receive notifications about data changes on the entity. Some of these subscribed components are Cygnus and the RESTful API of the Smart Place Web component, in which the event will be processed and sent to the Web client application to update the exhibition of device data.

3.3 Web Platform

The Smart Place Web platform provides services to configure entities and devices on FIWARE GEs, access historical data, and monitor application events. By using the Web platform, users can manage monitored environments and receive alerts regarding the occurrence of unexpected behaviors. The Web platform also displays data charts in a condensed way to allow for a better analysis on the available information. Users can set parameters to the system execution and trigger commands that are sent to devices, such as turning an air conditioner on or off, setting the desired room temperature, etc.

The architecture of the Smart Place Web platform is shown in Fig. 6. It is composed of: (i) a Central Module, which integrates services and modules related to authorization, notification, control, entities and devices configuration, actuation, and measurements access; (ii) a Persistence Module for storing the structure of entities registered at Orion Context Broker for system reconfiguration purposes after an eventual reboot; (iii) an Alert Module to receive context information and send notifications in case of problems, e.g., the absence of data from a device deployed at a room; and (iv) a Web Module that provides a graphical Web interface for executing user operations through requests to the RESTful API of the Central Module.

Fig. 6.
figure 6

Internal architecture of Smart Place Web component.

The graphical user interface provided by the Web module enables users to invoke operations such as creating, editing, removing, and visualizing entities related to buildings, rooms, sensors, and air conditioners. Moreover, users can visualize measurements obtained from devices deployed at rooms, the actuation made on devices, and energy consumption statistics. Figure 7 shows a visualization of one of the monitored rooms with information such as the number of air conditioners in the room, how many of them are turned on, the number of people in the room, and the current temperature.

Fig. 7.
figure 7

Visualization of Room 3H3 through the interface provided by the Web module.

4 Results and Discussion

Smart Place has been running at the UFRN’s main campus since January 2019 with fifteen devices deployed in rooms with different purposes, including a research laboratory, classrooms, and an administrative office. Through the analysis of data sent by devices to the Central Module, it was possible to evaluate the impact of Smart Place on energy saving. For this purpose, we carried out a study with a set of seven classrooms in a sector of the university during workdays (Monday to Friday) of a week. Prior to the deployment of Smart Place, the air conditioners in these rooms operated uninterruptedly from 6:50 a.m. to 10:40 p.m. at morning, afternoon, and evening classes. Air conditioners are usually off during weekends.

Figure 8 shows a comparison regarding the number of hours that each monitored air conditioner was kept turned on in each room during the analyzed week. The chart compares the actuation of Smart Place with the manual intervention, without the system. With the manual intervention, these devices would be kept turned on for approximately 79 h during the week, more than 15 h per day on average. On the other hand, the automatic control of Smart Place resulted in a reduction of the usage time to 42 h in the observed week, 8.4 h per day on average. This represents an approximate reduction of 46.8% of the total time in which air conditioners are kept turn on in comparison to the manual operation.

Fig. 8.
figure 8

Results on the number of operating hours comparing the manual intervention with the one performed by Smart Place.

Information about device power was obtained through the Brazilian National Energy Conservation Label (ENCE), which provides information about energy consumption and it is a guarantee of the Brazilian National Institute of Metrology, Quality, and Technology (INMETRO) that the equipment has passed a series of safety, energy efficiency, and operation tests. Figure 9 shows results on energy consumption of air conditioners deployed at the rooms with and without Smart Place intervention for the same period.

Fig. 9.
figure 9

Results on the energy consumption comparing the manual intervention with the one performed by Smart Place.

As shown in Fig. 9, the total amount of used energy was approximately equal to 780.8 kWh with the Smart Place intervention. In the scenario without the use of Smart Place, the total consumption was equal to 2037.75 kWh. Therefore, it is possible to observe a total energy saving of 1256.95 kWh provided by the intervention of Smart Place during one week for the set of rooms in the study, being equivalent to a reduction of 61.68% in the consumption. By analyzing the two previous charts, it is noteworthy that the energy consumption is lower in comparison to others, even though the air conditioner has been used for a longer period. This disparity is due to the fact that some types of air conditioner have higher power and hence they consume more energy than others.

With respect to related work (see Sect. 2), Smart Place covers all of the issues presented in Table 1. The system uses FIWARE as a middleware platform, which ensures an accessible, interoperable layer for other applications that need to consume data available at Smart Place through the FIWARE components embedded into the system. In addition, Smart Place has proven to be applicable to rooms with different characteristics. This is possible by the description of device configurations according to the requirements of the deployment site and the operation mode in a master-slave distributed scheme for environments with larger dimensions. The graphical user interface provided by the system also eases controlling and visualizing data of all monitored environments.

5 Concluding Remarks

This paper introduced Smart Place, an environment management system that automatically controls indoor air conditioners aiming to contribute to reduce energy waste. The system integrates: (i) a hardware device to collect data regarding temperature, humidity, and presence of people in monitored places, as well as perform interventions in air conditioners; (ii) a middleware platform that provides services such as context management, device logging, and data persistence; and (iii) a Web platform that accesses data provided by hardware devices and makes them available for control and visualization purposes, besides detecting any abnormality. Smart Place is currently monitoring classrooms and laboratories at the UFRN’s main campus in Natal, Brazil. By analyzing the use of different rooms in the university with and without the use of Smart Place during one week, it was possible to observe a significant reduction in energy consumption, with an average reduction of 46.8% on the air conditioners working time and 61.8% on energy consumption.

As future work, we intend to evaluate the accuracy of the software executed in the devices regarding the decision to turn the air conditioner on/off according to the occupancy of the monitored place. Another evaluation will assess the real impact of the adoption of Smart Place in reducing energy consumption through directly monitoring the electrical network, thus allowing for determining how much consumption has been saved and the impact in terms of cost reduction. Regarding software, the system will be subjected to a performance experimental study aimed to assess the impact of monitoring a large number of devices simultaneously delivering data to the Central Module and the effect of this operation load on Quality of Service (QoS) and Quality of Experience (QoE) requirements.