# Context-Aware Wireless Sensor Networks for Smart Building Energy Management System
## 4 Proposed EMS for SEEB
### WSN Nodes Components  
The journey of the WSN designed started with surveying WSN design and deployment methodologies. As a result, we concluded that the WSN design at higher abstraction levels facilitates analysis steps and resolves problems before deployment. The primary motivation for applying high-level-based approaches is that new applications can be created with less effort than in traditional approaches [17]. Hence, we went for the component modeling technique as it supports modeling the system because component-based modeling offers great abstraction by providing interface-based interaction between elements. We examine for each approach its modeling language, scopes, and elements. Additionally, after extensive investigation and analysis of WSN technologies dedicated to smart building, we opted for open source IoT platforms to implement the WSN data acquisition. As illustrated in the next (Figure 3A), the sensor node is composed of a passive infrared (PIR) module for motion detection, DHT11 module for temperature and humidity measurement, and an MC38 module for window/door status detection (open or closed). These modules are attached to the Arduino Nano v3.0 programming board, which is the IoT platform that handles processing tasks and runs the sensor's code. The sensor communicates data via an XBee Series 2 S2C radio frequency module.  
The WSN was deployed on the ground floor of one building. Figure 4 shows the network topological architecture; the WSN is implemented as a mesh topology where sensor nodes route data towards the gateway device (Figure 3C). This gateway links the WSN and the TCP/IP network to which the application server is connected. The command coming from the application server is forwarded to the appropriate actuator (Figure 3B) via the gateway. In this scenario, we used nine sensor nodes indoors with a voltage supply of 5 V. The wireless sensor nodes are XBee Series 2 S2C with a wire antenna. All nodes can be both sensors and routers using AODV routing protocol [18], and they belong to the same Personal Area Network (PAN) named BD07.  
The nodes forward sampled data to the ZigBee gateway, which forwards it to the application server. The performance evaluation of the network includes delay, distance measurement, packet loss, and throughput. We tested the network in low, medium, and high data rates. We created a full mesh network out of 10 nodes (nine nodes + one gateway). Six sensor/router nodes are located inside rooms, offices, and laboratories. Three routers were installed in the hall to route data to the gateway. All the ten nodes are configured as routers. These XBee nodes run the DigiMesh firmware that is based on ZigBee and AODV routing protocol. The EMS is designed to use sensors for data acquisition and equipment control; these sensors will eventually be deployed and managed by building operators. Therefore, they need to be energy efficient to reduce the cost in terms of battery  
Figure 3: Components of the Wireless Sensor Network (WSN) nodes in the data acquisition (**A**) Arduino nano and its components, (**B**) the installed actuator with the electric heater, (**C–E**) gateway devices.  
replacement and operator time in managing them. Additionally, they need to be reliable and handle data communication with the expected QoS. Therefore, there needs to be an evaluation of the following parameters: Energy consumption, network QoS, reliability, latency, and throughput. We should note that the sensor's limited resources constraint impacts security requirements such as encryption and key generation. Another constraint is that sensors should be accessible for remote configuration and maintenance.