## 2 Case Description
### Hardware and Software Architecture  
WSN technology was chosen partly because it enables hot-plugging of new sensors into the network. This is an important aspect that supports the discussion below on the robustness and simplicity of the WSN technology. For the WSN topology, the choice was between a mesh layout, which would give great flexibility, and a star layout, which brings simplicity. We chose the latter. The wireless communication protocol, Zigbee, was applied because of its openness and energy efficiency, although a fully open protocol might be preferred.  
Libelium's Waspmote sensor platform formed the foundation of the setup, selected for its modularity, which made it possible to build custom nodes for specific purposes. The possibility of configuring the final solution for energy efficiency was another major factor in this choice. The experimental setup consisted of three different types of node, all provided by Libelium Comunicaciones Distribuidas S.L., Zaragoza, Spain, (each designed for a specific purpose), a signal amplifier, and damper actuators to control the airflow.  
Central Node: The central node creates the wireless network, constituting a router for message-passing and for recording data from the network in a persistent local storage. Moreover, the central node enables online access and remote control. The central node selected for this experimental setup was the Meshlium ZigBee-PRO-AP, (Processor: 500 MHz (x86); RAM memory: 256 MB (DDR); Disk memory: 8 GB; System: Linux, Debian; OLSR mesh communication protocol; Security authentication: WEP, WPA-PSK, HTTPS and SSH access).  
Sensor Nodes: The sensor nodes were to monitor the CO\({}_{2}\) concentration in each flat and send the data to the coordinator node. The proposed system contained 18 sensor nodes (one in each flat). The main components of the nodes were: Waspmote ZigBee PRO, Gases Sensor Board v2.0, and CO\({}_{2}\) sensors. Furthermore, each node had a 6.6 Ah battery and 2 GB SD card. For experimental purposes, each node was to be powered from the electricity grid as a backup.  
Control Node: The control node (Waspmote ZigBee PRO) receives commands from the central node and adjusted the supply and exhaust damper positions (and thus air flows) by means of two actuators (Belimo TF24-SR, BELIMO Holding AG, Hinwil, Switzerland). The voltage range given by the control node is 0-3 V and the actuators require a signal from 0-10 V, so an amplifier was needed. For this purpose, a programmable relay (Siemens LOGO! Siemens AG, Munich, Germany) was used, which is already a part of the building's inventory.  
Sensors: TGS 4161 solid electrolyte sensors, Figaro USA, were selected as the CO\({}_{2}\) sensors, with a range of 350-10,000 ppm and an accuracy of \(\pm\)20% at 1000 ppm. Their response time for accurate measurements is 1.5 min. The following equations describe how the voltage measured by the TGS 4161 sensor can be converted to gas concentration (ppm):  
\[\text{delta\_emf}=(\text{baseline}-(\text{volt}/\text{gain}))\times 1000 \tag{1}\]  
\[\text{ppm}=\text{pow}(10,((\text{delta\_emf}+158.631)/62.877)) \tag{2}\]  
where: baseline is the voltage at 350 ppm, gain is the calibrated gain of the sensor, and volt is the output voltage of the sensor.  
In the case, all the sensors were tested and calibrated in parallel with a highly accurate and calibrated CO\({}_{2}\) sensor.  
Software: The software applied was the open-source electronic prototyping platform, Arduino [20], which collected the measurements, computed the control values for the ventilation, and communicated them to the actuators. As mentioned above, the wireless communication was based on the Zigbee protocol [21]. From the router to the IP network, standard internet protocols were applied.