RAPID INTERNET OF THINGS (IOT) PROTOTYPE FOR ACCURATE PEOPLE COUNTING TOWARDS ENERGY EFFICIENT BUILDINGS

SUMMARY: According to the U.S. Department of Energy, a significant portion of energy used in buildings is wasted. If the occupancy quantity in a pre-determined thermal zone is aware, a building automation system (BAS) is able to intelligently adjust the building operation to provide “just-enough” heating, cooling, and ventilation capacities to building users. Therefore, an occupancy counting device that can be widely deployed at low prices with low failure rate, small form-factor, good usability, and conserved user privacy is highly desirable. Existing occupancy detection or recognition sensors (e.g., passive infrared, camera, acoustic, RFID, CO 2 ) cannot meet all these above system requirements. In this work, we present an IoT (Internet of Things) prototype that collects room occupancy information to assist in the operation of energy-efficient buildings. The proposed IoT prototype consists of Lattice iCE40-HX1K stick FPGA boards and Raspberry Pi modules. Two pairs of our prototypes are installed at a door frame. When a person walks through this door frame, blocking of active infrared streams between both pairs of IoT prototypes is detected. The direction of human movement is obtained through comparing occurrence time instances of two obstructive events. Thus, the change in occupancy quantity of a thermal zone is calculated and updated. Besides, an open-source application user interface is developed to allow anonymous users or building automation systems to easily acquire room occupancy information. We carry out a three-month random test of human entry and exit of a thermal zone, and find that the occupancy counting accuracy is 97%. The proposed design is completely made of off-the-shelf electronic components and the estimated cost is less than $160. To investigate the impact on building energy savings, we conduct a building energy simulation using EnergyPlus and find the payback period is approximately 4 months. In summary, the proposed design is miniature, non-intrusive, ease of use, low failure rate, and cost-effective for smart buildings.


