(Last Updated On: November 10, 2021)

Table of Contents:

Overview:

In the previous video, we have set up this LPS8 gateway and registered the same on The Things Network. We have also seen that the gateway successfully connected to the network server and transmitted its status message.
We have also explored that what are the event details included in that status message. Later we have developed a Lora end node that can be activated in ABP mode with RFM95 module and Arduino UNO to publish a “hello electronics innovation world!” message.

In this video, we will look into how to develop OTAA activation-based LoRa end node with Arduino Nano and RFM95 module to publish hello world message. as we have discussed earlier the data being transmitted over the LoRaWAN is encrypted, so we will also see how to decrypt that data and see what is the exact data present in that data packet.

So, Let’s see how we can do that.

Video Tutorial: How to make OTAA based LoRa Node?

 

Required components:

  1. RFM95 modules along with Breadboard friendly PCB breakout boards  – 1
  2. Arduino Nano
  3. Breadboard / Vero board
  4. Connecting wires

Making RFM95 Lora transceiver PCBWay.com

This RFM95 LoRa transceiver module does not breadboard friendly, which means we cannot solder these 2.54mm male headers to it, or we can place it neither breadboard nor Vero boards. So, I have designed a PCB to make it breadboard-friendly. We can extend the SMD pads of RFM95 with Male headers as shown here. So, that we can place it on both Breadboard and Vero board.

RFM95 breakout board

The PCB looks something like that below. The RFM95 module can be soldered on SMD pads. In 3D view PCB looking gorgeous right.

I have generated Gerber files and saved them into the available folder.

LoRa RFM95 Breakout PCB

PCBWay:

I have ordered the PCB on PCBway.com, PCBway.com is an online printed circuit board manufacturing enterprise that turns your DIY breadboard circuits into professional PCBs at just 5 dollars.

PCBWay.com offers all services you need to make Hardware for your IoT or Embedded Devices.
If you have a similar requirement, do check out their website for more details using this link.

 

PCBway.com

Later I have soldered the RFM95 module on the received PCB boards. I have clearly explained this process here. If you wish to have a look check it.

RFM95

Application Registration:

Visit The Things Network Platform, If you are a first-time user, Signup by providing all required details. Then log in to the platform using the same credentials. Then come to the Home.
Click on the username and select console.

Here we have two options create an application and register a gateway, choose to create an application.

The owner will be selected default, if you want you can change from here. Enter Application ID, this can be an alphanumeric string but only lower case alphabets are allowed, Then enter Application name, this can be anything. Uppercase alphabets are allowed here. If you want you can also add a description for the application here.
Then click on create an application. That’s it, a new application has been created.

Create application on ttn

In this application, we can add our END devices. If you have a ready-made device from any certified manufacturer, you can add that device in the section “from the LoRaWAN device repository”, but we are developing our device, so that can be added to the manual category.

Select the LoRaWAN version, we have to specify which version on the LoRaWAN our device is using. select MAC1.0.3 then select the operating frequency.
865-867Mhz selected, as I am from India.
Here you have to observe one thing if you are from India. the frequency plan 865-867Mhz is available on the MAC1.0.3 or later version only. You will not find the 865-867Mhz frequency band on MAC1.0.2 or the lower version.

Click on show advanced activation lorawan class and cluster settings, Select the activation Mode, Either it is OTAA – Over the air activation or ABP – Activation by personalization in our case it is OTAA.

Leave the rest of the settings default and click on generate DevEUI, App EUI, and App Key. We have to configure our End node with newly generated credentials.

Then click on the register end device. That’s it. The device has been created successfully.

Circuit Diagram:

Interface Arduino Nano with RFM95 module as shown in the circuit below.

After connections, the circuit might be something like this

Programming:

Visit this git hub page and download the Arduino-lmic library and then install it using the add zip library feature in the Arduino. After successful installation, you can find the library in the include library section with the name, IBM LMIC Framework.

Now go to the examples from the file menu and search for the IBM LMIC framework and then open the ttn-abp example.

Before uploading code to the node, we have to make some changes to work according to our frequency band and registration on ttn. We have to add Dev EUI, App EUI, and App key here. all the credentials can be found on the ttn. also, we need to make changes to a couple of library files.

I have clearly explained what are the changes needed to be done before uploading the sketch to the Arduino. I recommend you watch the video and continue the process.

Once all modifications are done successfully,  connect Arduino UNO with the laptop, select the board Arduino Nano, and port. then click on upload. after successful uploading open serial port with baud rate 115200,

if you see the EV_JOINING text on the serial monitor, congratulations. your Lora device is transmitting the Lora data packets.

 

Open ttn, go to Application live data, as you can see here we have received join request from the device and it is accepted by the join server & Network server. We have also received different data packets from the device with the hello world messages. we can also see the spreading factor signal to noise ratio, RSSI of the received data packet.

The Uplink message content is the encrypted data, but the data is decrypted and converted into human-readable format. I have already done this decryption process for this application in the previous article, that’s why the data is automatically decrypted and converted to human-readable format.

That’s it for this tutorial. we have successfully developed a Lora end node that can be activated in OTAA mode with RFM95 module and Arduino Nano to publish a “Hello world!” message. aslo we have successfully decrypted the Lorawan data packets.

Stay tuned to electronicsinnovation.com for the more interesting project on lorawan communications.

 

 

By Veeru

Leave a Reply