Effectiveness of using WiFi technologies to detect and predict building occupancy

. This paper presents ﬁ ndings of a case-study demonstrating the effectiveness of using WiFi networks to detect occupancy as opposed to CO 2 sensors, commonly used for demand-controlled heating, ventilation and air conditioning (HVAC) systems. The study took place in one building at the University of Manitoba Fort Garry campus in Canada. In a classroom, the number of WiFi connections was collected on an hourly basis over one-week, simultaneously with CO 2 concentration levels at 10-min intervals. The number of occupants in this classroom was also counted on an hourly basis over the same study period. Data analysis showed that WiFi counts predicted actual occupancy levels more accurately than CO 2 concentration levels, thus validating the use of this technology to track occupancy. This study was the ﬁ rst to use both CO 2 concentration and WiFi counts simultaneously as indicators for occupancy. Results demonstrated the possibility of using WiFi counts in large buildings for controlling HVAC systems at a higher accuracy and lower cost than other sensor technologies. Implications and in ﬂ uences: Given the large contribution of HVAC systems to overall buildings ’ energy consumption, this study presents a new method for ef ﬁ ciently operating HVAC systems. Results highlighted the accuracy of using WiFi connections as predictors for occupancy patterns to be used for controlling HVAC systems instead of CO 2 sensors. These ﬁ ndings provide a foundation for further research on using WiFi networks to manage and operate HVAC systems in new buildings. Ef ﬁ cient operation of these systems based on real-time occupancy as opposed to static schedules provides facility managers with an opportunity for signi ﬁ cant energy savings at a relatively low cost.


Introduction
Since buildings contribute 20-40% of energy use worldwide [1], efforts to decrease their energy consumption are essential. Advances in buildings' sustainability can reduce their energy consumption by improving building envelopes; and HVAC systems. These systems consume up to 57% of total buildings' energy consumption [2], making them a significant energy end-use consumer in buildings.
Sensor-based, demand-controlled HVAC systems present in particular an excellent opportunity for optimizing buildings' energy consumption. These systems base their ventilation rates on sensors that can be used to detect the presence or absence of occupants and are thus able to reduce peak energy demand by up to 23% [3]. Currently, most demand-controlled HVAC systems are based on monitoring and controlling carbon dioxide (CO 2 ) levels. This is because of the association between CO 2 levels and occupancy, making them an important indicator of occupancy [4]. However, one of the major limitations of CO 2 -based, demand-controlled HVAC systems is their high installation, operation and maintenance cost, especially for retrofitting existing buildings [5].
In large non-residential buildings, WiFi technologies present an alternative for demand-controlled HVAC systems. The study by Vaccari and Samouhos [6] analyzed WiFi activity at the Massachusetts Institute of Technology campus and suggested it could be used as a proxy for human occupancy. Vaccari and Samouhos [6] also proposed using WiFi activity data for building energy management. One of the main advantages of using WiFi data is its availability at no additional cost to building managers and operators. Reports can be generated using the WiFi network administration system in a relatively short time, thus eliminating the need to invest in personnel, equipment and materials unlike other technologies such as CO 2 sensors. Despite these potential benefits, the use of WiFibased, demand-controlled HVAC systems remains limited.
This research aims to investigate the use of WiFi connections as an indicator of occupancy in order to validate its use for building energy management. The significance and originality of the research stem from being the first study to the author's knowledge that investigates using WiFi data and CO 2 concentration simultaneously to detect real-time occupancy. This makes the research of interest to building owners, managers and operators looking to improve their buildings' energy consumption.

Background
In large non-residential buildings, addressing the energy efficiency of HVAC systems has become a priority. Retrofits aiming to improve the efficiency of HVAC systems, typically focus on upgrading boilers and chillers or adding heat recovery systems. Rarely do these retrofits focus on using demand-controlled, responsive HVAC systems that adjust to real-time variations in building occupancy [6]. Recent studies estimated these savings can range between $80 000 and $100 000 annually in large commercial buildings [7]. HVAC systems are typically programmed to respond to external weather conditions rather than changes in indoor occupancy levels, despite the potential for saving an additional 10-40% in buildings' energy consumption [6]. Similarly, it is important to acknowledge the impact of real-time occupancy detection on other applications, such as evacuation planning, and improving space utilization within large buildings [8].
A review of the literature shows little focus on occupancy-driven energy management, and the technologies that can be used to determine real-time occupancy levels [6,9,10]. The strength of each technology lies in its capability to accurately determine real-time occupancy presence, count and activity [11]. These technologies can be divided into four different categories as follows; (1) direct presence data recognition solutions, (2) wired networkbased and energy-related solutions, (3) network-based solutions with active or passive access badges, and (4) wireless network-based solutions [9].

