# LoRa Architecture for V2X Communication: An Experimental Evaluation with Vehicles on the Move
## 5 Prototype Implementation of the Proposed System  
Two main components of the proposed architecture are OBU and RSU. As OBUs are integrated into vehicles to collect and send vehicle data to other vehicles and infrastructures, they are equipped with sensors and transceivers. To make it computationally efficient, and maintain low power consumption, OBU is comprised of two micro-controller units (MCUs). One MCU processes and parses the sensor data and communicates serially to transfer the data to the second MCU that remains connected to the LoRa transceiver RFM69 HCW module. Arduino pro mini and Arduino nano boards are used as MCU1 and MCU2 respectively and both the boards use the same ATMega328p microcontroller chip which has the static random-access memory (SRAM) of only 2 KB and a clock speed of 16 MHz ADXL345, a digital 3 axis accelerometer, and an MTK3339 chipset-based GPS module are integrated to the MCU1 with inter-integrated circuit (I2C) serial bus and software serial respectively. MCU1 gets the data from the sensors and parses them to prepare the required payload. X, Y, Z-axis acceleration data along with latitude and longitude data are sent to MCU2 with serial communication. MCU2 is integrated with the RFM69 HCW transceiver module with the serial peripheral interface (SPI) bus. A TPS61090-based boost converter is used both in OBU and RSU to supply 5 V from a very compact 3.7 V Lithium-Ion battery. RSUs are much simpler in construction in comparison to OBUs. RSUs have only one MCU unit integrated with the same RFM69 HCW LoRa module with the SPI bus. Figures 4 and 5 show the prototypes of the OBU and RSU, respectively. MCU1 sends the collected data to MCU2 with serial communication and MCU2 being integrated with the LoRa transceiver transmits the data to other OBUs and RSUs.  
Figure 4: Architecture and prototype of the OBU.  
Figure 3: RSSI comparison of absolute, Kalman filtered values and moving average values.  
A data packet of 40 bytes is sent each time from OBU to other vehicles and infrastructures. This data packet is comprised of metadata and sensor data. Figure 6 shows all the data packet components and their respective data bytes and Figure 7 shows the time they take for the reception. The metadata, preamble data, network id, node id, and cyclic redundancy check (CRC) data takes 4, 4, 2, and 2 bytes, respectively. The reception of preamble data, network id, and node id altogether have a duration of 34 ms. The total payload is 28 bytes which are comprised of latitude, longitude, and 3-axis acceleration data. The total payload takes 67 ms to be received and processed at the receiving end for any unit.  
Security is one of the major concerns for any vehicular communication. To make the communication more secure, LoRa supports advanced encryption standard (AES) 128-bit shared key encryption [70]. To address the security concerns, AES 128-bit shared key encryption is included among the deployed units. As it increases the security by encrypting the transmitted data, it also increases the reception time as the data needs to be decrypted [71]. With AES encryption, the metadata takes 34.5 ms whereas the payload takes 106.8 ms for the reception. It takes 5.8 ms for decrypting the received data by any unit with a 128-bit AES algorithm. This is the trade-off the system must consider for avoiding cyber vulnerability.  
Figure 5: Architecture and prototype of the RSU.  
Figure 6: Data packet components and the respective data bytes.  
Figure 7: Reception time of the transmitted data packet components.