INTRODUCTION
In the United States, the annual amount of energy to heat, cool, and ventilate buildings is huge -equivalent to 13 quadrillions British Thermal Units (BTUs).Most of this energy is wasted when buildings are completely unoccupied or run under the default levels of heating, cooling, and ventilation.Normally, the default levels of heating, cooling, and ventilation are supposed to meet the need for the maximum occupancy capacity.Occupancy number detection or recognition has great potential to drastically reduce the energy consumption and utility bills of buildings (Jain, 2016).Based on real-time occupancy information, it is estimated that adaptive heating, cooling, and ventilation reduce building energy consumption by up to 30%.Nowadays, miniature environmental sensors have been widely deployed in buildings.Although environmental parameters such as carbon dioxide or moisture level provide an implied indication of the human presence or occupancy quantity in a building zone, it is very difficult to extract a highly-accurate occupancy number with low failure rates in real time.Image/video capture technology, radio frequency and radar systems suffer from high implementation cost and inaccuracy.Even though many studies have been conducted to investigate whether CO2 sensors can accurately reflect the occupancy quantity.Unfortunately, it is concluded that long diffusion time and transient airflow patterns within a building severely degrade the occupancy detection sensitivity using CO2 sensors (ARPA-E Program Report, 2018) (Maripuu, 2009) (Jin, 2105).In addition to remarkable energy savings, real-time occupancy monitoring can also enhance building safety (Cheung, 2018) (Ciftler, 2018).For example, safety-critical buildings (such as shopping malls, museums, or restaurants) often requires maximum occupancy regulations to prevent over-occupancy.If a fire occurs when the actual number of occupants exceeds the maximum allowable number, people cannot leave in a safe time.In this scenario, if accurate live occupancy detection or recognition is realized, audio, visual, or text alerts can be triggered once the maximum occupancy level is reached.
Recently, according to U.S. Department of Energy (DOE), next generation of the smart building requires significantly more intelligence with the capability of real-time counting exactly how many people are inside a thermal zone.Real-time occupancy counting has a big impact on dynamic adjustment in operating parameters and set points of heating, ventilation and air conditioning (HVAC) equipment.Particularly, demand-driven HVAC control heavily depends on occupancy detection to provide "just-enough" heating, cooling and ventilation levels to users.For example, through proper control of a variable air volume (VAV) box, demand-driven ventilation regulates the right amount of fresh air needed by the occupants into a space.Based on the real-time number of occupants, good indoor air quality is achieved without excessive energy consumption.However, existing occupancy sensor systems are limited in their ability to meet such accurate detection or recognition need.To support this property, it is imperative to develop new sensor system architectures to improve counting accuracy, reliability, and usability with strict constraints of implementation cost and system size.With evolutions of the Internet of Things (IoT) technology (Jin, 2014) (Zanella, 2014), it is possible to develop a standalone IoT platform, in which a great number of signal processing and data computation can be run locally without any assistance from a cloud or central server.Existing occupancy detection or recognition systems have many drawbacks, such as low accuracy, poor adaptivity, inadequate privacy protection, expensive calibration and maintenance.Existing occupancy detection or recognition systems usually collect considerably rich and diverse data (such as CO2, humidity, temperature) that detail what is happening in a building zone.Then, statistics-based features are identified and extracted from a cloud or central server.Despite promising results that have been reported in a few case studies, a set of statistics-based features and parameter values, which are appropriate for a building, usually cannot be used for other buildings due to feature changes in different and uncertain building environments.Even though machine learning has looked into processing these raw sensor data, yet, existing machine learning methods have limitations in non-stationary environments, and suffer from large occupancy counting errors (Zheng, 2014).As will be reviewed and described in Section 2.2 and Table 3, modern machine learning algorithms result in occupancy counting errors exceeding 10%, which do not meet the accuracy requirement of U.S. Department of Energy (DOE).
In this work, we address the design challenge of next-generation occupancy number detection or recognition systems.In the proposed IoT prototype, personnel entry and exit to a building zone are detected and monitored by an innovative active infrared approach, whose output is considered as a good estimation of occupancy quantity.Raspberry Pi modules are connected with our developed active infrared FPGA boards to provide voltage supply and Wi-Fi access.A user interface is developed to allow building automation systems or anonymous customers to online track the real-time room occupancy information.Since all the processes of data acquisition, computation, and communication are performed in the proposed IoT prototype, our solution is self-contained.Because high computational-complexity machine learning algorithms are not executed in our IoT prototype, no cloud or central server is required.The entire IoT prototype is easy to install and does not require extra costs for commissioning and maintenance.Thanks to the built-in Wi-Fi server, wireless data communication of our IoT prototype does not depend on existing Wi-Fi infrastructures in deployed buildings.This feature enables our system to be applicable in various structures and ages of buildings.Moreover, built-in Wi-Fi enables remote system maintenance, commissioning, calibration, and upgrade.Since our IoT system does not track the identity or location of each building occupant, user privacy is well preserved.Our entire design is in a total dimension of 7.4 inches × 4.6 inches and less than 160g, hence, it is miniature and lightweight.All software codes (i.e., Linux operating system and signal processing algorithms) are stored in a micro-SD card of Raspberry Pi 3 module.Therefore, the whole design is portable and easy to duplicate for mass production.To our best knowledge, this is the first intelligent IoT sensor platform dedicated to accurate occupancy counting towards energy-efficient buildings.The entire system is scalable, flexible, easy to use or upgrade, robust, accurate, non-intrusive, secure, low power, and cost-effective.
To validate the benefits of energy savings in occupancy-based building operation, simulation is carried out with the aid of EnergyPlus, which is an open source building energy simulation engine released by the U.S. Department of Energy.Using a university auditorium as a thermal zone example over a one year period, 12% of electricity savings is realized when deploying our proposed IoT design for occupancy awareness.The estimated payback period is approximately 4 months, which indicates a cost-effective investment and it is affordable for building owners.
This paper makes the following contributions: (1) we propose a new methodology for non-intrusive and highaccurate room occupancy counting towards energy-efficient building applications.Compared with existing occupancy detection or recognition sensors (i.e., passive infrared, camera, acoustic, RFID, CO2) and complex machine learning algorithms, the proposed infrared-based detection scheme achieves a higher detection accuracy.
(2) In order to implement and test the proposed idea, we have developed an IoT prototype system using off-theshelf electronic components and an open-source user interface.This IoT prototype is self-contained, and easy to use, and cost-effective.As this research focuses on advances in real-time accurate building occupancy counting, recent developments in both industry and academia have been studied and reviewed.Many types of sensors have been used to detect room occupancy information (Labeodan, 2015) (Akkaya, 2015) (Huang, 2017).The advantages and disadvantages of these existing techniques are summarized in Table 1.The output of a passive infrared (PIR) sensor is binary and therefore it is conventionally used to detect human presence instead of providing an accurate number of occupants (Lam, 2009) (Agarwal, 2010).Radio-frequency identification (RFID) or wearable technology is proven for coarsegrained occupancy monitoring.However, since each RFID tag is associated with a particular person, privacy and security are the primary concern (Lee, 2008) (Li, 2012).Occupancy monitoring using ultrasonic approach is presented (Shih, 2015) (Shih, 2016).However, several drawbacks are associated, such as difficulty in calibration and coordination.Speech recognition and acoustics are potential techniques for predicting the occupancy information of buildings (Uziel, 2013) (Kelly, 2014) (Huang, 2016).Audio-based occupancy processing is not expensive, because basic required hardware resources consist of only microphones and microcontrollers.Yet, acoustic detection is rarely used for independent occupancy detection, since (a) non-human source sound waves from a building can trigger error detection, and (b) detection fails when someone is occupied in an HVAC zone but no sound.Therefore, acoustic-based occupancy detection is more accurate in a quiet office than a noisy supermarket or restaurant.Video or image cameras are also used to monitor building occupancy information (Erickson, 2009) (Benezeth, 2013) (Ahmed, 2013).However, due to the limitations of the line of sight, cameras cannot be placed in any position.High hardware cost and user privacy issues have severely hamper ed its widespread deployment.Wi-Fi probe request signal has been used to predict indoor occupancy information (Zou, 2017) (Ciftler, 2018).When using Wi-Fi probe request to compute the occupancy number, Wi-Fi network is required in buildings.This is not guaranteed in practice.Besides, each occupant needs to always carry a Wi-Fi device.If an occupant leaves their Wi-Fi device (such as a mobile phone) on a table in an office, but he/she goes to other places, the Wi-Fi probe request method will still estimate this occupant in this office.Room occupancy estimation errors arise in this case.Carbon dioxide levels predict room occupancy as a result of a linear relationship between the level of carbon dioxide and the number of inhabitants in a space (Sun, 2011) (Nassif, 2012).Even if the low-cost and non-intrusive, the level of carbon dioxide fluctuates with the HVAC operation, such as passive ventilation, unpredictable doors and windows open, locations of sensor placement, so an exact relationship between CO2 level and occupancy information varies case by case.Moreover, when an occupant leaves a room, the CO2 concentration remains constant for a long time, which reduces the sensitivity of occupancy detection.

