How to connect SX1278 LoRa module with Arduino development board
Время обновления: 2020-12-08 18:01:40
In 2020, there will be 2.5 billion devices connected to the Internet worldwide. With the rapid spread of the concepts of IoT and Industry 4.0, IoT cars, and smart cities, we already have some wireless protocols, such as BLE, Wi-Fi, Cellular, etc., but these technologies are not suitable for IoT sensor nodes because they need to Transmission of information over long distances without using too much power. Therefore, LoRa technology has emerged because it can perform ultra-long-distance transmission with low power consumption.
With the ESP module becoming synonymous with Wi-Fi applications, this LoRa technology also can build a huge network like the Internet. We have previously built many IoT-based projects using ESP8266 and Arduino, in this article we will learn about LoRa and how to use it with the Arduino development platform.And how to use the Arduino development board to connect the SX1278 LoRa module.
What is LoRa?
The term LoRa stands for long-distance and is a radio frequency technology introduced by Semtech. This LoRa technology can be used to transmit two-way information over long distances without consuming too much power. Remote sensors can use this attribute, and only need to operate a small battery to transmit data.
Under normal circumstances, Lora can reach a distance of 15-20km and can use the battery for many years. Please remember that LoRa, LoRaWAN, and LPWAN are three different terms and should not be confused with each other.
Understanding LoRa technology
In any typical IoT solution provided for warehouse management or on-site monitoring, hundreds of sensor nodes will be deployed in the field, and these nodes will monitor important parameters and send them to the cloud platform for processing. But these sensors should be wireless, and small batteries should be used for portability. Wireless solutions like RF can send data to long distances, but require more power for battery operation. On the other hand, BLE can work with very little power but cannot send data over long distances. So this is why LoRa is needed.
In LoRa, we can achieve high-distance communication without using a lot of power, thus overcoming the shortcomings of Wi-Fi and BLE communication. But how is it possible? If this is the case, why do BLE and RF still exist?
That's because LoRa has its shortcomings. To achieve the long-range of high-power LoRa bandwidth, it can operate on very low bandwidth. The maximum bandwidth of Lora is about 5.5 kbps, which means you can only send a small amount of data through LoRa. Therefore, you cannot send audio or video through this technology, it is only suitable for transmitting less information, such as sensor values. The figure below shows the location of LoRa compared to Wi-Fi, Bluetooth, and Cellular cellular devices.
Many people compare LoRa with Wi-Fi or Bluetooth, but the two are not close to LoRa. Bluetooth is used to transfer information between two Bluetooth devices, and Wi-Fi is used to transfer information between an access point (router) and a station (mobile). But LoRa technology was not invented mainly to transmit data between two LoRa modules.
You can think of LoRa as more like cellular communication. The signal from one LoRa node reaches another node through the LoRa gateway, as shown in the figure below.
These gateways then transfer the information to the Internet, and finally to the end-user through the application program interface. Similarly, the data from the user will also reach the node through the web server and gateway.
LoRa nodes usually run on batteries and consist of radio modules and microprocessors. The microprocessor is used to read data from the sensor and send it in the air through the radio module, and then receive it by the LoRa gateway. LoRa gateways also have radio modules and microprocessors, but they usually run on AC power because they require more power. A single LoRa gateway can monitor multiple LoRa nodes, and a single LoRa node can also send information to multiple gateways so that the information from the nodes will be connected to the gateway without being lost. When the information id is sent from the node to the gateway, it is called uplink, and when it is sent from the gateway to the node, it is called the downlink.
LoRa belongs to the LPWAN category, where LPWAN stands for Low Power Wide Area Network. Not only LoRa can run on LPWAN,we also have other technologies, such as NB-IOT, Sigfox, etc., which can run in the same LPWAN. Once LoRa technology was introduced, it required all manufacturers to follow certain protocols, so the LoRa Alliance was formed, and then LoRaWAN was introduced. LoRaWAN is a modified form of LPWAN, which specifies how LoRa in the physical layer should be used to send and receive data between nodes, gateways, and the Internet.
How far can I use LoRa to communicate?
Official information about LoRa claims that it can reach a line-of-sight distance of 715 kilometers. That is when there is no barrier between the node and the gateway. Few people even communicate between the ground and the ground at 212 kilometers or even use weather balloons to reach 702 kilometers.
LoRa SX1278 and Arduino
The above theory is enough for us to build it ourselves and examine how it works. The LoRaWAN protocol does not allow communication between two LoRa modules, but there is a technology called the radio header method, which follows the LoRaWAN protocol, but allows us to communicate with two LoRa modules! So let's use two LoRa modules and two Arduino boards to send data from one board and then receive data on the other board. We will use Arduino Uno on the transmitter side and Arduino Nano on the receiver side.
The LoRa module I used here is SX1278 Ra-02, with a working frequency of 433MHz. The license-free frequency here ranges from 865MHz to 867MHz, so I don't allow the 433MHz frequency module to be used for a long time in law instead of for educational purposes. Similarly, check the allowed range in your country/region and make sure you can use a specific frequency range. LoRa modules have different frequency ranges, the most common are 433MHz, 915MHz, and 868MHz. The working frequency of the module will be mentioned at the end of the module. You can also buy LoRa as a module or just a chip. If you plan to only get chips, then make sure your soldering technique is good because it is a good job to solder to LoRa chips. The following are the versions of the module and chip bonding wires, as shown below.
The next important thing about your LoRa module is your antenna. Please remember that you must use the antenna to operate the LoRa module, otherwise the output transmit power will damage the module. I am using a 433Mhz Lora module, so the rated frequency of my antenna is 433MHz, you have to choose the antenna accordingly. My LoRa module and antenna are shown below.
Transmitter-Connect LoRa SX1278 and Arduino UNO
For the sending end, we will use Arduino UNO and our LoRa module. The circuit diagram to connect Arduino UNO with LoRa is shown below
The LoRa module consists of 16 pins, with 8 pins on each side. Among these 16 pins, 6 are used by GPIO pins, ranging from DIO0 to DIO5, and 4 of them are used by ground pins. The module works at 3.3V, so the 3.3V pin on LoRa is connected to the 3.3V pin on the Arduino UNO board. Then we connect the SPI pin on LoRa to the SPI pin on the Arduino board as shown above.
I use a connecting cable to establish a connection between the Arduino UNO and LoRa Module. The settings are as follows. The entire setup can be powered by a mobile power supply, making it movable to test the range.
Receiver-Connect LoRa SX1278 and Arduino Nano
For the receiving end, we will use the LoRa module and Arduino Nano. You can use any Arduino board for transmitter and receiver, but make sure to connect them accordingly. The circuit diagram to connect Arduino Nano with LoRa is shown below
Except for a small change, the connection remains almost unchanged. The 3.3V pin of the LoRa module is not powered by the Arduino Nano, but by an external 3.3V regulator. This is because the on-board voltage regulator on the Arduino Nano cannot provide enough current for the LoRa module to operate. Otherwise, the connection remains the same.
I established the connection on the breadboard and used the reliable old breadboard power supply we built earlier. Please also note that the LoRa module I used is not very suitable for breadboards, so I used two small breadboards to connect as shown below.
The above is the introduction of how to use the Arduino development board to connect the SX1278 LoRa module, I hope it will be helpful to those who want to know.
Предыдущий: Everything about N-channel hexfet power mosfet-IRF3205
Следующий: Semtech SX1308 IMLTRT Indoor Micro Gateway Digital Baseband Chip
Ratings and Reviews
Связанные специальные
-
DBLS106G
Semtech
> -
ACS9521IFALBGT
Semtech
BGA > -
SX8636I05AULTRT
Semtech
TOUCH BUTTON CONTROLLER ; HT SUSA CODE:8 > -
GS1672-IBE3
Semtech
Complete SDI transmitter Serial Interfac > -
GN2017AINE3
Semtech
Dual 16G Fibre Channel CDR with VCSEL dr > -
GS9074ACTE3
Semtech
Adaptive Cable Equalizer for SD-SDI & DV > -
ACS9510BT
Semtech
TOP SYNC ACS9510T MKTG PART NO > -
ECLAMP2340C.WC
Semtech
QFN > -
XE1205I074TRLF
Semtech
RF Transceiver FSK 2.5V/3.3V 48Pin VQFN > -
TS30013-M033QFNR
Semtech
Conv DC-DC 4.5V to 18V Synchronous Step > -
SX8724E082TDT
Semtech
Bus Exchange Switch 1Element 9CH 48Pin C > -
SX8723CWLTDT
Semtech
IC DAS ADC 16BIT I2C/SRL > -
SX8651IWLTRT
Semtech
4-WIRE RESISTIVE TOUCH SCREEN 23AH8953 > -
SX1232IMLTRT
Semtech
RF Transceiver FSK/GFSK/GMSK/MSK/OOK 2.5 > -
SC488MLTRT
Semtech
Complete DDR1/2/3 Memory Power Supply >
Горячие акции
Больше- SC4525A
- SC412AMLTRT
- SC2615ML.TR
- SC174MLTRT
- S-8354A50MC-JRJT2G
- GV8501-CNE3
- GS9090BCNE3
- GS4915-INE3
- GS4910BCNE3
- GS2989-INE3
- GS2978-CNE3
- GO1535-CTXE3
- GN2023-INE3
- GN2003SCNE3
- EZ1580CM
- ECLAMP2394P.TCT
- E9655AHF
- E8410ALP
- E8405ALP
- 1N5811
- 1N5806
- 1N5621
- 1N4990
- 1N4989
- 1N4980
- 1N4967
- 1N4961
- 1N4948
- 1N4477
- 1N4474
- 1N4473
- 1N4472
- 1N4471
- 1N4468
- 1N4466
- 1N4464
- 1N4463
- 1N4461
- 1N4460
- 1N4249
- 1N4248
- 1N4148ST
- 1N3614
- 103KT1608
- 0.022UF