Direct presence data recognition solutions
Direct presence data recognition systems integrate different sensors (e.g. infrared detection, CO 2 sensors, floor pressure sensors, camera-and audio-based sensors) to detect occupancy within a space. Oftentimes, these systems require additional infrastructure, thus increasing associated costs [12]. One of these technologies is passive infrared (PIR) occupancy sensors which measure the difference in heat energy along the line of sight of the sensor [13]. Alternatively, ultrasonic sensors, composed of an ultrasonic wave emitter and receiver, detect occupant movement via sensing sound energy [13] without requiring a direct line of sight. Both methods only detect occupant presence, but cannot extract higher data granularity about occupants' count nor their activity level [13]. PIR could be an effective demand driven lighting control especially for private offices with occupancy rates of about 27% [14]. However, the need for a direct line of sight between the sensor and occupants and the reliance on only occupants' motion makes PIR less practical for large spaces such as university classrooms [12,15].
Using CO 2 sensors to measure occupancy and manage HVAC systems appears to be an accepted industry practice [5,[16][17][18]. Energy savings due to CO 2 -based demand controlled ventilation can reach up to 34% [3]. ASHRAE 62.1:2013 [19] stipulates that the difference between indoor and outdoor CO 2 concentration levels (typically at 300-400 ppm) should not exceed 700 ppm. It also specifies that the fresh air supply for a typical lecture classroom should not be lower than 3.8 l/s/person. Once CO 2 sensors detect an increase in CO 2 levels beyond a certain threshold, the ventilation controls of HVAC system are automatically activated. A study by Cali et al. [20] found that CO 2 sensors accurately detected occupancy counts up to 80.6% of the time in both mechanically and naturally ventilated zones. The study concluded that the location of sensors, and information about the supply air rates were vital to the accuracy of using these solutions.
Although Fisk et al. [21] found a relationship between CO 2 concentration levels and the number of occupants, a 20-min lag was observed between them indicating that occupants could already be in a state of discomfort. Another limitation of CO 2 sensors is the additional cost associated with their operation and maintenance of CO 2 sensors [5]. CO 2 sensors are also susceptible to changes in air speed and interference from other gases, which influences their accuracy [22,23].

Wired network-based and energy-related solutions
These solutions rely on equipment sub-meters to detect occupants' presence. The type of equipment being metered (e.g. laptops) can indicate occupants' count and activity. However, some studies e.g. [24][25][26] show that more than 50% of occupants leave their computers on when leaving a space. In order to address this concern, Milenkovic and Amft [27] proposed a dual technology occupancy detection system that combined PIR sensors and plug monitors for different equipment. The meters specifically measure the change in energy consumption, while the PIR sensors complement the system by detecting occupants' presence. Occupant count accuracies of 87% and 78% were found for single-person versus shared offices, respectively [27]. However, these systems would be restricted to office environments and require significant costs for installation [28].

Network-based solutions with active or passive access badges
These solutions include radio frequency identification (RFID), key cards and mobile applications which can detect both occupant presence and count, but not their activity. RFID is an object detection technology based on signal detection and data transmittance through a radio frequency [29]. An RFID system consists of an antenna, a reader, and tags; the tag contains information that can be detected when it is within the reader's detection range [29,30]. Unlike PIR, RFID does not require a direct line of sight for occupant detection, thus it can detect stationary and moving occupants [31]. Li et al. [30] investigated the use of RFID for demand driven HVAC operation in office buildings. The study found a 100% detection rate for both stationary and mobile occupants and an accuracy level of 88% and 62% respectively, suggesting RFID as a suitable occupancy detection mechanism for demanddriven control of HVAC systems in large academic buildings. The downside of RFID is the need for occupants to constantly wear the tag, which may be difficult in buildings with a large transient occupancy such as university buildings [28]. The accuracy of an RFID system also depends on the density of installed readers and the received signal strength (RSS), hence, the cost of deploying the system in large academic buildings would be a significant barrier [31,32].

Wireless network-based solutions
WiFi networks exist in most large commercial and educational buildings. They can form a more dynamic real-time occupancy detection technology than wired networks by tracking devices such as laptops and smart phones connected to WiFi access points (APs) of a wireless LAN 802.11 network (WiFi network). A Dynamic Host Control Protocol (DHCP) is used to connect an Internet Protocol (IP) address to each device [9]. While this technology can detect both occupants' presence and count, it cannot identify the occupant's activity and poses some concerns for occupants' privacy [28].
Three existing methods for WiFi-based occupants' detection influence the accuracy of this method: (1) Closest Access Point, (2) Triangulation, (3) Radio Frequency Fingerprinting. For the Closest Access Point method, a mobile/stationary device connects to the closest and strongest AP, forming the strongest RSS. With a typical radial coverage of 10.5-45 m [33] any overlap of two APs will result in the mobile device connecting to the closest one. Triangulation, on the other hand, uses the existing mesh of APs to inform about the specific user location with a higher spatial granularity of 5-m radius [33]. The distances from each AP are deduced from measuring both RSS and time of flight [34]. When measuring the time of flight for each of the APs with the mobile device, the difference is indicative of the specific location of the device [34]. However, this method raises privacy concerns since it requires identifying each device and its associated MAC address. The third method of WiFi-based occupancy detection is Radio Frequency Fingerprinting, which refers to a process of matching an existing database of radio frequency signals to actual real-time signals to detect device locations. The database is created by walking through the building and mapping reflections, attenuations and diversions of signals caused by the building's interior design and object configurations [35].
Using WiFi-based occupants' detection can provide a reliable solution for controlling building management systems (BMSs) [9]. The study by Sevtsuk et al. [36] showed that WiFi counts can be collected and mapped to visually represent occupant spatial intensities which can be used by universities to identify space utilization rates. El Amine et al. [37] and Mardini et al. [38] proposed a more sophisticated and advanced WiFi-based occupant detection solution. These studies estimated occupants' location using ZigBee, and XBee networks and developed algorithms to estimate RSS Indication (RSSI) fingerprinting which detected occupants' locations within 0.8 m. On the other hand, the study by Martani et al. [7] showed that only 40% of building occupants were connected to the WiFi network, raising concerns about this solution's reliability. Another study by Christensen et al. [39] also highlighted some of the limitations of using existing WiFi networks due to the unstable WiFi connectivity of smartphones which lowered detection accuracy to 45-52%.
Because WiFi networks already exist in most commercial and institutional buildings (e.g. university campuses or office buildings), the cost of using this technology to track occupancy is negligible [2,7]. However, the number of WiFi counts may not accurately reflect the exact number of building occupants since occupants may have more than one device (e.g. a laptop and a smartphone) connected simultaneously to the WiFi network [39]. Moreover, not all occupants may be connected to the network especially in buildings with a large population of visitors [6].

Method
This section describes the research methods. It includes a description of the specific case study in addition to the data collection and analysis methods used therein.

Case study
This esearch uses a case-study approach. It tests the ability of WiFi counts to predict occupancy patterns in the Engineering and Information Technology Complex (EITC) at the U of M Fort Garry campus in Winnipeg, Manitoba, Canada (Fig. 1). The EITC comprises three adjacent buildings, the first (E1) built in 1913, with an addition built in 1958 and the second (E3) built in 1967. The third building (E2) was built in 2005 as part of a major renovation to link all three buildings around a central atrium. It has a combined total floor area of 449 432 ft 2 and is home to all undergraduate and graduate engineering programs. It also houses several engineering laboratories as well as faculty, staff and graduate students' offices. Activities taking place within the building range from lectures, to research in laboratories, and administrative and social functions, making it an ideal academic building for testing the validity of the proposed method. The EITC also represents a unique opportunity to design, develop, deploy, and test a scalable system for identifying campus-wide energy efficiency opportunities. The current building infrastructure includes a large number of WiFi APs in each room and hallway and an advanced BMS. This allows for the collection of energy consumption data, HVAC operational schedules, set points, temperatures and flow rates using a wide range of sensors across the system. It also allows for collecting WiFi connections counts at the room-level.
One classroom in E2 with a maximum occupant capacity of 80 students, was analyzed in particular to validate the use WiFi connections as an indicator of occupancy. The classroom has a floor area of 1550 ft 2 , and no outside windows, with 2 APs serving the classroom occupants as shown in Figure 2. The classroom is supplied with air at 0.65-0.7 m 3 /s during occupied hours from an Air Handling Unit serving the east side of the building, thus providing approximately 4 air changes per hour.

Data collection
The research involved investigating the relationship between the number of WiFi connections, CO 2 concentration levels and number of occupants in one classroom over the period of one week between Friday, March 27th and Thursday, April 2nd, 2016.

WiFi data collection
The number of WiFi connections was collected on an hourly basis using a system-generated report from 2 CISCO ® AIR-CAP2602I-A-K9 APs in this room. These APs provided a DHCP lease for 8 h which means the number of associated accounts connected to each AP within an hour would be tied to an individual MAC address (i.e. individual device). Specific MAC addresses were not provided due to security and privacy concerns. The APs cover a horizontal radius of approximately 50-75 ft and 30 ft at 2.4 GHz, 5 GHz, respectively. Vertically, the WiFi signal would be significantly weakened due to the concrete slabs, but the APs may cover a vertical radius of up to 20 ft and 10 ft at 2.4 GHz, 5 GHz, respectively. The Information Services and Technology office managing the WiFi system estimated these coverage areas based on the APs transmission power in dBm at each frequency, which may vary based on the automatically set power levels. Although this calculation indicates some overlap in the coverage areas around each AP, devices would typically connect to the strongest WiFi signal (i.e. the closest AP). Therefore, given that adjacent areas, including the corridor outside this classroom, are equipped with separate APs, the majority of devices outside this classroom would not connect to its WiFi APs.

CO 2 emissions data collection
To collect CO 2 concentration levels, a Q-trak ® monitor (model VelociCalc/Q-Trak 7565), supplied by the Environmental Health and Safety Office at the U of M, was installed for a one-week period to record CO 2 concentration levels at 10-min intervals. The CO 2 monitor was placed approximately in the middle of the classroom at the ceiling level. It was placed on top of a ceiling tile with the probe protruding into the empty space between the ceiling tiles as shown in Figure 2b in order to capture the classroom's environmental conditions. The monitor has an accuracy of ±50 ppm at 25°C and was calibrated during the last week of January 2016.

Occupancy data collection
Student volunteers were recruited to count the number of occupants inside the classroom at the beginning of every lecture during regular class hours (8:00 AM-8:00 PM) on weekdays. Figure 3 shows the classroom schedule provided by the university registrar.

Data analysis
The collected WiFi counts for the entire EITC were plotted over the entire week to analyze trends and their relationship with expected occupancy. The data analysis also entailed producing scatter plots for each weekday within the case-study classroom demonstrating the relationship between the number of occupants, CO 2 concentration levels, and the number of WiFi counts. To correlate the three variables, the cases had to be paired (i.e. taken at the same interval), which is one of the requirements for Pearson's correlation. Therefore, the geometric mean of CO 2 concentration of all 10-min intervals within an hour was used to correlate CO 2 concentration with WiFi and Occupancy counts. Figure 4 shows that the hourly geometric means of CO 2 concentration had a similar pattern to 10-min interval data. Using a geometric mean takes into account the steady increase in CO 2 concentration during the 1-h periods, making it more applicable than arithmetic means in this case.
The number of occupants in the classroom was calculated on an hourly basis based on occupancy counts, with the number assumed to remain unchanged for lectures longer than 1 h. For back to back lectures that were each shorter than an hour, the number of occupants per hour was calculated as the average of the number of occupants in each lecture taking place within that hour.
A Pearson's product-moment correlation assessed the relationship between the hourly number of occupants and hourly CO 2 concentration levels, as well as the hourly number of occupants and hourly number of WiFi counts between 8:00 AM and 8:00 PM on weekdays. In order to assess linearity, scatterplots of CO 2 concentration levels and WiFi counts against the number of occupants, with superimposed regression lines, were plotted. Visual inspection of these plots showed a linear relationship between the variables. A preliminary analysis also showed there was homoscedasticity and normality of the residuals which are the assumptions that need to be met for a Pearson's correlation test.
The research finally involved running multiple regression to predict the number of occupants using CO 2 concentration levels and WiFi counts combined. Partial regression plots and a plot of studentized residuals against the predicted values showed linearity and there was independence of residuals, as assessed by a Durbin-Watson statistic of 1.3. A preliminary analysis also indicated homoscedasticity, as assessed by visual inspection of a plot of studentized residuals versus unstandardized predicted   values. There was no evidence of multicollinearity, as assessed by tolerance values greater than 0.1 and there were no studentized deleted residuals greater than ±3 standard deviations. There were also no leverage values less than 0.2, and no values for Cook's distance above 1. The assumption of normality was also met, as shown by a Q-Q plot.

Results
This section presents the results of data analysis at the building and classroom levels. It shows the results of evaluating variations in WiFi counts at the building level, and evaluating changes in CO 2 concentration levels, number of WiFi counts and number of occupants at the classroom level. It also presents the results of investigating the relationship between these three different variables at the classroom level. Figure 5 shows the number of WiFi counts on an hourly basis in the EITC over the one-week study period. The graph shows that on weekdays, occupants' WiFi activity typically started to increase between 8 and 10 AM as students and faculty arrived and populated the building. It reached its peak at an average of approximately 2200 WiFi connections between 2 and 3 PM, before decreasing considerably past 5 PM after most classes ended and students and faculty vacated the building. Occupants' WiFi activity started later during the weekend between 9 AM and 12 PM; reaching its peak at an average of approximately 500 WiFi connections between 3 and 4 PM, before decreasing considerably past 7 PM. The average number of hourly WiFi connections on weekdays was 886 connections which dropped to 253 connections on the weekend because of the significant decrease in occupancy. Table 1 shows the average hourly number of WiFi counts, occupants and CO 2 concentration levels (hourly geometric means) in the analyzed classroom for each weekday throughout the study period during regular work hours (i.e. 8 AM-8 PM). The geometric mean of CO 2 concentration levels was typically below the maximum allowed classroom concentration level of 1000 ppm [40]. Figure 6 depicts variations in WiFi counts, the number of occupants and CO 2 concentration levels between 8 AM and 8 PM over every weekday. The graph shows peak classroom occupancy, WiFi connectivity and CO 2 concentration levels between 10 AM and 12 PM and between 3 and 5 PM for every weekday. In general, the number of WiFi counts was only slightly higher than the number of occupants. The only exceptions to this were on Monday between 3 and 5 PM, and Tuesday between 2 and 5 PM when the number of WiFi counts was approximately 70% and 50% higher respectively than that of occupants. This much higher number of WiFi counts suggests that more electronic devices than normal were connected to the WiFi network due to the required use of laptops in class at that time. There was only one instance on Monday between 3 and 5 PM where the number of WiFi counts was lower than    Figure 7 shows the relationship between hourly CO 2 concentration levels and the hourly number of occupants, as well as between the hourly WiFi counts and the hourly number of occupants between 8:00 AM and 8:00 PM on weekdays. The Pearson's product-moment correlation indicated a statistically significant strong positive correlation between the hourly number of occupants and WiFi counts (r = 0.839, P < 0.005), and a significant, albeit relatively weaker, positive correlation between the number of occupants and CO 2 concentration levels (r = 0.728, P < 0.005). The linear regression model showed that average CO 2 concentration levels accounted for 52.9% of the variation in the number of occupants (P < 0.005) whereas hourly WiFi counts accounted for 70.4% of this variation (P < 0.005).  Table 2, was found to predict the number of occupants using both variables. However, WiFi counts were the more significant independent variable affecting the number of occupants.

Discussion
The variations of total WiFi connections across the EITC showed a consistent pattern across weekdays. As the number of WiFi connections started to increase every morning reaching peak levels around mid-day, Figure 5 showed correlation between WiFi concentrations and occupancy patterns. Figure 5 also showed consistent patterns over the weekend where WiFi activity appeared to be very limited because of the lower building occupancy in comparison with weekdays. The decrease in average WiFi counts in the building by approximately 71% on weekends in comparison with weekdays highlights the close relationship between WiFi activity and occupancy.
A comparison between average WiFi counts and average number of occupants per day as shown in Table 1 reveals a strong relationship between both variables, with the numbers being somewhat close for every weekday. This shows that unlike CO 2 levels, the number of WiFi counts can closely predict the approximate number of occupants in the classroom. There was in fact a difference of approximately 3-40% between the number of WiFi counts and occupants in the classroom on every weekday. The increased discrepancy between WiFi counts and the number of occupants on some days could be attributed to students or instructors having more than one electronic device connected to the WiFi network. Therefore, using WiFi counts needs closer investigation to account for all possible scenarios where WiFi counts may not closely match the number of occupants. These scenarios may also include exam times where students are required to leave their electronic devices, thus necessitating further analysis of the relationship between WiFi and actual occupancy counts. Once the relationship is further investigated, several solutions could overcome this issue such as accounting for scheduled events such as exams which are known in advance. Another solution could be establishing threshold levels before which WiFi counts may not be used as proxy for actual occupancy.
The variations in CO 2 levels also showed a correlation with occupancy counts. However, several instances indicated a large discrepancy between both variables as shown in Figure 6. For example, on Monday and Friday, CO 2 concentration reached around 2000 ppm which is very high in comparison with the recommended 1000 ppm for classrooms, but was observed in previous studies [41,42]. This unusually high concentration of CO 2 may be attributed to a few factors such as increased activity levels or temporary malfunctions in the air supply system. However, the decrease in CO 2 concentrations to normal levels on other days as well as evenings and weekends, where it reached approximately 400 ppm, indicates the problem may not be attributed to the test equipment. This unexpected fluctuation in CO 2 concentration levels highlights a major disadvantage in using CO 2 as an indicator for a b   [4] whereby a lag of approximately 20 min was found between occupancy levels and CO 2 concentration levels, with changes in occupancy levels preceding changes in CO 2 concentration levels by that lag time. This highlights several considerations that need to be considered when using CO 2 concentration as an indicator for occupancy, unlike WiFi counts. The multiple regression model showed that CO 2 concentration levels and WiFi counts combined could explain 79.2% of the variability in the number of occupants. This is only slightly higher than the 70.3% of the variability explained by the number of WiFi counts alone, suggesting the use of WiFi counts can adequately account for occupancy.
Research studies [43][44][45] are showing how aspects of a building's performance such as energy and indoor air quality (IAQ) are intricately linked to its occupancy. This makes learning about a building's occupancy patterns a priority to explain the variations in its performance. There is also a need to decrease a building's energy consumption by minimizing wasteful energy practices, thus the need to link buildings' lighting and HVAC systems to its occupancy and usage. Advances in BMSs allow for this linkage, providing several opportunities for reducing buildings' energy consumption. Real-time data about occupancy patterns, therefore, allows building operators to control IAQ parameters (e.g. temperature, air velocity) at the room level and adjust them based on the occupancy of each room. This ensures that occupants' comfort is only met on an as-needed basis and that HVAC systems are not operating wastefully.

Conclusion
Although CO 2 sensors can help building operators provide demand-controlled HVAC, they are expensive to install and maintain. Results of this research showed that WiFi networks can be used instead to analyze occupancy at a higher level of accuracy and minimal cost. Although this research was the first to use both CO 2 concentration and WiFi counts simultaneously as indicators for occupancy, their application to just one classroom and over just one week made it difficult to generalize the research study's conclusions, thus the need to widen the application to include more rooms over a longer period of time and to more locations. Moreover, while using WiFi counts may make sense in institutional and university buildings, it may not be an accurate indicator of occupancy in other buildings where a smaller percentage of occupants would be typically connected to a WiFi network.
The use of WiFi counts as an indicator for occupancy could also provide other benefits to facility managers in institutional buildings. For example, data regarding occupancy patterns, which is not always readily available, may be obtained through WiFi counts which help with calculating space utilization rates. This advantage becomes very useful in campus buildings where university planners are always required to meet the increasing space demands within limited campus spaces. Future research should focus on developing technologies to streamline communications between the WiFi network and BMS. Future research should also focus on investigating how that would impact IAQ, in particular thermal comfort and occupants' satisfaction. There is also a need to quantify the energy savings realized by integrating demand controlled HVAC systems which rely on WiFi counts data. The consistent pattern of daily WiFi counts shown in this research suggests it can detect occupancy more accurately at the building-level and yield significant savings in terms of energy efficiency and operational costs.