Existing building occupancy detection or recognition mechanisms
Researchers also present to use hybrid environmental sensors to improve the detection accuracy.For example, the design utilizes CO2 and light sensors in a micro-scale wireless sensor module (Huang, 2017).In 2012, a combination of sensors including CO2, humidity, light, sound, and motion was implemented and tested for the occupancy monitoring performance (Yang, 2012).In 2016, Intel implemented an IoT-enabled smart office building, where 9,000 sensors are used to track and optimize building information, such as temperature, lighting, energy cost and room occupancy (Khandavilli, 2016).Despite its great potential to improve the building occupancy number through studying the cross-correlation of multi-sensor data (Kumar, 2016) (Das, 2017), it is a design challenge to extrapolate useful features of occupancy counting from original rich sensor data.Much useful information for determining occupancy characteristics is hidden or not easily discovered.Most existing sensor systems use extracted statistical features to analyze raw sensor data.Although promising results have been reported in a few buildings, the same features cannot be used in other buildings because of the dramatic changes in human behavioral characteristics in diverse and uncertain building environments.The reported accuracies of these above occupancy detection methods will be summarized in Table 3, where the accuracy of the proposed design will be compared with these existing works in Section 4.3.Therefore, it is necessary to develop direct non-intrusive monitoring platform for accurate building occupancy counting, instead of relying on computationally-intensive multimodal signal processing algorithms.Using an ultra-low power device to design a proper IoT system to meet these stringent requirements is the focus of this project.Machine learning (or deep machine learning) algorithms have been presented to process sensor data for building occupancy monitoring.Figure 1 illustrates the processing flow of generic machine learning techniques for room occupancy detection.A set of features is manually extracted by designers in machine learning algorithms, while deep machine learning automatically grasps the relevant features required to solve a problem.In (Yang, 2012), using a radial basis function (RBF) neural network, the cross-estimation tests produce an accuracy of 66%.In

