Sending and Receiving Weather Data with a LoRa Module

Posted by Noah, 02/11/2017
Update:
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:

 

Hardware:

 

 

Software:

 

 

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.

 

Transmitter LoRa:

 

LoRa ModuleArduino Uno
GNDGND
3.3V3.3V
DIO0D2
NSSD10
SCKD13
MOSID11
MISOD12
DHT11 SensorArduino
GNDGND
3.3V3.3V
DataA0

 

Receiver LoRa (The same as Transmitter, only difference is no DHT11 parts)

 

LoRa ModuleArduino Uno
GNDGND
3.3V3.3V
DIO0D2
NSSD10
SCKD13
MOSID11
MISOD12

 

 

 

 

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!

 

24 Comment(s)

name:
26/05/2018, 11:15:36 AM
Reply

lora ra-02 send temperature direct

ishan asanka:
23/05/2019, 12:31:04 PM

Did u get the good result? i have problem.can u help me plz?

viky:
03/06/2018, 06:02:06 AM
Reply

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

alex:
04/06/2018, 02:44:09 AM

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

Albertas Galin:
07/06/2018, 02:48:36 PM
Reply

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.

alex:
08/06/2018, 02:51:54 AM

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.

Albertas Galin:
08/06/2018, 05:53:19 AM
Reply

Thank you very much for prompt replay!

Ferhat Kortak:
21/06/2018, 10:53:29 AM
Reply

Hello, I have stucked at rf95.available(), It returns false every time. I'm sure about pin connections. Do you have any opinion?

Brendan Murray:
10/07/2018, 11:57:18 AM
Reply

Try to change LED=9 to LED=8 as I think LED=9 is a reset

gowtham:
17/09/2018, 06:28:03 AM
Reply

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.

suba:
21/09/2018, 12:24:53 PM
Reply

I cant get a full code will you please send me the full code

Cimmang:
23/10/2018, 07:25:23 AM
Reply

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

Ayanle:
12/01/2019, 11:03:48 AM
Reply

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.

Mikolaj:
13/01/2019, 09:28:32 AM
Reply

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"

Aswana:
14/01/2019, 02:59:42 AM

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.

Thien Khai:
16/01/2019, 10:09:07 AM
Reply

How do you want to display on LCD?

Pratik:
05/02/2019, 03:01:30 AM
Reply

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?

andrea:
23/02/2019, 06:38:48 AM
Reply

will you provide me the full code please

Aswana:
26/02/2019, 07:14:13 AM

Hi Andrea, Full code has already been given on the link above.

omkar:
17/03/2019, 05:39:20 PM
Reply

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

Celil Yilmaz:
20/04/2019, 12:30:11 PM
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.

Venugopal:
27/04/2019, 12:54:31 PM
Reply

When More than one sender are avilable Iam recieving only one sender data.It is not working properly. If you have tried please reply

TASOS:
27/04/2019, 06:20:17 PM
Reply

Hi was wondering if it is possible to replace one arduino uno with one pro.mini.328p

ishan asanka:
03/05/2019, 05:01:26 AM
Reply

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?

Project for University:
12/05/2019, 01:47:17 PM
Reply

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

project:
20/05/2019, 11:10:55 AM
Reply

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?

Jeff:
05/06/2019, 12:02:53 AM
Reply

Would this work with an ultrasonic sensor like HC-SR04? What would be the alteration in the byte command? Thanks Jeff

Carl Anthony Santander:
22/06/2019, 06:21:08 AM
Reply

How do we trigger the receiver to receive data from the transmitter.

masoud:
12/07/2019, 08:49:13 PM
Reply

Hi guys, How LoRa coding data? I want to have safely network.security is important for me.which parameter or register is about it?

Alex chu:
15/07/2019, 02:26:11 AM

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.

Leave a Comment