First steps with LoRa Radio Node (Arduino)

The LoRa Radio Node is an AVR Arduino board with a RFM95 LoRa module. This all-in-one LoRa module allows to have a LoRaWan device for a reasonable price around 15€. You need to add a battery (like a LS14500 3,7V battery) on the battery holder for a 4€ extra cost to make it mobile. LiPo option are also available using the power connector. Even if the connectors are looking like grove, they are not compatible so you will have to make your own wiring to connect extensions.

This post is reviewing how to getting started with this board to fire your first LoRaWan frame over The Things Network.

Powering the board

There are different ways to power the board:

  • You can use a LS14500 LiSo4 battery inserted in the battery holder. This will be the best use of the board as it takes half of the PCB so that’s better to use this space. The limitation of a such battery is the cost as you can’t recharge it. The use of Arduino low power is needed in a such configuration.
  • You can use a LiPo batteries 3,7V or 7,4V connected to the VCC/GND pins with a 2,54 pin spacing connector.
  • You can use the programming cable to supply a 3,3V. This is ok until you fire RF messages as in most of the case the FTDI cable only deliver 50mAh. This is ok for running the MCU, not for emitting on RF.

There is an issue to manage regarding power with this board: when you are using Lithium Thyonil LS14500 you need to take into account the current delivery capacity of the battery. It is normally 50mA not more. It means you can’t transmit on LoRaWan over 12-14dB. If you want to use more power (typically for North America) you need to select another source of power like a LiPo battery, LiFESo4 or Lithium Ion 3,7 & 3,2V can match with this kind of requirement. Check the previously linked post to find the one best matching with your need.

The second issue to manage is a bug into the LMIC library: even if you setup 14dB or less as transmission power, the device will transmit at +20dB. You will have a 120mA consumption peak. With a LS14500 your device will reboot right after trying to connect. Here is a major issue as the RFM95 on the board will require 50mA only when you will transmit at +5dB. You need to consider this point when selecting your battery.

See details of this issue at end of the post.

Programming the board

The LoRa Radio Node is a Arduino Pro or Arduino Mini compatible board. You need to select this type of board in Arduino tool to program it. Then you need to select the ATMega328P, 3,3V, 8Mhz subtype. With this setting you will be able to program the board with a FTDI Cable.

On the left you can see the kind of FTDI module I’m using. This have a male connector so you can easily adapt the pin mapping to the board as the LoRa Radio Node do not have a standard FTDI connector.

The cabling is following this mapping:

FTDI SideArduino board side
DTRDTR
TXRXI
RXTXO
3.3VVCC
GNDGND

Configuring the board

When you want to use that board with a LoRaWan stack you need to assign some of the pins to the RFM95 signals. The pin mapping is the following one:

Arduino GPIORFM95 signal
D10NSS (Chip select
D9Reset
D2DIO0
D5DIO1
D6DIO2
D7DIO3
D8DIO5

RFM95 DIO4 is unconnected.

The DIO1, DIO2, DIO3, DIO5 are not connected directly, they are connected through a Header J3 and, by default unconnected. This will have an impact when implementing the LoRaWan stacks as usually DIO0 and DIO1 are at least needed. So you will have to short the J3 corresponding pins. Only these pins need to be shortcut.

Please note this important point.

The Board led is as usual with Arduino associated with D13.

You can fin the detailed of the schematics on project GitHub.

Demo program

Now, as the setup is completed, we can upload our first sketch ! The sketch is the one I used for the RFM95 test previously. You can go to my post on RFM95 on Arduino to get it.

The only modification is the following lines for the configuration:

// Pin mapping
const lmic_pinmap lmic_pins = {
    .nss = 10,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 9,
    .dio = {2, 5, LMIC_UNUSED_PIN},
};

If you directly want to load a already configured sketch with a simplified access to the LMIC function you can take a look to my sample demo code for LoRa Radio Node V1.0 on Github.

Low Power & Power question

As in the previously given Github sample code, you can run the Arduino MCU low power mode. The result is quite good with a 70uA consumption during the sleep phase. I’ve been surprised by the 120mA peak on transmission as in Europe we are more around 60mA for 14dB. Let me know if you achieve lower consumption during sleep.

LoRa Radio Node v1.0 power consumption

The peak of current is due to a bug in the LMIC library for RFM95 (and others) board. According to the Semtech documentation the consumption during transmission may be the following:

Semtech SX1276 power consumption at transmission

The 120mA are corresponding to +20dB. This is out of standard and regulation for Europe so be careful with this.

So to go back to the normal transmission power and normal current consumption a battery will support you can make some change in the LMIC code until a bugfix will be provided.

Edit the radio.c file in the LMIC library and change as following: (I’m not fan of it actually bust its the best compromise I found.

static void configPower () {
#ifdef CFG_sx1276_radio
    s1_t pw = (s1_t)LMIC.txpow;
    if ( pw >= 20 ) {
        // limit current at 130mA / Activate PA Max Power
        writeReg(RegOcp,0x31);
        writeReg(RegPaConfig, (u1_t)(0x8F));
        writeReg(RegPaDac, (readReg(RegPaDac)&0xF8)|0x7);
    } else if ( pw > MAX_RFO_PWR ){
        // limit current at 130mA / Activate PA Max Power
        // use PA_BOOST
        if ( pw < 0 ) pw = 0;
        if ( pw > 15 ) pw = 15;
        writeReg(RegOcp,0x31);
        writeReg(RegPaConfig, (u1_t)(0x80) | ( pw - 2 ));
        writeReg(RegPaDac, (readReg(RegPaDac)&amp;0xF8)|0x4);
    } else {
        if ( pw < 2 ) pw = 2;
        if ( pw > MAX_RFO_PWR ) pw = MAX_RFO_PWR;
        // limit current at 80mA / use RFO 
        // max power 13dB on RFO (PA_HF)
        writeReg(RegOcp,0x27);
        writeReg(RegPaConfig, (u1_t)(0x00) | ( ((10*MAX_RFO_PWR - 108)/6) << 4 ) | (pw+(15-MAX_RFO_PWR)) );
        writeReg(RegPaDac, (readReg(RegPaDac)&amp;0xF8)|0x4);        
    }

In the lmic_project_config.h you need to add the following setting:

// Max RFO Power 0 when no power amplifier behind RFO
#define MAX_RFO_PWR 0

This is due to the RFM95 module: this module only have PA_BOOST connected and not RFO. As a consequence you have an over consumption for low power transmission. For +20dB you need 120mA (normal) but for +14dB you need 93mA. At +5dB you will consume 55mA. I assume the reason is related to the RFM95 module on boarded. I assume they are using 915Mhz version for all zone. Due to unmatching with the 868Mhz it is possible to get a such over-consumption.

This entry was posted in IoT, LoRa and tagged , , , , . Bookmark the permalink.

4 Responses to First steps with LoRa Radio Node (Arduino)

  1. Matt Koning says:

    Why did DIO1, DIO2, DIO3, DIO5 come on this board unattached? What can they be used for?

    • Paul says:

      DIOx are Semtech SX1276 interrupt lines. The LoRaWan stack is using some of them. So you need to connect some of them as indicated in my post.

  2. Erik Koning says:

    Hi,

    What is the reasoning for not having the DIO pins connected initially on this board?

    • Paul says:

      You may ask to board developers 😉
      I see two reasons:
      – The number of available IO on the board is really low, so it’s good to have some potentially available.
      – The DIO interrupt depends on the use of the communication (LoRa, LoRaWan, FSK …) so none of them are all needed depends on your use case. I assume you can also use the chip in a non interrupted mode.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.