Hybrid Sensors
another study (Javed, 2017), a random neural network model was developed to understand the relationship between occupancy level and CO2 concentration, room temperature, and humidity, where the reported occupancy accuracy was 87.4%.In (Ekwevugbe, 2013), a low-cost and non-intrusive sensor network was deployed in an office.The selected multi-sensory features were found using a neural network with up to 84.6% of the estimated accuracy.In (Candanedo, 2016), the researchers studied three different statistical classification models for occupancy detection using light, CO2, temperature, and humidity data.The accuracy of occupancy detection was found between 95% and 99%.However, their study is only limited to checking whether an office is occupied, instead of occupancy quantity.In (Raykov, 2016), a PIR sensor was combined with machine learning algorithms to estimate occupancy.Based on a microprocessor and a PIR sensor, a machine learning model was presented to run occupancy estimation algorithms in (Leech, 2017), where statistical regression model is used to fit the measured PIR sensor data.This work validates the feasibility of running machine learning algorithms on an IoT platform.A recent study (Ortega, 2015) has pointed out that neural network tends to produce noisy and unstable results over time.This is because these machine learning models treat training data as independent, thus ignoring the cross-correlation of multisensor data.
From the above discussion, existing occupancy detection or recognition mechanisms and data processing algorithms cannot fully meet the rigid requirements of next-generation occupancy number detection or recognition systems for smart buildings.To address these challenges, we investigate and develop an active infrared based IoT prototype for real-time occupancy counting with high accuracy and low failure rate.In this work, the proposed IoT design does not employ any machine learning techniques, but it provides an effective hardware platform to run machine learning algorithms in the future.Machine learning algorithms can be executed on the FPGAs and Raspberry Pi 3. In the next section, details of design considerations and system implementation are elaborated.

