Design and Implementation of a Multi-Protocol IoT Gateway Using PIC18 Controller
Abstract
The expansion of Internet of Things (IoT) networks has led to several communication protocols being utilized, causing interoperability problems between heterogeneous devices. Popular communication protocols like MQTT, BLE, and SPI have been used in IoT; however, no direct interoperability between the protocols was provided. In this paper, an architecture for developing an IoT gateway utilizing a resource-constrained PIC18F4520 microcontroller along with the ESP32 wireless module that serves as an interconnector of three pairs of protocols - MQTT and BLE, SPI and MQTT, and BLE and SPI, is proposed. With the resource constraints of the PIC18F4520 microcontroller consisting of 1.5 KB of RAM and 32 KB Flash, a firmware system with interrupt-based UART communication, small-size ring buffers, and Flash-based command storage is created. To protect the PIC18F4520 microcontroller running on a 5 V power source from potential damage, a TXS0102 bi-directional voltage level shifter was included to provide a reliable communication link between the 5 V PIC18F4520 microcontroller and 3.3 V ESP32 wireless module. All three protocol pairs were successfully implemented with a maximum of only 54% memory usage.
References
Bluetooth SIG, "Bluetooth Core Specification Version 5.0," 2016.
Microchip Technology, "PIC18F4520 Data Sheet," Document No. DS39631E, 2008.
Espress if Systems, "ESP32 AT Instruction Set and Examples," Version 2.4.0, 2022.
Texas Instruments, "TXS0102 2-Bit Bidirectional Voltage-Level Translator," Document No. SCES734B, 2016.
A. Banks and R. Gupta, "MQTT Version 3.1.1," OASIS Standard, Dec. 2014.
Refbacks
- There are currently no refbacks.