## 4 Hardware Design  
In this section, we will discuss the significance of customizing the nodes and gateway for the required application. The customization assists the researchers to utilize the nodes according to their requirements. In the initial stage of the customization, the primary parameter that needs to be considered is power consumption, because the sensor nodes are placed at such a location where the additional electrical system is a bit challenging. So, the components which are chosen for the customization need to be low power. With concern to low power, we have chosen the LoRa communication protocol for the sensor node, as it delivers long transmission with low power consumption, and we have chosen 2.4 GHz-based ZigBee for communicating the data to the short-range activities. SX 1278 based LoRa module is utilized in our sensor node and its operating voltage is around 1.8 V to 3.6 V.  
Another main component of to design node is the controlling unit. The controlling unit in the node is utilized for processing the acquisition data and alerting the communication unit to send the sensory information. Here we have chosen the Atmega 328P microcontroller, as it is low power 8-bit microcontroller that is based on reduced instruction set computer (RISC) architecture. This controller comprises 6 analog and 14 digital pins with an operating voltage range of 2.7 V to 5.5 V. As we can observe that the SX 1278 based LoRa and Atmega 328P microcontroller is having different operating voltages, however, the voltage converter in the circuit of the sensor node converts the appropriate voltage. After the completion of selecting appropriate components for designing the node, the next stage involves assembling all of these components on a single board to execute a scalable, stable, and compatible node. The following are the block diagram, printed circuit board (PCB) layout, and hardware prototype of the detection end device, monitoring end device, safety operation controller, and LoRa gateway. Monitoring End device section  
The detection end device senses the various environmental parameters of the pipeline. 2.4 GHz-based ZigBee is integrated for transmitting the sensory data to the monitoring end device and safety operation controller, as discussed in the above section. Corrosion is a major issue during oil pipeline transportation. So, detection of internal and external corrosion is very essential. Leakage for a pipeline is a common issue, but in oil transportation in the pipeline, if leaks happen, it creates environmental issues and human loss. So, detecting and locating the leaks is mandatory. Figure 6(a) presents the interfacing of the different components. Figure 6(b) presents the PCB layout of the detection end device, where it presents a schematic view of the final prototype. Figure 6(c) presents the final hardware prototype of the detection end device, where the ZigBee communication protocol is visualized along with a liquid crystal display (LCD). A safety operation controller is a unique system that is integrated into the proposed architecture. In case of any abnormal issues such as fire emission, corrosion and leakage, the signal will be received through a 2.4 GHz-based ZigBee protocol from the detection end device. To alert the authorities, a hooter with a driver is integrated on the board. It consists of a power supply circuit where supply is given to wireless RF controller and hooter driver and hooter, as shown in the Figure 8a. Figure 8b presents the PCB layout of the detection end device, where it presents a schematic view of the final prototype. Figure 8c presents the final hardware prototype of the safety operation controller, where the hooter, ZigBee, and controller are visualized. In this study, the LoRa based gateway is implemented for communicating the real-time data of the monitoring end device and detection end device to the cloud server. This gateway is integrated with LoRa and Wi-Fi module for initiating the communication between the end devices and cloud server.