SYSTEM DESIGN AND IMPLEMENTATION
Figure 2 depicts the overview of our system deployment and interaction with a building automation system.In the buildings we studied, HVAC equipment and user graphical interface are purchased from Johnson Controls, which is a leading manufacturer and supplier of HVAC equipment and BAS tool.The right side of Figure 2 shows a snapshot of the BAS user interface provided by Johnson Controls.In general, BASs from other companies ( e.g., Honeywell, Siemens) are also applicable to our proposed people occupancy counting system, which is illustrated in the left side of Figure 2. A BAS tool connects, controls, and monitors the operation of various HVAC devices and sensors, enabling them to deliver and share information based on a dedicated communication protocol.So far, the communication protocol mostly used for BAS tools is the BAC net (Building Automation Controller Network).In addition, because a BAS tool typically supports data communication with the Internet, building operators can remotely access BAS to control its connected HVAC devices and sensors from anywhere in the world via the Internet.As shown in the right side of Figure 2, the user graphical interface usually provides real -time information on HVAC operation status, such as CO2 level setpoints, zone pressure, discharge air pressure and temperature, real-time temperature values, humidity, and air flow rate at some point of interest.This information allows building operators to quickly check the status of HVAC devices and respond immediately alerts for system failures.Passive infrared occupancy sensors are often used in conjunction with a wireless adaptor, which enables wireless communication between these occupancy sensors and a BAC network.By sensing the triggering events that occur in infrared streams, a BAS tool can obtain room occupancy count information, and then make decisions to optimize the control of heating and cooling systems within a building, providing optimized occupant comfort and energy efficiency.In this work, two kinds of modules (i.e., Raspberry Pi 3, and infrared FPGA boards) are installed in the entrance/exit door of an HVAC thermal zone.Two pairs of active infrared FPGA boards are set up near the door frame to monitor real-time doorway traffic, whose information is sent to Raspberry Pi modules via cable connections.A built-in Wi-Fi server, which is embedded in Raspberry Pi modules, enables wireless data communication with its related building automation system (BAS).It is an attractive property to establish a builtin Wi-Fi server in the proposed system.Thus, data communication does not depend on existing Wi-Fi infrastructures in a building.With this Wi-Fi server, the building automation system (i.e., on the right side of Figure 2) or building users/owners can easily access real-time occupancy information in this HVAC zone.Since all data acquisition and communication are performed locally, this proposed IoT prototype is self-contained and hence no cloud or server computation is needed.The entire design is easy to install by users and does not require labor costs for commissioning and maintenance.In our proposed building occupancy counting system, we the data in a database for on-demand delivery by a BAS tool.For example, we used a website database called ThingSpeak to record and visualize the raw sensor data for BAS tools.When the sensor data is set to update no less than every two minutes, ThingSpeak provides a free account.Since our infrared sensor output is updated only when someone walks through the door, it usually meets the two-minute requirement.
Figure 3 illustrates how the proposed IoT system operates.An infrared receiver (i.e., RX) FPGA board and an infrared transmitter (i.e., TX) FPGA board are needed on each side of a door opening.Therefore, two TX boards and two RX boards are attached to the left and right sides of a door fra me, respectively.Powered by a long-life battery, each TX board transmits an infrared stream towards its aligned RX board.In this way, two independent infrared streams are established in parallel.Each RX board keeps a cable connection with a Raspberry Pi 3 module.When an object (e.g., a person) walks through this door opening, infrared streams are blocked and interrupted by this human body.Once a signal blocking event is detected by an RX board, the blocking event and its occurrence time will be notified to a Raspberry Pi 3 module via cable connections.The moving direction of an occupant can be determined by comparing the occurrence time of events reported by two RX boards.Then, the Raspberry Pi 3 module calculates and updates the real-time occupancy quantity, which is instantaneously observed by building automation systems or building owners/users.When someone hovers in a doorway but does not enter a room, our system will not count in this event, because the time difference between two trigger events is not realistic short.We also configure an internal timer of the FPGA board to avoid detection error occurs persist over time.In fact, when a detection error occurs for a certain period of time (e.g., 5 minutes), our proposed system will be reset to eliminate the accumulation of detection errors.

Figure 3. The Concept of Proposed IoT Prototype with Highlighted Key Components
The required logic and control functions are implemented in a field-programmable gate array (FPGA) evaluation kit offered by Lattice Semiconductor.This evaluation kit mainly includes a Vishay TFDU4101 IrDA transceiver (which can be configured as a transmitter or receiver by FPGA logic and control functions), a 12MHz MEMS oscillator, an iCE40HX-1K FPGA chip, and an FTDI 2232H USB chip.Besides, there is an integrated development environment (IDE) and bit-stream generator offered by Lattice Semiconductor.As a result, this hardware evaluation kit is easy to use for rapid prototyping of our IoT design.Figure 4 shows electrical diagrams of the proposed design, where an infrared transmitter and receiver are configured for TX and RX boards, respectively.The Raspberry Pi module that is connected to a TX board only provides voltage supply and does not establish a built-in Wi-Fi service.The hardware installation and setup procedures are briefly described as follows.First, RX infrared FPGA boards are connected to the Raspberry Pi modules that are configured to execute RXrelated functions.To do this, the FPGA board that is intended to be placed on the outside of a door opening (where people walk in) is attached either directly or through an extension cord to the bottom right port that is facing towards the Raspberry Pi module.The FPGA board that is intended to be placed on the inside of a door opening is connected to the upper right port that is facing towards the Raspberry Pi module.Second, TX infrared FPGA boards are connected to the Raspberry Pi modules that are configured to execute TX-related functions.Third, RX and TX FPGA boards are aligned as best as they can to maximize the stream detection sensitivity.

