LoRaWAN (Long Range Wide Area Network) is a specification for a telecommunication network suitable for long-distance communication with little power.
The technology is used for machine-to-machine communication (Internet of Things).
The architecture consists of gateways, network servers and application servers. There are RF chips from Semtech used to transmit a spread spectrum.
Build LoRa node using Arduino Uno and HopeRF RFM95 LoRa transceiver module
Information
none
Operating system used
macOS Sierra
Hardware used
Arduino Uno rev3.0
The HopeRF RFM95 LoRa transceiver module is marked RF96 which means the chip is using the SX1276 chip.
The RFM95 and RFM95W are the same.
W=CE/FCC version for worldwide, without W=internal Chinese market only.
Bottom view. The frequency used in Europe is 868 MHz, for North America 915 MHz and for Asia 433 MHz. Make sure your HopeRF RFM95 LoRa transceiver module has the correct frequency.
Jumper wires 20 cm long (6x male-male and 3x male-female)
Breakable male pin headers (1 strip with 8 pins and 1 strip with 7 pins)
USB 2.0 cable type A/B
Insulated stranded copper wire 30AWG (conductor diameter = 0.254 mm).
The wire will be used as an antenna.
The wire must have a length (L) of:
173 mm (f = 433 MHz, for Asia)
86 mm (f = 868 MHz, for Europe)
82 mm (f = 915 MHz, for North America)
The antenna length (L) is calculated as follow:
c = λ x f
L = ¼ x λ
c = speed of light = 299792458 m/s
λ = wavelength (m)
f = frequency = 868000000 Hz (This frequency applies to Europe)
L = antenna length (m)
299792458 = λ x 868000000
λ = 0.34538 m
λ = 345.38 mm
L = ¼ x λ = 86 mm (This antenna applies for Europe)
Software prerequisites
none
Procedure
Create a LoRa node, part 1: HopeRF RFM95 LoRa transceiver module v1.2
Create a LoRa node, part 2: Prepare the module adapter plate
Create a LoRa node, part 3: Solder the LoRa module on the adapter plate
Create a LoRa node, part 4: Attach antenna to the LoRa module
Make the following jumper wire connections between the HopeRF RFM95 LoRa transceiver module and the Arduino Uno (R3).
HopeRF RFM95 LoRa transceiver module
Arduino Uno Pin
HopeRF RFM95 LoRa transceiver module
Arduino Uno Pin
ANT
-
GND
-
GND
GND
DIO5
-
DIO3
-
RESET
5
DIO4
-
NSS
10
3.3V
3.3V
SCK
13
DIO0
2
MOSI
11
DIO1
3
MISO
12
DIO2
-
GND
-
ANT = Antenna
GND = Ground
DIO = Digital Input/Output
NSS = Slave Select
SCK = Serial Clock (output from master)
MOSI = Master Out Slave In (data output from master)
MISO = Master In Slave Out (data output from slave)
Note:
Attach wire antenna to ANT pin.
The HopeRF RFM95 LoRa transceiver module has 3 GND pins.
It does not matter which GND pin you use.
Use at least one.
Do not use DIO2
The Arduino Uno uses SPI (Serial Peripheral Interface) to communicate with the LoRa transceiver module.
The Arduino Uno is the Master and the LoRa transceiver module is the Slave.
Wiring HopeRF RFM95 LoRa transceiver module and Arduino Uno (R3).
Click on the image for a larger image.
Instead of using two breadboards (MB-102 and SYB-170), you can make it more compact by using only the mini breadboard (SYB-170) and 4x 8pin headers.
LoRa module pin NSS (=.nss) is connected to Arduino pin 10
LoRa RFM95 module has no rxtx pin.
LoRa module pin RESET (.rst) is connected to Arduino pin 5
The 3 values in the .dio array {...}, refers to DIO0, DIO1 and DIO2 respectively.
LoRa module pin DIO0 is connected to Arduino pin 2.
LoRa module pin DIO1 is connected to Arduino pin 3.
LoRa module pin DIO2 is not used.
The line static uint8_t mydata[] = "Hello, world!";
contains the message which will be send fom the Lora module to the Gateway.
Connect the Arduino Uno to your computer, using the USB 2.0 cable type A/B.
Select Arduino menu: Tools | Board | Arduino/Genuino Uno
Select Arduino menu: Port | /dev/cu.usbmodemFD131 (Arduino/Genuino Uno)
Load sketch ttn-abp-diy-arduino.ino and press the Arduino Verify button. There should be no errors and warnings.
Upload the sketch to the Arduino Uno. There should be no errors and warnings.
Open the Serial Monitor, select menu: Tools | Serial Monitor
Select 115200 baud
Every 9 min the Single Channel LoRa Gateway will receive a message from the LoRa module.
The message is encrypted.
Login to the Things Network console and goto the "DEVICE OVERVIEW" screen.
Press the link "reset frame counters"
Select "Data" in the top right corner (see previous image). The received data is:
48 65 6C 6C 6F 2C 20 77 6F 72 6C 64 21
These are the hex values for "Hello, world!"
If you want to convert it into a readable text.
Select your application for example "diy_node" and in the "APPLICATION OVERVIEW" screen, select "Payload Formats".