## 5 Hardware Design  
In this section, we discuss the requirement of customizing the hardware for the fire and safety application in the building. The customization enables the researcher to design and develop the hardware according to the requirement and application. Generally, to design any hardware node, the main component to be examined is energy consumption. Figure 5: Hybrid 2.4 GHz RF Modem and LoRa Based Architecture for Fire and Safety in the building. The energy consumption is analyzed because the hardware nodes are deployed in the outdoor environment where they are dependent on a battery. So, each component that is integrated onto the hardware board needs to consume low energy during active and sleep states. To achieve this target, the first component we selected was the 2.4 GHz-based Zigbee and LoRa communication protocol, as both consume low energy during transmission of data. Another major component is the computing unit; the computing unit processes the sensory data from the embedded sensors. As the complexity of processing the data is low, we chose the ATMEGA328P controller unit. Moreover, the components chosen for building the hardware have a different operating voltage, so to supply the appropriate voltage, we need a power convertor. A detailed description of the four components that are integrated with the proposed system follows. _The end device_ senses the parameters of fire including smoke, fire, temperature, and gas and communicates to the evacuation path display controller, safety operation controller with the 2.4 GHz based Zigbee, and to the gateway via LoRa, as shown in Figure 6a. Smoke and flame sensors are employed to sense smoke and fire. A gas sensor is integrated for detecting gas leakage, which can also cause a fire explosion in the building. All these sensors are integrated into the controller board, where the signal optimization is processed. The power supply circuit supplies the external power to the components presented in the node. Figure 6b presents the final hardware prototype of the end device, which visualizes the hardware that will be positioned in the building. A liquid crystal display (LCD) is integrated on the end device hardware to display the sensor values. The _evacuation light-emitting diode (LED) display_ is used to a display safe route during a fire emergency. It will guide people though the safe exit path by displaying the appropriate direction. Figure 7a presents the block diagram, which provides the details of interfacing the different components to the controller board. To visualize the safe path, a matrix LED is integrated along with drivers. Moreover, it is integrated with 2.4 GHz-based Zigbee communication to receive the sensory data from the end device. The received sensor data are analyzed, and if a fire is detected, it displays a safe evacuation path on the LED matrix display. The hardware prototype of the evacuation LED display is illustrated in Figure 7b. The _vision node_ was developed based on Raspberry Pi with a Pi camera, and it is shown in Figure 8a,b. A properly designed vision node assists to monitor the realtime condition of the environment during fire accidents. It works seamlessly even in power failure as it operates via battery. It also helps to visualize the density of people to be evacuated. Figure 6: Components and Hardware Prototype of the END Device. (**a**) Components of End Device (**b**) Hardware Prototype of End Device. The _safety operation controller_ acts according to the sensor data received from the end device regarding fire, smoke, and gas, and the block diagram of the safety operation controller is shown in Figure 9a. This controls the sensor value, if the received sensor value signals a fire, then the sprinkler connecting to the controller is switched on. A fire sprinkler system is an active type of fire protection system that discharges water in the event of a fire. Automatic sprinkler systems are often considered the most significant component of a building's fire protection strategy.