Figure 4. Electrical Diagrams of the Proposed TX and RX boards
In addition to low-cost and reliable hardware development, software algorithm and user interface design is also indispensable, because they strongly promote data collection, signal processing, and user interface.In our design, a user interface has been developed to allow anonymous customers to track room occupancy information.The real-time building occupancy quantity is visualized in the user interface software.Our developed software codes and user interface are open-source and free to download from (https://github.com/nickwhetstone/DAC-IOT-SIUC).In our IoT prototype, all the codes for system configuration are stored in a micro-SD card.Customers only need to insert this SD card into the SD slot of Raspberry Pi, so no prerequisite knowledge about programming is required for users.A node.js server is implemented inside the Raspberry Pi, thus, a built-in Wi-Fi service is offered.
In our design, users do not have to know about Wi-Fi server settings.They can access Wi-Fi service by opening a web browser and visiting any ".com"URL.The operation details for checking the status of occupancy number on a mobile phone will be demonstrated in the proof-of-concept five-minute video in the link (https://sites.google.com/site/chaolushomesite) in Section 4.1.Overall, this design is user-transparent, easy-to-use, low-cost, low-power and high-accuracy for smart buildings.User transparency is attributed to small system dimension and light weight, which is 7.4 inches × 4.6 inches and less than 160 grams, respectively.As shown in the demonstration video, the developed user application interface is easy to use without any programming or networking knowledge.As will be shown in Table 2, the total cost of an entire system is $158, which is lower than the expected cost defined by the U.S. Department of Energy (ARPA-E Program Report, 2018).The entire system is implemented using low-power electronics, so the IoT system can be battery powered and have a long lifetime.
As will be discussed in Section 4.1, the average occupancy detection accuracy is approximately 97%, which outperforms existing approaches in the literature.

EXPERIMENTAL RESULTS
In this section, it is more appropriate to arrange cost savings estimates after system implementation and experimental results, because when using the EnergyPlus simulator for cost savings estimation, we need to first demonstrate that the proposed infrared occupancy counting system is operating as expected.Then, we will collect the average occupancy detection accuracy from the experimental results.This averaged accuracy will be used for cost savings estimation.Otherwise, if we run cost savings estimation before system implementation and experimental results, we don't know the average accuracy, so we cannot input proper parameter values in EnergyPlus simulator.Furthermore, if the proposed infrared occupancy counting system does not work at all, the design fails, so it is meaningless to study its cost savings performance.

System implementation and experimental results
The proposed IoT prototype has been implemented and experimentally validated.Figure 5 shows the system view and user interface on a mobile phone.Our entire design is in a total dimension of 7.4 inches × 4.6 inches and less than 160g.Figure 6 shows the experimental setup and testing implementation in an office building.When the proposed system detects a person entry or exit from this office, it transmits such a triggering event to the Raspberry Pi 3. A proof-of-concept five-minute video demonstration was also recorded and the access link is (https://sites.google.com/site/chaolushomesite).As demonstrated in this video, after a person walking through the door frame, when observing the user application interface on the mobile phone, it is found that the number of occupancy increases or decreases by one according to the direction of movement of this person.This video shows the user application interface is easy to use and it can immediately reflect changes in the room occupancy count.Similar to the on-site testing in the demonstration video, we have conducted a four-week measurement to evaluate the occupancy counting performance and found the detection accuracy is approximately 97%.The 3% failure rate is caused by the temporal noise or random interference from ambient environments.This problem is expected to be mitigated by using a robust custom circuit board to improve system reliability and noise immunity.The proposed IoT prototype is completed made of off-the-shelf hardware components with an estimated cost about $158, as shown in Table 2.This cost is affordable and cost-effective.This system provides a proof of concept for basic FPGA implementations of considerably smaller size, less than 1000 Look-Up Tables for the Internet of Things applications.We found that 14.8% of TX and 15.2% of RX FPGA resources have been utilized to realize logic and control functions.That means more than 80% of FPGA logic resources are available to extend other functionalities, such as advanced encryption standard (AES) encryption for enhanced communication security.
Here AES stands for the advanced encryption standard in data communication security.AES has been adopted by the U.S. government and is now used worldwide.As shown in Fig. 2, our proposed IoT system wirelessly communicates with a building automation system (BAS).Recent research has found that Internet-connected HVAC systems have flaws of being vulnerable to hacking and attacks (Peacock, 2014) (Jones, 2017).While HVAC data is generally not considered to be highly sensitive data, unsure Internet connection makes HVAC systems vulnerable.Without proper security protection, data communication from the Internet (i.e., Wi-Fi wireless connection in Figure 2) to HVAC systems is prone to distributed denial of service (DDoS) attacks, which are overwhelmed by data from many separate computers simultaneously.The inclusion of AES in our proposed IoT prototype helps ensure advanced data security to avoid DDoS attacks, and protects data to be transferred reliably and securely over Internet networks to reach HVAC systems.

Energy saving estimation using EnergyPlus simulator in a VAC HVAC building
To estimate long-term energy savings resultant from occupancy-driven building operation, we chose the HVAC thermal zone of university auditorium in the Student Services Building of SIUC campus and use its energy consumption as a baseline.The prerequisite knowledge for baseline calculation includes blueprints for original construction, historical energy bills, and current operating data in the building automation system.VAV HVAC equipment has been installed for this building.All useful data provided by the Physical Plant Engineers are imported into a design and analysis tool, EnergyPlus, which takes into account building envelope, windows, lighting, HVAC equipment, and weather condition.The weather data of Carbondale, Illinois are uploaded into EnergyPlus from a weather file.Since this building is a university auditorium, university staff knows what activities are organized and arranged with a roughly accurate number of occupants and the duration of activities.
Therefore, we used this information in the EnergyPlus simulations.In this study, we investigated the possible causes of this 3% detection error.After in-depth analysis and verification, we found that the 3% failure rate is caused by temporal noise or random interference/disturbance from ambient environments.This problem can be solved with a robust custom circuit board to improve system reliability and noise immunity.Since this 3% accuracy error is ubiquitous over time, rather than in a certain pattern or during a specific daily duration, we believe that modeling this 3% accuracy error as random occurs is sufficient, so the detection accuracy is flat as 97% during each day in a year.Therefore, there is no need to create a time-dependent occupancy schedule for EnergyPlus simulations.Assuming an average 97% of occupancy detection accuracy, simulation results for a one-year study show that the average electricity reduction of this auditorium is 12%.Specifically, when opening the IDF editor in the EnergyPlus simulator, there are some objects to configure for the class of "people".By default, dynamic building occupancy information is not used for HVAC control and operation.So we use the default number of people in the class of "people" to calculate the baseline result of energy consumption.In contrast, dynamic building occupancy information is used in occupancy-aware HVAC operation.Based on the actual number of room occupants, after considering an average accuracy of 97% in the occupancy count, we set the dynamic occupancy quantity in the EnergyPlus tool for simulations.By comparing the two EnergyPlus simulation results, we found that using our proposed infrared occupancy counting system can reduce the average power electricity consumption by 12% in one year.Given the electricity consumption of this auditorium is 80,000 kWh per year, a 12% reduction is equal to 9,600 kWh.Considering the electricity rate of the Carbondale campus is about 5 cents per kWh, the total electricity bill saving is $480 per year.As been mentioned earlier, since the proposed IoT prototype costs $158, the payback period is calculated to be approximately 4 months.The dynamic occupancy profile leads to a more prominent impact on HVAC operation than other energy sources (such as electricity in lifts and lighting).For example, lighting is ON when a room is occupied regardless of the number of occupants.Therefore, occupant presence or absence is a key control factor, and the lighting ON/OFF status does not change with the variation of occupancy number in a room.

Summary and comparison
Table 3 summarizes and compares the existing building occupancy detection methods in the literature.These prior approaches include using single environmental sensors, such as passive infrared, RFID, ultrasonic, CO2 sensors, acoustic, image camera, Wi-Fi probe request, and hybrid sensors.We compare them in terms of mechanism, cost, and accuracy of occupancy detection.Passive infrared and ultrasonic fail to count the occupancy quantity due to limitations of their detection mechanism.Other existing detection mechanisms result in a detection accuracy of no more than 90%, so they cannot meet the occupancy number detection requirements for next-generation smart buildings.While the use of multiple sensors is of great potential, it is not an easy task to handle multimodal signal processing due to useful information for determining occupancy characteristics is hidden or not easily discovered.This proposed work leads to higher accuracy without complex signal processing.No statistics-based machine learning algorithms are needed to be executed in our active infrared-based IoT prototype.

CONCLUSION
Energy-efficient demand-driven smart building has gained increasing attention for green and sustainable economics.As an emerging technique, Internet of Things (IoT) has a great potential to be widespread in smart buildings.This work presents the Lattice iCEstick evaluation kit as an open-source electronics platform to build an active infrared based occupancy counting system.This proposed design accurately counts the personnel entry and exit to a building zone.The estimated building occupancy count is sent to a Raspberry Pi, which supports wireless data communication with building automation systems or users.An open-source user interface has also been developed to facilitate data processing and visualization.The entire hardware and software design has been implemented and tested in this study.Experimental results show that the proposed design leads to an average counting accuracy of 97%.Furthermore, building energy simulation shows a significant impact of adopting this IoT prototype in a VAV HVAC thermal zone.12% of energy reduction is achieved and the resultant payback period is 4 months.In summary, our proposed IoT prototype is flexible, portable, easy to use or upgrade, robust, accurate, low-complexity, non-intrusive, and cost-effective.

FUTURE WORK
One limitation is that this proposed system does not handle well multiple people entering a space simultaneously.
To address this limitation, designers can try to adjust and set the appropriate threshold time interval of two infrared trigger events.For example, if the real detected time difference between two trigger events is longer than the defined threshold time interval, the system treats it as a multi-person entry activity.Another method of occupancy detection accuracy improvement is to use hybrid sensors (such as CO2, sound) and multimode data fusion to refine the detected occupancy number by the proposed active infrared sensors.The effectiveness of this hybrid method has been proved in our previous research and other works in the literature.
The biggest challenge in future work is to minimize the system size and cost.The current design consists of two Raspberry Pi 3 and four ICE40HX1K-STICK-EVNs. Looking at the current design, the system component with the highest cost is Raspberry Pi 3. The Raspberry Pi 3 does provide a way to connect the ICE40HX1K-STICK-EVNs with the world of IoT; however, only one Raspberry Pi 3 is necessary to implement the wireless network currently being used for the design.To reduce the system cost, future work will entail developing code on top of the TX node of ICE40HX1K-STICK-EVN that will enable the devices to continuously transmit infrared signals at successive time step interval, thus, eliminating the necessity of a redundant Raspberry Pi 3 to realize the signal transmission necessary for the people counting aspect of the overall design.This revision alone will save $35 in the design cost.An alternative path, or a path that may be taken after the first revision, is to remove the TX nodes all together.The system would make use of two ICE40 sticks that take the role of transmission as well as the signal reception.The ICE40HX1K-STICK-EVN would alternate between receiving a signal and replying to the received signal.The first stick to exceed the timeout period to wait for an acknowledgment from the other ICE40 HX1K-STICK-EVN is the device that detected either an entrance or an exit action occurring.This revision would cut the design cost in half, and is a viable way to work in the future.

Figure 1 .
Figure 1.Processing Flow of Generic Machine Learning Techniques for Room Occupancy Detection

Figure 2 .
Figure 2. Overview of Proposed System Deployment and Interaction with a Building Automation System

Figure 5 .
Figure 5. System View of an Entire Design Including a Lattice Evaluation Kit and a Raspberry Pi 3 module

Figure 6 .
Figure 6.Experimental Setups and Testing Implementation in an Office Building

Table 1 :
Comparison of Existing Building Occupancy Detection and Counting Methods

Table 2 :
The Proposed System Cost Breakdown

Table 3 .
Summary of Existing Building Occupancy Detection Methods