1. Introduction
With the development of science and technology and the gradual improvement of human living standards, people have a desire for convenient and comfortable living. The significant advances in sensor-based technology have led to the emergence of the smart home and Internet of Things (IoT), providing convenience, comfort and better quality of life for people [
1].
A smart home can be viewed as an environment in which computation and communication technologies are employed for the use and control of household appliances remotely or automatically through IoT, to establish an efficient but comfortable living environment for the resident [
2]. Various wireless technologies that can support some form of remote data transfer, sensing and control, such as GSM (Global System for Mobile communications) [
3,
4], ZigBee [
5,
6,
7], Wi-Fi [
8,
9], and Bluetooth [
10,
11], have been provided to embed various levels of intelligence for the smart home. Among the popular wireless connections that are often performed in a smart home, Bluetooth has a high potential in becoming an important technology for the IoT in low power, low cost and small devices. In addition, it is embedded in all current smart handheld devices (SHD) and it can work in the absence of a Wi-Fi connection. Thus, it will indirectly reduce the cost of the smart system. Bluetooth wireless technology may be the best choice in smart home applications [
12].
The worldwide population is aging at a fast pace. According to a report released by the United Nations [
13], the number of people in the world aged 60 years or over is expected to more than double between 2015 and 2050, reaching nearly 2.1 billion. Promoting quality of life for the elderly and disabled is today an attractive issue. Much work has been reported on the smart home for older adults and disabled people [
14,
15,
16,
17,
18]. Concerning the user-friendly smart environment, providing an ease-of-use monitoring and control device is crucial.
SHD are increasingly becoming ubiquitous due to their powerful hardware and useful features. According to the eMarketer report [
19], there will 4.3 billion smartphone users worldwide in 2016, representing 58.7% of the global population. This information is important because it gives an indication of the number of the SHD users for the smart home developed on these devices. SHD now have mobile sensors that perform activity recognition and detect physical activities with no additional sensing hardware [
20]. Various studies have been carried out to build smart environments by means of SHD [
21,
22,
23,
24]. Most of the studies concerned real-time monitoring or household appliances controlling.
Energy management system is the integration of technologies and services through home networking for an intelligent living environment. There has been a surge of interest in the home energy management system (HEMS) because the IoT holds promise for making homes smarter. The main purpose of the HEMS is not just to minimize the energy consumption but also to ensure customers’ comfort [
25,
26]. The HEMS could reduce operational cost of electricity by 23.1% or reduce residential peak demand by 29.6% [
27]. Energy management of heating, ventilating and air-conditioning (HVAC) systems is a primary concern in building projects, since HVAC represents the highest percentage of energy consumption in electricity among all building services installations and electric appliances. Much effort has been devoted a HVAC control strategy or algorithm for promoting HEMS [
28,
29]. The studied HVAC can balance home comfort against energy use. However, few of them have endeavored to include the control of curtains and windows.
People want curtains and windows primarily for daylight and secondarily for the view. Furthermore, curtains and windows have a significant impact on the energy consumption and living environment. The use of curtain and window can decrease the indoor temperature in a hot day, and thus saving energy can be expected. Surprisingly, it was found that in an era of ubiquitous mobile technologies, few papers showed the use of SHD in windowsills including electric curtains and electric windows. This paper proposes an innovative use of SHD to monitor and control the designed intelligent windowsill system (IWS) that provides indoor comfort and healthy environment. For the realization of this system, the IWS equips a compact weather station including a variety of off-the-shelf environment sensors that measures indoor illumination, temperature-humidity, carbon dioxide (CO2) concentration, outdoor rain and wind direction. Traditional curtains and windows are manually operated, which is always inconvenient to the elderly and disabled. Although electric curtains have appeared in the market, they cannot adapt to climate changes in the environment.
In this paper an attempt has been made to design and implement a real-time monitoring and control windowsill system for the elderly and disabled. The main contributions of the paper are that a novel control method for the windowsill was proposed and a novel mobile application (app) software was developed to make the system easier to operate and to give the room greater comfort. The control strategy of the work was based on fuzzy and direct control and performed by an Arduino microcontroller. Additionally, the proposed IWS can automatically close windows for splashing rain. A laboratory prototype was built and evaluated in various scenarios. The experimental results showed that the system has a smart control on the electric curtain and electric window.
The remainder of this paper is organized as follows.
Section 2 describes the architecture of the proposed IWS. In
Section 3, the control strategies considering an intelligent windowsill system is presented. The system operation on SHD is illustrated in
Section 4. The testing on the laboratory prototype for experimental verification is provided in
Section 5. Final conclusions and an outlook for further work are given in
Section 6.
2. Proposed Intelligent Windowsill System and Architecture
This section describes the backbone of the system, which comprises several modules.
Figure 1 illustrates an overview of the system architecture for the proposed system indicated modules and their interactions. These are “measurement module (compact weather station)” sensing and measuring environment physical quantity and then sending them to Arduino UNO, which is the Arduino’s flagship board; “information processing and decision-making module (Arduino UNO microcontroller)” processing the measured signals and sending an adequate command to windowsill; “Bluetooth module” which provides the wireless communication between SHD and Arduino; “SHD” monitoring the measured information and sending the command to Arduino and the module “plant (windowsill)” which is controlled by Arduino. A brief description of the modules is further explained in the following subsection.
2.1. Measurement Module
The IWS used many types of environment sensors to monitor the real-time status in the home. The measurement module is the key to the IWS and an integration of the indoor and outdoor environment sensors. A light dependent resistor (LDR) or photoresistor is used to measure the indoor illuminance from the daylight contribution and artificial lighting in real-time. The commercial grade Tokenchina’s PGM5537 was used, in which resistance decreases with increasing incident light intensity [
30]. The module DHT11 was used for sensing the temperature and relative humidity of air. It measures temperature from 0–50 °C with a precision of ±2 °C and relative humidity ranging from 20%–95% RH with a precision of ±5%. The indoor air quality is mainly influenced by the CO
2 concentration. The CO
2 concentration was sensed by using the module MG811, which is a chemical sensor. It works based on the solid electrolyte cell principle. When the sensor is exposed to CO
2 gas, chemical reactions occur in the cell producing an electromotive force. The CO
2 detection range of this sensor is 350–10,000 ppm (parts per million) which produces 30–50 mV. In addition, to detect raindrops falling on the electric window, the rain sensor FC-37 was used and mounted on the outside of the window. It runs on a power supply of 5 V. After detecting the raindrop, the sensor board transmits an analog output to the rain sensor driver and then produces a digit output, which will drop from high to low. The digit output will rise from low to high when the raindrop is wiped off or vaporized. To detect the existence and direction of the wind, a self-made anemoscope was built and mounted on the outside of window. The self-made anemoscope shown in
Figure 2 is actually much cheaper than those in the market, with no loss in functionality. Four reed switches are respectively placed on the positions of labelled
E (east),
W (west),
S (south) and
N (north). When the anemoscope is on the windward side, the corresponding reed switch will be activated and a signal will be produced. Once falling raindrops splash against the collected board of the rain sensor and the electric window is on the windward side, a signal will be activated and sent to the Arduino microcontroller for closing the window.
The measured information is gathered and transferred to the information processing and decision-making module, which is an important element for decision-making strategies.
2.2. Information Processing and Decision-Making Module
The module is the core of the proposed IWS. It includes two main units: information processing unit and decision-making unit. Considering the environmental conditions provided by the measurement module, the information processing and decision-making module must access the information and provide an adequate command to the windowsill drivers to regulate the plant. The decision-making module provides two ways to control. One way is fuzzy control based on the measured information from indoor sensors for maintaining indoor comfort. The fuzzy control is designed to achieve the requirements based on the designed fuzzy rule base. With the fuzzy control applied, the electric curtain and electric window can maintain their required positions for comfort. Another way is direct control based on the sensed conditions from outdoor sensors for preventing rain from splashing.
Arduinos are used widely by all kinds of makers worldwide. Popularity has been driven by the Arduino’s simplicity of use and the numerous sensors and libraries available to extend the basic capabilities of these controllers [
31]. Using such an inexpensive device makes the installation and maintenance of a system easier. In the current set-up, an Arduino is used for interfacing with environment sensors and as a data-logger. Based on the Arduino features, programming in an Arduino UNO containing ATMEGA 328 microcontroller was done to perform the information processing and control the windowsill.
2.3. Bluetooth Module
As a communication tool between the control platform and sensor nodes, wireless sensor networks (WSN) have been deployed as a reasonable and low-cost communication technology. In this work, the wireless communication was implemented using the Bluetooth module. Bluetooth is a global wireless communication standard that connects devices together over a certain distance, usually 10 m to 100 m. The work used Bluetooth HC-05 module for the communications between Arduino UNO and SHD.
2.4. Smart Handheld Device
A SHD was used to monitor the environment information provided by the measurement module. The user can send a command to the information processing and decision-making module via the Bluetooth module for regulating the electric curtain and electric window appropriately.
MIT App Inventor is a drag-and-drop visual programming tool for designing and building fully functional mobile apps on the Android based platform. It allows Android apps to be built and programmed with colorful building blocks instead of programming codes. An IWS mobile app was developed using MIT App Inventor 2 for SHD. Three modes of operation can be selected when the SHD is connected to Bluetooth. In
Figure 3, two screens of the mobile app are shown.
Figure 3a is the default screen that operates in manual mode. The block “show hidden” is a small utility that will display all hidden information on the SHD. The blocks “close” “STOP” and “open” are the selection for controlling the electric curtain, and the blocks “OFF” and “ON” are the selection for controlling the electric window.
Figure 3b is the screen of auto mode. Under this mode the windowsill will be automatically controlled based on the design fuzzy rules. In monitoring mode, as shown in
Figure 4, the SHD will automatically display the measured information from the measurement module, including humidity, temperature, illumination, air quality, rain detection and wind direction. The shown air quality is normal—that means the range of CO
2 concentration is from 700 ppm to 2800 ppm in the room. The user can quickly access the measured environment information.
2.5. Plant
The plant consists of an electric curtain and electric window. The electric curtain used was the ready-made RAEX M300. Owing to lack of an available electric window, a two-phase six-wire stepper motor with driver module was used to simulate the controlling electric window.
3. Fuzzy Control
Fuzzy logic differs from classical logic in that statements are no longer true or false, on or off. In traditional logic, an object takes on a value of either zero or one. However, in fuzzy logic a statement can assume any real value between 0 and 1 representing the degree to which an element belongs to a given set. In contrast to the traditional control theory, fuzzy logic does not need intricate mathematical models to perform, only a practical understanding of the overall system behavior. A fuzzy logic describes a control protocol by means of if–then rules. In engineering systems, it provides a convenient and user-friendly front-end to develop control programs [
32,
33].
Designing a fuzzy controller is a simple concept that includes the three stages: fuzzification (an input stage), rule evaluation (a processing stage) and defuzzification (an output stage) [
32]. The developed fuzzy logic control strategy for the IWS was designed in MATLAB using max–min inference and centroid defuzzification. A comprehensive fuzzy algorithm involving indoor temperature, indoor illuminance and indoor CO
2 concentration is proposed to evaluate living comfort. The fuzzy inference model is Mamdani with three inputs (indoor temperature, indoor illuminance and indoor CO
2 concentration) and two outputs (electric curtain and electric window).
The island of Taiwan lies across the Tropic of Cancer. The north of Taiwan is situated in the subtropical region, while the southern part belongs to the tropical climate zone. The studied work was performed in Taiwan. According to the climate in Taiwan, each of the three inputs is defined on the four fuzzy sets {Low (L), Medium (M), High (H), Very High (VH)}. The membership functions of trapezoid and triangular form associated with the fuzzy sets of the input variables are presented in
Figure 5,
Figure 6 and
Figure 7. The membership functions characterize the fuzziness in a fuzzy set. Certainly, the fuzzy sets can be arbitrarily redefined based on the local environment conditions. Through the membership functions, the fuzzy controller evaluates the appropriate outputs for fuzzy rule base that maps inputs to desired outputs. The two outputs of the IWS are described by the eight fuzzy sets {Fully Close, Open 1/7, Open 2/7, Open 3/7, Open 4/7, Open 5/7, Open 6/7, Fully Open}.
Figure 8 shows the membership functions for output electric curtain and electric window with all the fuzzy sets. The corresponding fuzzy rule base for the electric curtain with indoor temperature-illuminance is listed in
Table 1. Based on the
Table 1, the Arduino microcontroller will then make decisions for what action to take. Accordingly, the plot between temperature-illuminance and opening electric curtain is illustrated in
Figure 9, which is a 3-D visualization of the inference rules in MATLAB. Similarly, the fuzzy rule base for the electric window with indoor CO
2 concentration-temperature is listed in
Table 2. The corresponding 3-D visualization of the inference rules is also illustrated in
Figure 10. The structure of the fuzzy controller is established in
Figure 11.
4. System Operation on SHD
With regard to the importance of the SHD’s role in human life, a novel Android app was developed to perform the real-time monitoring and smart control for the designed IWS. Concerning cyber security, the first step to protect the IWS from unauthorized users is achieved by the use of passwords. Attempting to operate the IWS for the first time, the user must login with a secret password provided by the Bluetooth HC-05 module manufacturer when the SHD connects to Bluetooth. After passing the system authentication, the IWS can be operated.
Figure 12 illustrates the system operation on the SHD. The app receives the operations of auto mode, monitoring mode or manual mode from the user. In auto mode operation, the electric curtain and electric window are controlled by the Arduino fuzzy microcontroller based on the measured information and the programming fuzzy rules. In monitoring mode operation, the measured environment information is automatically shown on the SHD as shown in
Figure 4. In manual mode operation, the user can arbitrarily control the motions of electric curtain and electric window.
6. Conclusions
This paper has presented an implementation of IWS utilizing fuzzy control, direct control and Bluetooth wireless technology to develop a novel control method for making the system easier to operate and giving the room greater comfort. To prevent unauthorized users from entering the IWS, password authentication was provided. The remote control and monitoring function by the SHD provided help and assistance, especially to the elderly and disabled. LDR, temperature-humidity sensor and CO2 sensor were installed in indoor sites. The rain sensor and anemoscope were placed in outdoor sites. Based on the measured environment information, an Arduino UNO microcontroller was designed to automatically regulate the electric curtain and electric window for responding to climate changes. The developed app available for Android-based SHD allowed remote users to easily browse sensor status and operate the IWS. In addition, integrating the rain sensor and anemoscope, the proposed IWS can fully close the electric window when the rain splashes on the window. A laboratory prototype has been successfully built and tested to verify the effectiveness of the control implementation. Integration of IWS and household appliances such as air conditioner, lighting fixture, air purifier and dehumidifier for creating the smart and energy-saving environment may be future work. The empirical findings may serve as valuable references for further SHD applications and smart homes.