{"id":63668,"date":"2018-06-23T10:30:25","date_gmt":"2018-06-23T10:30:25","guid":{"rendered":"http:\/\/randomnerdtutorials.com\/?p=63668"},"modified":"2024-06-25T17:30:30","modified_gmt":"2024-06-25T17:30:30","slug":"esp32-lora-rfm95-transceiver-arduino-ide","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/esp32-lora-rfm95-transceiver-arduino-ide\/","title":{"rendered":"ESP32 with LoRa using Arduino IDE &#8211; Getting Started"},"content":{"rendered":"\n<p>In this tutorial we&#8217;ll explore the basic principles of LoRa, and how it can be used with the ESP32 for IoT projects using the Arduino IDE. To get you started, we&#8217;ll also show you how to create a simple LoRa Sender and LoRa Receiver with the RFM95 transceiver module.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introducing LoRa<\/h2>\n\n\n\n<p>For a quick introduction to LoRa, you can watch the video below, or you can scroll down for a written explanation.<\/p>\n\n\n<p style=\"text-align:center\"><iframe width=\"720\" height=\"405\" src=\"https:\/\/www.youtube.com\/embed\/w6ygDCTSQug?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is LoRa?<\/h3>\n\n\n\n<p>LoRa is a wireless data communication technology that uses a radio modulation technique that can be generated by Semtech LoRa transceiver chips.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-semtech-radio-modulation.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\"\/><\/figure><\/div>\n\n\n<p>This modulation technique allows long range communication of small amounts of data (which means a low bandwidth), high immunity to interference, while minimizing power consumption. So, it allows long distance communication with low power requirements.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/LoRa-intro.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\"\/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">LoRa Frequencies<\/h3>\n\n\n\n<p>LoRa uses unlicensed frequencies that are available worldwide. These are the most widely used frequencies:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>868 MHz for Europe<\/li>\n\n\n\n<li>915 MHz for North America<\/li>\n\n\n\n<li>433 MHz band for Asia<\/li>\n<\/ul>\n\n\n\n<p>Because these bands are unlicensed, anyone can freely use them without paying or having to get a license. Check the <a href=\"https:\/\/www.thethingsnetwork.org\/docs\/lorawan\/frequencies-by-country.html\" target=\"_blank\" rel=\"noreferrer noopener\">frequencies used in your country<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">LoRa Applications<\/h3>\n\n\n\n<p>LoRa long range and low power features, makes it perfect for battery-operated sensors and low-power applications in:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Internet of Things (IoT)<\/li>\n\n\n\n<li>Smart home<\/li>\n\n\n\n<li>Machine-to-machine communication<\/li>\n\n\n\n<li>And much more&#8230;<\/li>\n<\/ul>\n\n\n\n<p>So, LoRa is a good choice for sensor nodes running on a coil cell or solar powered, that transmit small amounts of data.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/coin-cell-sollar-power.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\"\/><\/figure><\/div>\n\n\n<p>Keep in mind that LoRa is not suitable for projects that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Require high data-rate transmission;<\/li>\n\n\n\n<li>Need very frequent transmissions;<\/li>\n\n\n\n<li>Or are in highly populated networks.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">LoRa Topologies<\/h3>\n\n\n\n<p>You can use LoRa in:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-topologies.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\"\/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Point to point communication<\/li>\n\n\n\n<li>Or build a LoRa network (using LoRaWAN for example)<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Point to Point Communication<\/h4>\n\n\n\n<p>In point to point communication, two LoRa enabled devices talk with each other using RF signals.<\/p>\n\n\n\n<p>For example, this is useful to exchange data between two ESP32 boards equipped with LoRa transceiver chips that are relatively far from each other or in environments without Wi-Fi coverage.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-p2p-esp32.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\"\/><\/figure><\/div>\n\n\n<p>Unlike Wi-Fi or Bluetooth that only support short distance communication, two LoRa devices with a proper antenna can exchange data over a long distance.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-wi-fi-bluetooth.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\"\/><\/figure><\/div>\n\n\n<p>You can easily configure your ESP32 with a LoRa chip to transmit and receive data reliably at more than 200 meters distance (you can get better results depending on your enviroment and LoRa settings). There are also other LoRa solutions that easily have a range of more than 30Km.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">LoRaWAN<\/h3>\n\n\n\n<p>You can also build a LoRa network using LoRaWAN.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lorawan.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\"\/><\/figure><\/div>\n\n\n<p>The LoRaWAN protocol is a Low Power Wide Area Network (LPWAN) specification derived from LoRa technology standardized by the LoRa Alliance. We won&#8217;t explore LoRaWAN in this tutorial, but for more information you can check the <a href=\"https:\/\/lora-alliance.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">LoRa Alliance<\/a> and <a href=\"https:\/\/www.thethingsnetwork.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">The Things Network<\/a> websites.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How can LoRa be useful in your home automation projects?<\/h2>\n\n\n\n<p>Let\u2019s take a look at a practical application.<\/p>\n\n\n\n<p>Imagine that you want to measure the moisture in your field. Although, it is not far from your house, it probably doesn\u2019t have Wi-Fi coverage. So, you can build a sensor node with an ESP32 and a moisture sensor, that sends the moisture readings once or twice a day to another ESP32 using LoRa.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-iot-example.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\"\/><\/figure><\/div>\n\n\n<p>The later ESP32 has access to Wi-Fi, and it can run a web server that displays the moisture readings.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-with-esp32-web-server.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\"\/><\/figure><\/div>\n\n\n<p>This is just an example that illustrates how you can use the LoRa technology in your ESP32 projects.<\/p>\n\n\n\n<p><strong>Note:<\/strong> we teach how to build this project on our &#8220;<a href=\"https:\/\/randomnerdtutorials.com\/learn-esp32-with-arduino-ide\/\" target=\"_blank\" rel=\"noreferrer noopener\">Learn ESP32 with Arduino IDE<\/a>&#8221; course. It is Project 4 on the Table of Contents: <strong>LoRa Long Range Sensor Monitoring \u2013 Reporting Sensor Readings from Outside: Soil Moisture and Temperature<\/strong><strong>.<\/strong> Check the <a href=\"https:\/\/randomnerdtutorials.com\/learn-esp32-with-arduino-ide\/\">course page<\/a> for more details.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/randomnerdtutorials.com\/learn-esp32-with-arduino-ide\/\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"398\" height=\"223\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/03\/esp32-project4.jpg?resize=398%2C223&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-63575\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/03\/esp32-project4.jpg?w=398&amp;quality=100&amp;strip=all&amp;ssl=1 398w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/03\/esp32-project4.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 398px) 100vw, 398px\" \/><\/a><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">ESP32 with LoRa<\/h2>\n\n\n\n<p>In this section we&#8217;ll show you how to get started with LoRa with your ESP32 using Arduino IDE. As an example, we&#8217;ll build a simple LoRa Sender and a LoRa Receiver.<\/p>\n\n\n\n<p>The LoRa Sender will be sending a &#8220;hello&#8221; message followed by a counter for testing purposes. This message can be easily replaced with useful data like sensor readings or notifications.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-esp32-parts-required.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-65091\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-esp32-parts-required.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-esp32-parts-required.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>To follow this part you need the following components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/esp32-dev-board-wi-fi-bluetooth\/\" target=\"_blank\" rel=\"noreferrer noopener\">2x ESP32 DOIT DEVKIT V1 Board<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/rfm95-lora-transceiver-module\/\" target=\"_blank\" rel=\"noreferrer noopener\">2x LoRa Transceiver modules (RFM95)<\/a><\/li>\n\n\n\n<li>RFM95 LoRa breakout board (optional)<\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/jumper-wires-kit-120-pieces\/\" target=\"_blank\" rel=\"noreferrer noopener\">Jumper wires<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/mb-102-solderless-breadboard-830-points\/\" target=\"_blank\" rel=\"noreferrer noopener\">Breadboard<\/a>\u00a0or\u00a0<a href=\"https:\/\/makeradvisor.com\/tools\/prototyping-circuit-board-stripboard\/\" target=\"_blank\" rel=\"noreferrer noopener\">stripboard<\/a><\/li>\n<\/ul>\n\n\n\n<p>Alternative:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/ttgo-lora32-sx1276-esp32-oled\/\" target=\"_blank\" rel=\"noreferrer noopener\">2x TTGO LoRa32 SX1276 OLED<\/a><\/li>\n<\/ul>\n\n\n\n<p>Instead of using an ESP32 and a separated LoRa transceiver module, there are ESP32 development boards with a LoRa chip and an OLED built-in, which makes wiring much simpler. If you have one of those boards, you can follow: <a href=\"https:\/\/randomnerdtutorials.com\/ttgo-lora32-sx1276-arduino-ide\/\">TTGO LoRa32 SX1276 OLED Board: Getting Started with Arduino IDE<\/a>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/10\/ESP32-board-with-built-in-lora-OLED.jpg?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/10\/ESP32-board-with-built-in-lora-OLED.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 built-in LoRa and OLED\" class=\"wp-image-90269\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/10\/ESP32-board-with-built-in-lora-OLED.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/10\/ESP32-board-with-built-in-lora-OLED.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/figure><\/div>\n\n<p>You can use the preceding links or go directly to <a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\">MakerAdvisor.com\/tools<\/a> to find all the parts for your projects at the best price!<\/p><p style=\"text-align:center;\"><a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/10\/header-200.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Preparing the Arduino IDE<\/h3>\n\n\n\n<p>There\u2019s an add-on for the Arduino IDE that allows you to program the ESP32 using the Arduino IDE and its programming language. Follow one of the next tutorials to prepare your Arduino IDE to work with the ESP32, if you haven\u2019t already.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/installing-the-esp32-board-in-arduino-ide-windows-instructions\/\"><strong>Windows<\/strong>\u00a0instructions \u2013 ESP32 Board in Arduino IDE<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/installing-the-esp32-board-in-arduino-ide-mac-and-linux-instructions\/\"><strong>Mac and Linux<\/strong>\u00a0instructions \u2013 ESP32 Board in Arduino IDE<\/a><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Installing the LoRa Library<\/h4>\n\n\n\n<p>There are several libraries available to easily send and receive LoRa packets with the ESP32. In this example we\u2019ll be using the <a href=\"https:\/\/github.com\/sandeepmistry\/arduino-LoRa\" target=\"_blank\" rel=\"noreferrer noopener\">arduino-LoRa library by sandeep mistry<\/a>.<\/p>\n\n\n\n<p>Open your Arduino IDE, and go to <strong>Sketch<\/strong> &gt; <strong>Include Library<\/strong> &gt; <strong>Manage Libraries<\/strong> and search for &#8220;<strong>LoRa<\/strong>&#8220;. Select the LoRa library highlighted in the figure below, and install it.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"786\" height=\"443\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/install-lora-library.png?resize=786%2C443&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-63683\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/install-lora-library.png?w=786&amp;quality=100&amp;strip=all&amp;ssl=1 786w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/install-lora-library.png?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/install-lora-library.png?resize=768%2C433&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Getting LoRa Tranceiver Modules<\/h3>\n\n\n\n<p>To send and receive LoRa messages with the ESP32 we\u2019ll be using the&nbsp;<a href=\"https:\/\/makeradvisor.com\/tools\/rfm95-lora-transceiver-module\/\" target=\"_blank\" rel=\"noreferrer noopener\">RFM95 transceiver module<\/a>. All LoRa modules are transceivers, which means they can send and receive information. You\u2019ll need 2 of them.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"431\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm95-transceiver-module.jpg?resize=750%2C431&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-63697\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm95-transceiver-module.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm95-transceiver-module.jpg?resize=300%2C172&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>You can also use other compatible modules like Semtech SX1276\/77\/78\/79 based boards including: RFM96W, RFM98W, etc\u2026<\/p>\n\n\n\n<p>Alternatively, there are ESP32 boards with LoRa and OLED display built-in like the&nbsp;<a rel=\"noreferrer noopener\" href=\"http:\/\/shrsl.com\/ujni\" target=\"_blank\">ESP32 Heltec Wifi Module<\/a>, or the&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/ttgo-lora32-sx1276-arduino-ide\/\">TTGO LoRa32 board<\/a>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"325\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/esp32-lora-oled.jpg?resize=750%2C325&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-63692\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/esp32-lora-oled.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/esp32-lora-oled.jpg?resize=300%2C130&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>Before getting your LoRa transceiver module, make sure you check the correct frequency for your location. You can visit the following web page to learn more about&nbsp;<a href=\"https:\/\/www.thethingsnetwork.org\/docs\/lorawan\/frequencies-by-country.html\" target=\"_blank\" rel=\"noreferrer noopener\">RF signals and regulations according to each country<\/a>. For example, in Portugal we can use a frequency between 863 and 870 MHz or we can use 433MHz. For this project, we\u2019ll be using an RFM95 that operates at 868 MHz.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Preparing the RFM95 Transceiver Module<\/h3>\n\n\n\n<p>If you have an ESP32 development board with LoRa built-in, you can skip this step.<\/p>\n\n\n\n<p>The RFM95 transceiver isn\u2019t breadboard friendly. A common row of 2.54mm header pins won\u2019t fit on the transceiver pins. The spaces between the connections are shorter than usual.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"433\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm95-tight-spaces.jpg?resize=750%2C433&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-63688\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm95-tight-spaces.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm95-tight-spaces.jpg?resize=300%2C173&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>There are a few options that you can use to access the transceiver pins.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You may solder some wires directly to the transceiver;<\/li>\n\n\n\n<li>Break header pins and solder each one separately;<\/li>\n\n\n\n<li>Or you can buy a breakout board that makes the pins breadboard friendly.<\/li>\n<\/ul>\n\n\n\n<p>We\u2019ve soldered a header to the module as shown in the figure below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"303\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm96-solder-headers.jpg?resize=750%2C303&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-63690\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm96-solder-headers.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm96-solder-headers.jpg?resize=300%2C121&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm96-solder-headers.jpg?resize=250%2C100&amp;quality=100&amp;strip=all&amp;ssl=1 250w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>This way you can access the module\u2019s pins with regular jumper wires, or even put some header pins to connect them directly to a stripboard or breadboard.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Antenna<\/h4>\n\n\n\n<p>The RFM95 transceiver chip requires an external antenna connected to the ANA pin.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"414\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/antenna-ana-pin.jpg?resize=750%2C414&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-63691\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/antenna-ana-pin.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/antenna-ana-pin.jpg?resize=300%2C166&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>You can connect a &#8220;real&#8221; antenna, or you can make one yourself by using a conductive wire as shown in the figure below. Some breakout boards come with a special connector to add a proper antenna.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"466\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm95-antenna.jpg?resize=750%2C466&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-63687\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm95-antenna.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/rfm95-antenna.jpg?resize=300%2C186&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>The wire length depends on the frequency:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>868 MHz: 86,3 mm (3.4 inch)<\/li>\n\n\n\n<li>915 MHz: 81,9 mm (3.22 inch)<\/li>\n\n\n\n<li>433 MHz: 173,1 mm (6.8 inch)<\/li>\n<\/ul>\n\n\n\n<p>For our module we need to use a 86,3 mm wire soldered directly to the transceiver\u2019s ANA pin. Note that using a proper antenna will extend the communication range.<\/p>\n\n\n\n<p><strong>Important:<\/strong> you MUST attach an antenna to the module.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Wiring the RFM95 LoRa Transceiver Module<\/h3>\n\n\n\n<p>The RFM95 LoRa transceiver module communicates with the ESP32 using SPI communication protocol. So, we&#8217;ll use the ESP32 default SPI pins. Wire both ESP32 boards to the corresponding transceiver modules as shown in the next schematic diagram:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/LoRa_ESP32_Wiring.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"794\" height=\"830\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/LoRa_ESP32_Wiring.png?resize=794%2C830&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-63693\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/LoRa_ESP32_Wiring.png?w=794&amp;quality=100&amp;strip=all&amp;ssl=1 794w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/LoRa_ESP32_Wiring.png?resize=287%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 287w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/LoRa_ESP32_Wiring.png?resize=768%2C803&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 794px) 100vw, 794px\" \/><\/a><\/figure><\/div>\n\n\n<p>Here&#8217;s the connections between the RFM95 LoRa transceiver module and the ESP32:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ANA: Antenna<\/li>\n\n\n\n<li>GND: <br><span class=\"rnthl rntcblack\">GND<\/span><\/li>\n\n\n\n<li>DIO3: don&#8217;t connect<\/li>\n\n\n\n<li>DIO4: don&#8217;t connect<\/li>\n\n\n\n<li>3.3V: <br><span class=\"rnthl rntcred\">3.3V<\/span><\/li>\n\n\n\n<li>DIO0: <br><span class=\"rnthl rntclgray\">GPIO 2<\/span><\/li>\n\n\n\n<li>DIO1: don&#8217;t connect<\/li>\n\n\n\n<li>DIO2: don&#8217;t connect<\/li>\n\n\n\n<li>GND: don&#8217;t connect<\/li>\n\n\n\n<li>DIO5: don&#8217;t connect<\/li>\n\n\n\n<li>RESET: <span class=\"rnthl rntcorange\">GPIO 14<\/span><\/li>\n\n\n\n<li>NSS: <span class=\"rnthl rntcyellow\">GPIO 5<\/span><\/li>\n\n\n\n<li>SCK: <span class=\"rnthl rntcgray\">GPIO 18<\/span><\/li>\n\n\n\n<li>MOSI: <span class=\"rnthl rntcgreen\">GPIO 23<\/span><\/li>\n\n\n\n<li>MISO: <span class=\"rnthl rntcblue\">GPIO 19<\/span><\/li>\n\n\n\n<li>GND: don&#8217;t connect<\/li>\n<\/ul>\n\n\n\n<p><strong>Note:<\/strong> the RFM95 transceiver module has 3 GND pins. It doesn\u2019t matter which one you use, but you need to connect at least one.<\/p>\n\n\n\n<p>For practical reasons we\u2019ve made this circuit on a stripboard. It\u2019s easier to handle, and the wires don\u2019t disconnect. You may use a breadboard if you prefer.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"227\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-sender-circuit.jpg?resize=750%2C227&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-63685\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-sender-circuit.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-sender-circuit.jpg?resize=300%2C91&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">The LoRa Sender Sketch<\/h2>\n\n\n\n<p>Open your Arduino IDE and copy the following code. This sketch is based on an example from the LoRa library. It transmits messages every 10 seconds using LoRa. It sends a &#8220;hello&#8221; followed by a number that is incremented in every message.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos &amp; Sara Santos - Random Nerd Tutorials\n  Modified from the examples of the Arduino LoRa library\n  More resources: https:\/\/RandomNerdTutorials.com\/esp32-lora-rfm95-transceiver-arduino-ide\/\n*********\/\n\n#include &lt;SPI.h&gt;\n#include &lt;LoRa.h&gt;\n\n\/\/define the pins used by the transceiver module\n#define ss 5\n#define rst 14\n#define dio0 2\n\nint counter = 0;\n\nvoid setup() {\n  \/\/initialize Serial Monitor\n  Serial.begin(115200);\n  while (!Serial);\n  Serial.println(&quot;LoRa Sender&quot;);\n\n  \/\/setup LoRa transceiver module\n  LoRa.setPins(ss, rst, dio0);\n  \n  \/\/replace the LoRa.begin(---E-) argument with your location's frequency \n  \/\/433E6 for Asia\n  \/\/868E6 for Europe\n  \/\/915E6 for North America\n  while (!LoRa.begin(868E6)) {\n    Serial.println(&quot;.&quot;);\n    delay(500);\n  }\n   \/\/ Change sync word (0xF3) to match the receiver\n  \/\/ The sync word assures you don't get LoRa messages from other LoRa transceivers\n  \/\/ ranges from 0-0xFF\n  LoRa.setSyncWord(0xF3);\n  Serial.println(&quot;LoRa Initializing OK!&quot;);\n}\n\nvoid loop() {\n  Serial.print(&quot;Sending packet: &quot;);\n  Serial.println(counter);\n\n  \/\/Send LoRa packet to receiver\n  LoRa.beginPacket();\n  LoRa.print(&quot;hello &quot;);\n  LoRa.print(counter);\n  LoRa.endPacket();\n\n  counter++;\n\n  delay(10000);\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/ESP32\/LoRaSender.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p>Let\u2019s take a quick look at the code.<\/p>\n\n\n\n<p>It starts by including the needed libraries.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#include &lt;SPI.h&gt;\n#include &lt;LoRa.h&gt;<\/code><\/pre>\n\n\n\n<p>Then, define the pins used by your LoRa module. If you\u2019ve followed the previous schematic, you can use the pin definition used in the code. If you\u2019re using an ESP32 board with LoRa built-in, check the pins used by the LoRa module in your board and make the right pin assignment.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#define ss 5\n#define rst 14\n#define dio0 2<\/code><\/pre>\n\n\n\n<p>You initialize the <span class=\"rnthl rntliteral\">counter<\/span> variable that starts at 0;<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>int counter = 0;<\/code><\/pre>\n\n\n\n<p>In the <span class=\"rnthl rntliteral\">setup()<\/span>, you initialize a serial communication.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>Serial.begin(115200);\nwhile (!Serial);<\/code><\/pre>\n\n\n\n<p>Set the pins for the LoRa module.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>LoRa.setPins(ss, rst, dio0);<\/code><\/pre>\n\n\n\n<p>And initialize the transceiver module with a specified frequency.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>while (!LoRa.begin(868E6)) {\n  Serial.println(\".\");\n  delay(500);\n}<\/code><\/pre>\n\n\n\n<p>You might need to change the frequency to match the frequency used in your location. Choose one of the following options:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>433E6<\/li>\n\n\n\n<li>868E6<\/li>\n\n\n\n<li>915E6<\/li>\n<\/ul>\n\n\n\n<p>LoRa transceiver modules listen to packets within its range. It doesn\u2019t matter where the packets come from. To ensure you only receive packets from your sender, you can set a sync word (ranges from 0 to 0xFF).<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>LoRa.setSyncWord(0xF3);<\/code><\/pre>\n\n\n\n<p>Both the receiver and the sender need to use the same sync word. This way, the receiver ignores any LoRa packets that don\u2019t contain that sync word.<\/p>\n\n\n\n<p>Next, in the <span class=\"rnthl rntliteral\">loop()<\/span> you send the LoRa packets. You initialize a packet with the <span class=\"rnthl rntliteral\">beginPacket()<\/span> method.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>LoRa.beginPacket();<\/code><\/pre>\n\n\n\n<p>You write data into the packet using the <span class=\"rnthl rntliteral\">print()<\/span> method. As you can see in the following two lines, we\u2019re sending a hello message followed by the counter.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>LoRa.print(\"hello \");\nLoRa.print(counter);<\/code><\/pre>\n\n\n\n<p>Then, close the packet with the <span class=\"rnthl rntliteral\">endPacket()<\/span> method.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>LoRa.endPacket();<\/code><\/pre>\n\n\n\n<p>After this, the counter message is incremented by one in every loop, which happens every 10 seconds.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>counter++;\ndelay(10000);<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Testing the Sender Sketch<\/h2>\n\n\n\n<p>Upload the code to your ESP32 board. Make sure you have the right board and COM port selected.<\/p>\n\n\n\n<p>After that, open the Serial Monitor, and press the ESP32 enable button. You should see a success message as shown in the figure below. The counter should be incremented every 10 seconds.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"753\" height=\"443\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-sender-serial-monitor-Copy.jpg?resize=753%2C443&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-64018\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-sender-serial-monitor-Copy.jpg?w=753&amp;quality=100&amp;strip=all&amp;ssl=1 753w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-sender-serial-monitor-Copy.jpg?resize=300%2C176&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 753px) 100vw, 753px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">The LoRa Receiver Sketch<\/h2>\n\n\n\n<p>Now, grab another ESP32 and upload the following sketch (the LoRa receiver sketch). This sketch listens for LoRa packets with the sync word you&#8217;ve defined and prints the content of the packets on the Serial Monitor, as well as the RSSI. The RSSI measures the relative received signal strength.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos &amp; Sara Santos - Random Nerd Tutorials\n  Modified from the examples of the Arduino LoRa library\n  More resources: https:\/\/RandomNerdTutorials.com\/esp32-lora-rfm95-transceiver-arduino-ide\/\n*********\/\n\n#include &lt;SPI.h&gt;\n#include &lt;LoRa.h&gt;\n\n\/\/define the pins used by the transceiver module\n#define ss 5\n#define rst 14\n#define dio0 2\n\nvoid setup() {\n  \/\/initialize Serial Monitor\n  Serial.begin(115200);\n  while (!Serial);\n  Serial.println(&quot;LoRa Receiver&quot;);\n\n  \/\/setup LoRa transceiver module\n  LoRa.setPins(ss, rst, dio0);\n  \n  \/\/replace the LoRa.begin(---E-) argument with your location's frequency \n  \/\/433E6 for Asia\n  \/\/868E6 for Europe\n  \/\/915E6 for North America\n  while (!LoRa.begin(868E6)) {\n    Serial.println(&quot;.&quot;);\n    delay(500);\n  }\n   \/\/ Change sync word (0xF3) to match the receiver\n  \/\/ The sync word assures you don't get LoRa messages from other LoRa transceivers\n  \/\/ ranges from 0-0xFF\n  LoRa.setSyncWord(0xF3);\n  Serial.println(&quot;LoRa Initializing OK!&quot;);\n}\n\nvoid loop() {\n  \/\/ try to parse packet\n  int packetSize = LoRa.parsePacket();\n  if (packetSize) {\n    \/\/ received a packet\n    Serial.print(&quot;Received packet '&quot;);\n\n    \/\/ read packet\n    while (LoRa.available()) {\n      String LoRaData = LoRa.readString();\n      Serial.print(LoRaData); \n    }\n\n    \/\/ print RSSI of packet\n    Serial.print(&quot;' with RSSI &quot;);\n    Serial.println(LoRa.packetRssi());\n  }\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/ESP32\/LoRaReceiver.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p>This sketch is very similar to the previous one. Only the <span class=\"rnthl rntliteral\">loop()<\/span> is different.<\/p>\n\n\n\n<p>You might need to change the frequency and the sycnword to match the one used in the sender sketch.<\/p>\n\n\n\n<p>In the <span class=\"rnthl rntliteral\">loop()<\/span> the code checks if a new packet has been received using the <span class=\"rnthl rntliteral\">parsePacket()<\/span> method.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>int packetSize = LoRa.parsePacket();<\/code><\/pre>\n\n\n\n<p>If there&#8217;s a new packet, we&#8217;ll read its content while it is available.<\/p>\n\n\n\n<p>To read the incoming data you use the <span class=\"rnthl rntliteral\">readString()<\/span> method.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>while (LoRa.available()) {\n  String LoRaData = LoRa.readString();\n  Serial.print(LoRaData); \n}<\/code><\/pre>\n\n\n\n<p>The incoming data is saved on the <span class=\"rnthl rntliteral\">LoRaData<\/span> variable and printed in the Serial Monitor.<\/p>\n\n\n\n<p>Finally, the next two lines of code print the RSSI of the received packet in dB.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>Serial.print(\"' with RSSI \");\nSerial.println(LoRa.packetRssi());<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Testing the LoRa Receiver Sketch<\/h2>\n\n\n\n<p>Upload this code to your ESP32. At this point you should have two ESP32 boards with different sketches: the sender and the receiver.<\/p>\n\n\n\n<p>Open the Serial Monitor for the LoRa Receiver, and press the LoRa Sender enable button. You should start getting the LoRa packets on the receiver.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"753\" height=\"443\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-receiverserial-monitor-esp32.jpg?resize=753%2C443&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-65101\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-receiverserial-monitor-esp32.jpg?w=753&amp;quality=100&amp;strip=all&amp;ssl=1 753w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/lora-receiverserial-monitor-esp32.jpg?resize=300%2C176&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 753px) 100vw, 753px\" \/><\/figure><\/div>\n\n\n<p>Congratulations! You&#8217;ve built a LoRa Sender and a LoRa Receiver using the ESP32.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Taking It Further<\/h2>\n\n\n\n<p>Now, you should test the communication range between the Sender and the Receiver on your area. The communication range greatly varies depending on your environment (if you live in a rural or urban area with a lot of tall buildings). To test the communication range you can add an OLED display to the LoRa receiver and go for a walk to see how far you can get a communication (this is a subject for a future tutorial).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/esp32-lora-field.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-64033\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/esp32-lora-field.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/esp32-lora-field.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>In this example we&#8217;re just sending an hello message, but the idea is to replace that text with useful information.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In summary, in this tutorial we&#8217;ve shown you the basics of LoRa technology:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>LoRa is a radio modulation technique;<\/li>\n\n\n\n<li>LoRa allows long-distance communication of small amounts of data and requires low power;<\/li>\n\n\n\n<li>You can use LoRa in point to point communication or in a network;<\/li>\n\n\n\n<li>LoRa can be especially useful if you want to monitor sensors that are not covered by your Wi-Fi network and that are several meters apart.<\/li>\n<\/ul>\n\n\n\n<p>We&#8217;ve also shown you how to build a simple LoRa sender and LoRa receiver. These are just simple examples to get you started with LoRa. We&#8217;ll be adding more projects about this subject soon, so stay tuned!<\/p>\n\n\n\n<p>You may also like reading:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/makeradvisor.com\/esp32-sx1276-lora-ssd1306-oled\/\">[Review] TTGO LoRa32 SX1276 OLED: Pinout, Specifications, etc\u2026<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/ttgo-lora32-sx1276-arduino-ide\/\" target=\"_blank\" rel=\"noreferrer noopener\">[Guide] TTGO LoRa32 SX1276 OLED Board: Getting Started with Arduino IDE<\/a> <\/li>\n<\/ul>\n\n\n\n<p><em>This is an excerpt from our course:&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/learn-esp32-with-arduino-ide\/\">Learn ESP32 with Arduino IDE<\/a>. If you like ESP32 and you want to learn more, we recommend enrolling in&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/learn-esp32-with-arduino-ide\/\">Learn ESP32 with Arduino IDE course<\/a>.<\/em><\/p>\n\n\n\n<p>Thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial we&#8217;ll explore the basic principles of LoRa, and how it can be used with the ESP32 for IoT projects using the Arduino IDE. To get you started, &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"ESP32 with LoRa using Arduino IDE &#8211; Getting Started\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/esp32-lora-rfm95-transceiver-arduino-ide\/#more-63668\" aria-label=\"Read more about ESP32 with LoRa using Arduino IDE &#8211; Getting Started\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":64069,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[276,281,277,299,264],"tags":[],"class_list":["post-63668","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32","category-esp32-project","category-esp32-arduino-ide","category-0-esp32","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/06\/LoRa-ESP32-thumbnail-1.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/63668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=63668"}],"version-history":[{"count":1,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/63668\/revisions"}],"predecessor-version":[{"id":159607,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/63668\/revisions\/159607"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/64069"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=63668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=63668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=63668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}