User Tools

Site Tools


loramessenger:project

Compact Lora Messenger

- Optimized RF Design for Maximum Coverage

Neil Hao

Starts from 2021/Jul/09 to 2021/08/02 14:41 (Last Modification)

Overview

This project aims to design a credit card size Lora Messenger which does not depend on Internet or Cellular network. In other words, users can chat with others by using this credit card size Lora device and a smartphone with Bluetooth without Internet and Cellular network.

For the hardware design, a high efficiency compact Lora PCB Antenna and an ultra-low noise figure amplifier had been designed for maximum the communication range.

For the software design, a simple Lora half duplex communication protocol had been implemented by about 600 lines of C++ code.

Current testing firmware implemented:

  1. Lora half duplex communication protocol with timeout and re-transmitting features
  2. Bluetooth Serial Port Profile (SPP) which provides communication capability between the phone and the Lora device.
  3. Command Parser for executing user commands through Bluetooth.

The coverage of this credit card size Lora device was tested in the urban area. In the experiment (TX:14dBm, Freq:915Mhz, Spreading Factor:12), 1500m communication distance had been tested, no timeout or re-transmitting occurred. According to the link budget, this system could reach far further than 1500m.

Demo Video (YouTube)


Hardware Design

Schematicslora_messenger_schematics.pdfVersion: 25 May 2021
Gerber Fileslora_messenger_gerber_files.zipVersion: 25 May 2021
Note PCB substrate: FR4Thickness: 1.6mm
No. Description
1 USB Type C Socket
2 Silicon Labs CP2102 USB to UART Bridge
3 Semtech SX1276 Lora Transceiver
4 Ultra-Low Noise Amplifier (LNA)
5 RF Switch
6 915Mhz Lora PCB Antenna
7 Active Buzzer
8 Vibration Motor
9 ESP32 WROOM

Ultra-Low Noise Amplifier (LNA) Design

For the LNA which was designed based on SiGe NPN RF Transistor (Q2 in the lora_messenger_schematics.pdf), it performs not only acting as a LNA but also as Band pass filter, RF power limiter and impedance matching circuit.

According to the EM simulation of the SX1276 official demo board:

  • Optimized load impedance of RFI_HF: 21.181+j*52.294
  • Optimized load impedance of PA_BOOST: 16.567+j5.122

Thus, the LNA needs to match the impedance from the RF Switch to RFI_HF for RX link optimization. Fig1. LNA Performance

Receiver Sensitivity improvement

The noise figure is reduced from 6dB for the SX1276 standalone to 1dB for the SX1276 and LNA combination, leading to a 5dB theoretical improvement in sensitivity (approximately -129dBm to -134dBm). According to the SX1276’s Transmission Power Consumption Specification, sensitivity improvement is meaningful for battery powered IOT devices, because sensitivity improvement has far more advantage for energy efficiency than rising the transmission power.

The LNA also acts as RF power limiter which limits the power feeding into RFI_HF will never exceed 3dBm.

915Mhz Lora PCB Antenna Design

For the PCB antenna design, I designed it based on TI’s DN024, except I used the impedance matching method similar to the inverted F antenna. TI used LC matching network. The antenna gain is 2.0 dBi.

S11 when the antenna in the Plastic Box:

Radiation Pattern

3D YZ Plane XZ Plane XY Plane


Software Design

Evaluation Firmwarelora_esp32_evaluation_firmware.zipVersion: 08 Jul 2021
Android App Serial Bluetooth Terminal Retrieved Jul 11, 2021

ESP32 PIN Assignments

Description PIN
Buzzer GPIO 16
Vibration GPIO 17
LORA
RST GPIO 26
DIO0 GPIO 25
ant_switch GPIO 33
HSPI_MISO GPIO 12
HSPI_MOSI GPIO 13
HSPI_SCLK GPIO 14
HSPI_SS GPIO 27
LED
R GPIO 15
G GPIO 2
B GPIO 4
Switch
SW1 GPIO36 Sensor_VP

On Board LED Truth Table

R G B Description
1 00Transmitting mode
0 10Receiving mode
0 X1Bluetooth authentication mode

Bluetooth Serial Port Profile (SPP) Commands

Commands Description
ATS+ B Notification Remote User by using Buzzer
ATS+ V Notification Remote User by using Vibrator
ATS+ BV Notification Remote User by using Buzzer+Vibrator
ATS+ INF Printout Lora Quality Information On/Off
ATS+ NTFB Local Notification by using Buzzer (1)
ATS+ NTFV Local Notification by using Vibrator (2)
ATS+ NTBV Local Notification by using Buzzer+Vibrator (3)
ATS+ NTFM Mute Local Notification (0)
ATS+ NTFT Test Local Notification

Lora Half Duplex Communication Protocol Design

Definition of Lora DATA PACKAGE

Byte Destination e.g. 0xFF
Byte Local Address e.g. 0xBB
Byte msgCount Message ID, 0 to 254
BytemsgTypeenum msgType {msg=0, buzzer=1, vibration=2, buzzer_vibration=3, ack=5} ;
lengthoutgoing.length()
outgoingPayload

Sending Process

Note: Lora Sending Process will be invoked when receiving a Bluetooth message. For current configuration, the timeout message will be resent only 1 time due to the relative low data rate of Lora.

Receiving Process

Note: Lora Receiving Process will be called consecutively.


Resource

Schematicslora_messenger_schematics.pdfVersion: 25 May 2021
Gerber Fileslora_messenger_gerber_files.zipVersion: 25 May 2021
Note PCB substrate: FR4Thickness: 1.6mm
Evaluation Firmwarelora_esp32_evaluation_firmware.zipVersion: 08 Jul 2021
Android App Serial Bluetooth Terminal Retrieved Jul 11, 2021

Reference

[1] Richard Wallace. Design Note DN024: Monopole PCB Antenna with Single or Dual Band Option . Retrieved Jul 11, 2021, from https://www.ti.com/lit/an/swra227e/swra227e.pdf?ts=1625872783255

loramessenger/project.txt · Last modified: 2021/08/02 14:41 by neilhao