Showing posts with label lora. Show all posts
Showing posts with label lora. Show all posts

Friday, August 6, 2021

Lora Module Sx1278 (Ra-02) Interfacing With ESP8266 (NodeMCU)

Ankit jat

Interfacing Lora With NodeMCU

Ra-02 Work With ESP8266 Board

Lora Ra-02

In this article, I will teach you how to use the LoRa Module with a Nodemcu board. In this project, we will send a two-way message between two LoRa.

First of all, Collect the following devices -
  • 2 Lora Ra-02 (Sx1278) Module 
  • 2 MT7681 Antenna
  • 2 NodeMCU (ESP8266)
  • Some Jumper Wires
  • 2 Dc 5 Volt Supply For NodeMCU Either USB Or Input Pin

Now make Connections According to the table given below -
Lora Ra-02 NodeMCU
GND (All Pins Compulsory)GND
Keep In Mind - 
    That you have to connect all GND pins of LoRa to GND of NodeMCU. If you leave even one of the pins open, your device will not work properly.

If you have looked at the datasheet of the Ra-02 model, you will find that the Ra-02 model only works between 410 - 525 MHz frequencies.
You will need to choose a frequency between these for this project. I am choosing 433 Mhz.

You have to install the LoRa library, you can download it from here and then add it to the Arduino software.

Now you have to upload the code given below in both the NodeMCU

Code -


You can Download Code Here

Note - 
The same code is to be uploaded on both devices.

If there is an error uploading the code, you remove nodemcu from LoRa and then upload the code and re-add LoRa after uploading.
You have selected 115200 baud rate for both serial monitors

Finally, after everything is successful, you need to open the serial monitor, if it says "Device Activated" it means all your system is working properly, now you can send and receive messages. If you see a "LoRa error" written on the serial monitor, you should thoroughly check your connections as well as the frequency recorded.

To send a message you have to go to any serial monitor, type the message in its input box, and press enter, your message will be sent to another LoRa module. and it will appear on the second serial monitor