# IoT-Enabled Gas Sensors: Technologies, Applications, and Opportunities
## 6 IoT-Based Wireless Gas Sensors
### Sensing Requirements for IoT-Based Gas Sensors  
The demand on IoT environments might change in compliance with the applications and their specifications. In general, IoT networks are known for their low energy consumption, low power transmissions, and reduced number of data transfer through the network. Besides, it is essential that the devices on the network can operate for long periods, generate precise data and communicate with other devices on the network. Other applications may demand real-time data acquisition, exhibition of the collected information to users, long-range communications, and battery-based devices [11, 12]. Figure 7: Optical gas sensor coupled with a duct with gas flow. The measurement of the target gas occurs by evaluating the differences of the generated wavelength and the received one, after passing through the gas on a pipeline. To attend to these characteristics, it is essential to choose correctly the sensing technology for these applications, as well as the network characteristics, in order to avoid energy loss with poorly selected protocols on the communication stack, starting with the Layer 2 protocols, attending to the communication requirements in terms of mobility, security, area of coverage, and energy consumption. For long-range communication, protocols such as Long Range Wide Area Network (LoRaWAN), SigFox, Narrowband IoT (NB-IoT), GPRS, and Long-Term Evolution for Machines (LTE-M) have been proposed in scenarios with low power consumption, some of those for low data transfer and other attending more frequent transmissions in short periods. These protocols are compatible with Internet Protocol (IP) networks, which allow M2M communications through high-layer protocols. For short-range communications, Bluetooth, Wi-Fi and ZigBee are the most common technologies proposed for sensors; energy consumption may limit the usage of some of these protocols in terms of IoT-enabled devices, as some devices should be able to operate on batteries for several years. Following the TCP/IP stack, the network layer protocol is dependent on the layer 2 protocol; in some cases, as the IEEE 802.15.4, it is necessary an adaptation protocol in between the layers 2 and 3, the IPv6 over Low Power Wireless Personal Area Networks (6 LowPAN) that ensures the IPv6 addressing on low power networks using the IEEE 802.15.4 as a medium access protocol [11; 13; 14]. The communication between devices with different layer medium access protocols must happen on WSN and IoT environments. It can easily be performed through the application layer protocol. The hypertext transfer protocol (HTTP) and the hypertext transfer protocol secure (HTTPS) can be modified to perform this bridge between lower protocols, although they were not developed to perform this kind of functionalities. Other protocols such as the constrained application protocol (CoAP) and message queuing telemetry transport (MQTT) were designed to allow M2M in different scenarios, as the first implements a request/respond scenario and the last attends a publish/subscribe scenario. Transport layer protocols are dependent on the application protocols [13]. Traditionally, in WSANs all the devices communicate through the same protocols. For example, if a temperature sensor operates by Wi-Fi and HTTP, it only communicates with other devices operating with these protocols. Moreover, in these networks, the collected data are not always available for users through the Internet. The integration and communication among devices with different protocols should be supported in IoT-based smart environments. For instance, a gas sensor supporting IEEE 802.15.4 and MQTT should be able to communicate with a smart window with a GPRS module and operate with CoAP. This integration is possible through mediator software, called middleware, where data gathered by sensors are transferred and stored on this software, and it makes the necessary adaptations for these data being suitable for other devices under different communication protocols [13; 89].