_:ndffdf2ebb6274ed3a9b44028ebe54239xb0
<http://schema.org/articleBody>
"TTGO LoRa32 with Arduino:\r\n&nbsp;\r\nESP32 LoRa Oled, LILYGO TTGO LoRa32 SX1276 with Arduino, Range Test- I have finally received the parcel that I was eagerly waiting for.\r\n\r\n\r\n\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nSo, let's go ahead and start the unboxing. The first thing I found inside this was this business card.\r\n\r\nIf you have any business-related, sales-related, or technical questions, you can contact them through the email IDs provided on this card. You can find the official LILYGO website link on the back of the card. I have personally visited their website, and they have an amazing collection of development boards, displays, wearable kits, and many other basic modules. Anyway, inside the box, I also found a pair of these plastic boxes.\r\n\r\n\r\nLet’s check what’s inside these boxes. The packing is quite impressive.\r\n\r\n\r\nInside this box we have a LoRa32 V1.0 868Mhz, LoRa Antenna, male headers, and a battery connector JST 2 pin 1.25mm.\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\n\r\n\r\nSo, guys, this is the TTGO LoRa32 868MHz V1.0 based on the SX1276 chip combined with ESP32 WiFi + Bluetooth and an I2C supported 0.96-inches OLED display module. So many things on this tiny board, its quite impressive.\r\n\r\nAnyway, I have received two of these development boards, and as you can see, both modules are identical. With the help of these development boards, now I can easily test ESP32 and LoRa-based projects. I don't even need to attach the OLED display module. You can use any of these modules as a receiver or transmitter. As these development boards are based on the ESP32 WiFi + Bluetooth, you can make IoT gateways and use your cellphone to send and receive messages, control, and monitor different types of loads and sensors.\r\nWell, I have already used ESP32 and LoRa in many projects before. But this time, I am very excited about the communication range of these modules. Previously, I was using LoRa SX1278 transceiver modules, which had a range of around 118 meters, and I was able to control some loads. In this test, both LoRa modules were in line of sight. But when both modules are not in line of sight, the communication range drops to around 50 meters, which is quite low.\r\n\r\n\r\nJust look at the size difference of these two LoRa modules, this one is 433Mhz SX1278 and the TTGO LoRa32 is based on the SX1276 and is 868MHz. Later in this article, I will perform a complete range test.\r\n\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nAmazon Links:\r\nTTGO LoRa32 V1.0 / Official product link\r\n\r\nArduino Nano\r\n\r\nSX1278 LoRa\r\n\r\n*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.\r\nTTGO LoRa32 Specifications:\r\n\r\n \tThe operating voltage is 3.3 to 7 volts\r\n \tIt is based on ESP32 WiFi + Bluetooth.\r\n \tOperating temperature range is from -40 to 90 degrees Celsius.\r\n \tSupport for Sniffer software protocol analysis, Station, SoftAP, and Wi-Fi Direct modes\r\n \tData rates: 150 Mbps @ 11n HT40., 72 Mbps @ 11n HT20, 54 Mbps @ 11g, 11 Mbps @ 11b\r\n \tTransmit power is 19.5 dBm @ 11b, 16.5 dBm @ 11g, and 15.5 dBm @ 11n\r\n \tReceiver Sensitivity is up to -98 dBm\r\n \tUDP sustained throughput is 135 Mbps.\r\n \tIt has an onboard lithium battery charging circuit and it can be programmed using the Arduino IDE.\r\n \tThe board also has IPEX interface for connecting the 868 MHz Antenna.\r\n \tThe board also has a Red Light power indicator and a Blue light connected to IO25 which is programmable.\r\n \tThe LoRa32 board also has CH9102X.\r\n\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nLoRa 1276 Vs LoRa 1278:\r\nLoRa 1276 and LoRa 1278 are both LoRa radio modules produced by the company Semtech, which use the LoRa modulation technology for long-range, low-power wireless communication.\r\nThe main difference between the two modules is their frequency bands:\r\nLoRa 1276 operates on the 868 MHz band (EU) or 915 MHz band (North America).\r\nLoRa 1278 operates on the 433 MHz band (EU) or 470 MHz band (China).\r\n433E6 for Asia\r\n866E6 for Europe\r\n915E6 for North America\r\nIn addition to the frequency bands, there are some other differences between the two modules:\r\nThe LoRa 1278 has a higher output power than the LoRa 1276, with a maximum transmit power of 100mW compared to 22dBm (158mW) for the LoRa 1276.\r\nThe LoRa 1278 has a lower receiver sensitivity than the LoRa 1276, which means that it can receive weaker signals.\r\nWhen choosing between these two modules, it's important to consider the frequency band that is legal in your region and the specific requirements of your application. If you need a higher output power, the LoRa 1278 may be a better choice, but if you need better range or the ability to receive weaker signals, the LoRa 1276 may be the better option.\r\nCH9102X:\r\nTTGO LoRa32 has an onboard CH9102X. CH9102X is a USB to UART/I2C/SPI/TTL/PS2 interface converter chip produced by WCH (Nanjing Qinheng Microelectronics Co., Ltd.). It allows a microcontroller or other electronic device to communicate with a computer via USB.\r\nThe CH9102X chip supports multiple serial communication protocols, including UART, I2C, SPI, TTL, and PS2. It also supports multiple baud rates, data formats, and parity settings, making it a versatile solution for a wide range of applications.\r\nThe chip is typically used in embedded systems, industrial automation, instrumentation, and other electronic devices that require communication with a computer or other host system. It can also be used for programming and debugging microcontrollers and other devices.\r\nWCH provides drivers for Windows, Linux, and Mac OS, making it easy to integrate the CH9102X chip into various operating systems. The chip is available in a variety of packages, including QFN32, SSOP28, and DIP28, to suit different design requirements.\r\n\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nTTGO LoRa32 Pins Diagram:\r\n\r\nYou can download this Pinout diagram from the LILYGO official website. You can see the SSD1306 Oled display module SDA and SCL pins are connected to the Pins 04 and 15. And the SX1276 LoRa transceiver module MOSI, SCLK, CS, DIO, RST, and MISO pins are connected to pins 27, 5, 18, 26, 14, and 19. All the other pins are clearly labeled. You can see the 5V and 3.3V pins are available on both sides. We have got three GND pins. And all these other GPIO pins can be used for connecting input and output devices.\r\n\r\nIt would have been perfect if the pins labeling was done on the top side. Because once its inserted into the breadboard then the pins labels are gone. Anyway, let’s go ahead and solder the male headers and then I will explain the interfacing and programming. Anyway, while doing the soldering be very careful not to damage the Oled strip.\r\n\r\nMale headers are soldered on both the modules and now, let’s go ahead and take a look at the circuit diagrams.\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nTTGO LoRa32 Transmitter Side:\r\n\r\nOn the Transmitter side, I have connected a potentiometer and a button. The Potentiometer middle leg is connected to the GPIO34 and the other two legs of the Potentiometer are connected to the 3.3V and GND pins. While the button is connected to the GPIO12.\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nTTGO LoRa32 Receiver Side:\r\n\r\nOn the receiver side I have connected an LED. And I am going to control this LED using a button on the transmitter side\r\n\r\nI have connected everything as per the circuit diagrams. This is the transmitter side and this is the receiver side. On the transmitter side I am going to use this button to control this LED on the receiver side. And I am also going to send the Potentiometer value to the receiver where it will be printed on the Oled display module. So, its just a basic setup to explain how to establish wireless communication and most importantly to check the communication range. Anyway, let’s go ahead and take a look at the transmitter and receiver side programming.\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nLoRa32 Programming:                                      \r\nIf you already have an ESP32 board installed, then there shouldn't be any problem, you just need to install these libraries.\r\nAdafruit_GFX\r\nAdafruit_ssd1306\r\nBut if you don't have an ESP32 board installed, then you need to install it first, and the complete process is explained in the article Getting started with ESP32 WiFi + Bluetooth Module.\r\nAnyway, once you install the ESP32 board then you can go to the Tools menu, Board, ESP32 Arduino, and from the boards list you can select TTGO LoRa32-OLED.\r\n\r\nTTGO LoRa32 Transmitter Side Code:\r\n[crayon-66fcdaec28080199912492/]\r\nIf you take a look at this code, you will find that its almost 95% similar to my previous LoRa based codes. The only modifications are, this time I changed the pin numbers as per the new TTGO LoRa32 development board. And as you can see I am using the same localAddress 0xBB and the destination address 0xFF. I like defining the addresses, this way I can communicate with multiple LoRa modules. I have already demonstrated this in my previous LoRa based Projects.\r\nSo, the purpose of this code is to read the button and Potentiometer and send its values in a message as you can see the values are comma separated. The message is sent to the receiver side and at the same time these values are also printed on the Oled display module. And I didn’t make any changes in this sendMessage function. Now, let’s take a look at the receiver side programming.\r\n\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nTTGO LoRa32 Receiver Side Code:\r\n[crayon-66fcdaec280a3385418139/]\r\nOn the receiver side, I am using the same libraries and pins but this time as you can see the localAddress is 0xFF and the destination address is 0xBB. Now, let’s go to the loop function.\r\nFirst we read the message and then we split the message using a user-defined function getValue. We use comma as the delimiter. So, the button state and Potentiometer values are stored in separate variables. The buttonstate value is used to control an LED and also both the values are printed on the Oled display module.\r\n\r\n[crayon-66fcdaec280aa152566698/]\r\nAnd this is the getValue function which is used to split a message. I have been using this function in all my LoRa based projects. I have already uploaded the programs and now let’s watch the TTGO LoRa32 in action.\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nPractical Demonstration:\r\n\r\nI have powered up both the transmitter and receiver. The receiver side is connected to my Laptop and I have powered up the Transmitter side using a designed 4S Lithium Ion Battery Pack and my designed 5V 3A power supply. But you can use a single lithium-ion cell.\r\nAnyway, you can already see the button state which is 0, and the Potentiometer value. As I press the button on the transmitter side, the button state is changed on the receiver side. I can use it to control an LED. But I didn’t connect it, unfortunately, my 2nd breadboard just disappeared.\r\n\r\nAnd you can also see the Potentiometer value which changes as I rotate the knob of the potentiometer. As you can see in the image below, the value changed from 61 to 4084 and I also changed the button state from 1 to 0 by pressing a button on the transmitter side.\r\n\r\nThere is small latency “around 1 second” due to the delay used in the programming. You can reduce the delay if you want fast communication speed. So, its working. And now we are going to perform the range test.\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nLoRa32 Range Test:\r\nTTGO LoRa32 Out of Sight Test:\r\nDuring the first test, I kept the receiver side LoRa32 inside the room and I asked my brother to take the transmitter side outside. Because I wanted to check if the signals were powerful enough to penetrate through walls and different obstacles.\r\nDuring this test, I was asking my brother about his location to find out how far these modules could communicate. Then, at one point, the communication stopped. When I checked on Google Maps, the distance was 77 meters. While the SX1278 communication range was 50 meters, the difference is 25meters, seriously I was expecting more. But anyway, during this test the LoRa32 is the winner.\r\n\r\nThis is the distance when both LoRa modules are out of sight and there are walls and obstacles in between, as you can see in the image.\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nTTGO LoRa32 Line of sight Test:\r\n\r\nNext, I came to this open location to perform the 2nd test. Let’s see from how far these LoRa32 modules can communicate when in line of sight.\r\n\r\nMy brother is right there and he can receive the data. I was talking to him via cell phone. I checked the distance on google map and the distance was “428 meters“.\r\n\r\nNext, I cam back to my home and right now I am on the roof and from here I can see the mountain.\r\n\r\nAnd the amazing thing is still he can receive the data. Although the modules are not completely line of sight but still its working. I think we are outside that’s why.\r\n\r\nAs you can see on Google Maps, the maximum communication range is “870meters“ this is simply amazing. Its such a long distance.\r\nI am sure if these modules are installed at some height, they might be able to communicate over a long distnce even more than 1.5Km. And then you will be able to monitor your sensors, or control your electrical loads over such a long distance. So, that’s all for now.\r\nSupport me on Patreon for more videos I hope you like today’s episode. Like and share this video with your friends. See you in next episode and thanks for watching.\r\n\r\n\r\n\r\n\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n\r\nWatch Video Tutorial:\r\nhttps://youtu.be/2ADysaDa3JM\r\n\r\n&nbsp;\r\n\r\n&nbsp;"
<https://www.electroniclinic.com/esp32-lora-oled-ttgo-lora32-sx1276-with-arduino-range-test/>