Week 14 : Networking Communications
Networking and Communications
This week’s group work entails the communication of two projects. In this instance, a UART communication was established between the projects of students Alex Manuel Rivera Rivera and Luis Abel RodrÃguez de Torner, who employed two distinct communication protocols: LoRa and BLE, respectively.
The UART (Universal Asynchronous Receiver-Transmitter) protocol is an asynchronous serial communication standard that is widely used in data transmission between devices. UART employs only two signal lines: one for transmitting (TX) and one for receiving (RX) data. In the context of UART communication, the transmission of data is accomplished through the use of frames, each of which is comprised of a start bit, data bits, and a parity bit (if present). The start bit, which is represented by a logic low signal (0), serves to indicate the beginning of the frame. The data bits, which typically consist of 8 bits, are transmitted from the least significant bit to the most significant bit. Finally, the parity bit (if present) is used to detect errors during transmission. The parity bit can be either even or odd, indicating that the total number of bits in a given frame is even or odd, respectively. The stop bit is a high logic signal (1) indicating the end of the frame. Its length can be 1 or 2 bits. The use of the parity bit and the length of the stop bit depend on the specific configuration of the UART protocol used. UART is distinguished by its simplicity, low transfer rate, and wide compatibility, rendering it an appropriate choice for straightforward communication applications, such as connecting devices via serial ports.
The interconnection of the two microprocessors, the HELTEC V3 development board, based on an ESP32 + SX127x and the Arduino Nano 33 BLE Sense rev2, was achieved through the implementation of the following code:
char number = ' ';
int led = 13;
int in = 1;
int estado =0;
void setup()
{
Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(in, INPUT);
}
{
if (SerialPort.available())
{
char number = SerialPort.read();
if (number == '0') {
digitalWrite(led, LOW);
}
if (number == '1') {
digitalWrite(led, HIGH);
}
}
}
The results are shown below: