Sending and Receiving Weather Data with a LoRa Module
We have an updated version of Lora Module that uses qwiic connector systems.
No complicated wirings or mistakes, just connect using qwiic cables and you're all set!
Check out the Zio Qwiic LoRa Module here!
It's an accomplishment to read weather data on the Arduino IDE. It's an even bigger one if you can transfer that data to a whole other Arduino/display device. Let's take reading the data one step further and transmit it across LoRa radio frequencies.
In this tutorial, we’ll use an Arduino Uno board with two LoRa Ra-01 modules to read a DHT11 module’s humidity and temperature data. One LoRa will be used as a transmitter, transferring the sensor data to the other, receiver, LoRa.
For this tutorial you'll need:
- 2x Lora Ra-01 module (soldered on the adapter board)
- 1x DHT11 temperature sensor
- 2x Arduino Uno Board
- Dupont wires
Note: to import the Lora Library, move the folder into the Arduino library folder in your Program Files, C Drive.
Here are the connections you'll need to make between all the devices.
For the DHT11 sensor module, the far-left pin is the VCC power pin, the second from the left is the data pin, the third is ignored, and the far-right pin is the GND pin. We used an adapter board in our tutorials which eliminates the pin we want to ignore.
|LoRa Module||Arduino Uno|
Receiver LoRa (The same as Transmitter, only difference is no DHT11 parts)
|LoRa Module||Arduino Uno|
Once we're connected, let's flash the transmitter (sender) code to the transmitter Arduino and the receiver code to the receiver Arduino. Don't forget to restart your IDE after placing the library into the Arduino Library. You'll also need to remember to switch the ports each time you plug in the other Arduino so you don't accidentally override the other's code.
After the codes have been uploaded and run in each respective LoRa, switch the PORT to the receiver Arduino, and check the serial monitor. You should be getting humidity and temperature data strings.
Next challenge is to display the data on an external module!
lora ra-02 send temperature direct
Did u get the good result? i have problem.can u help me plz?
Hii am using the same connection as per the instruction given above but while running the code for receiver i am getting as serial output "init failed". i need your helpArduino uno 368p lora RA01 Arduino 1.6.7
hi Viky,It means the receiver initiation is wrong, then you will need to check the possible mistake like the connection, the soldering of Lora module, the lora module is still good or not.Alex
hello,1. Why we can connect arduino 5v and RA-01 3.3V directly?(without level shifter) 2. Specs says 20 dbm max. RH_RF95.setTxPower(23,true) according doc sets 23 dBm. How correctly set max Power? And what it will be? 3. In SX1278 data sheet (page 84 in my version) is stated "Duty Cycle of transmission at +20 dBm output Max 1%". Is it safe to operate at max power constantly? (for example transmitting SX1278.setModemConfig(RH_RF95::Bw125Cr48Sf4096) 60 Bytes takes about 2 seconds.Is it safe transmitting messages at max power every 3 seconds?)Thank you in advance for the answers.
This is Alex from Smart Prototyping.com. Thanks for your message. 1. It is better to use leve shifter, then connect it to Lora module, that would be safer, connect 5V to LoRa is only for short time testing. 2. The code can set a max power, and it could change the power for the module, but it might not be the same when you use the equipment to measure the radiation power. 20dbm is the real power the manufacturer measured in the lab. 3. Yes, it is safe.
Thank you very much for prompt replay!
Hello, I have stucked at rf95.available(), It returns false every time. I'm sure about pin connections. Do you have any opinion?
Try to change LED=9 to LED=8 as I think LED=9 is a reset
I need to send the data continuosly using loop. since i am a beginner i don't know how to use the syntax, so please kndly help me with the updated code using loop. Thank you.
I cant get a full code will you please send me the full code
Aku mau bertanya bagaimana cara mengirim data yang berbeda dalam waktu yang bersamaan yang dimana saya ingin mengirim data sensor udara dan debu bersamaan menggunakan lora ro-2 Terimakasih
I am using Arduino pro mini for the sender and Arduino Uno for the receiver, I am getting nothing other than init failed! in the receiver Arduino, since the code I am using is same as yours and the connections are right, I am wondering if there is any other bug/mistake in my system.
I'm trying to add a library and nothing ;/ arduino ide can't see this library. When i go to arduino-> sketch-> add library -> add library zip i get the info "this file don't have corect library. (this is translate from polish so your info can be little bit different) When i go to the document -> arduino -> librares and extract the zip to this folder, then i open arduino ->file->exampel and see "inconsistent", when i copy the code and paste into the arduino, i clik the "verify" or "compile" i get the error "RH_RF95.h: No such file or directory"
Hi Mikolaj, I am Aswana from Smart Prototyping.com. For your issues, have you tried to update the recently installed library? Including libraries manually will need you to also manually update the library for your Arduino IDE. To do that, go to Sketch > Include Library > Manage Libraries.Wait till it finishes installing and updating then try again to run and upload the code to your device.Make sure there is no other folder after RadioHead-master when you manually extract the zip file. The directory should be RadioHead-master > all the files like examples , and etc should be in this tree after clicking the master folder.
How do you want to display on LCD?
Hello, Where can I find this pin header which you are using with lots module (like .1" or 2.5mm etc)? can you please tell me which one you are using here?
will you provide me the full code please
Hi Andrea, Full code has already been given on the link above.
hi sir , i am using the same connection as per the instruction given above but while running the code for receiver at receiver serial monitor did not show any data about temperatutre....plzzz reply
Sir, Can you share the arduino codes that I2C format with lora module of this project please or give an information? Have a nice day.
When More than one sender are avilable Iam recieving only one sender data.It is not working properly. If you have tried please reply
Hi was wondering if it is possible to replace one arduino uno with one pro.mini.328p
this is the problem -RH_RF95 SX1278; when i am uploarded the code this will highlight. RH_RF95 SX1278; i included SPI ,SX1278, RH_RF95_h libraries. how to fix this?
Guys i have build this all up, my connection is checked, i'm using an uno and a mega 2560 , i know mega has different SPI pins its done. I have uploaded the codes * yet in port 4 of the mga i get in the monitor init failed and at port 5 of the uno monitor i get nothing. Why is that, why its not working?Any answers would be helpfull
guys, i have used Sx1272 lora module and i used this code for this module. can anyone tell the connection of sx1272 with arduino? when i send data it easily sends but on receiver side it comes with an error of "init failed". how can i solve this error?
Would this work with an ultrasonic sensor like HC-SR04? What would be the alteration in the byte command? Thanks Jeff
How do we trigger the receiver to receive data from the transmitter.
Hi guys, How LoRa coding data? I want to have safely network.security is important for me.which parameter or register is about it?
Hi Masoud,You can encode the data on the transistor Lora side, and decode it on the receiver Lora side. You can define it by yourself depends on what kind of security level you want. In this demo we didn't add this part.
Hi I used rf95 with Arduino I set pin 9 for rst. I get Error when initializing of LoRa. If(!rf95.init());I checked circuit and wires. How can I Resolve it?