logo froggy factory


Connect your objects yourself

Get started

How to get the shield

After the great success of the prototype Lora Fabian shield (Rev1.0), the next version (ES1.1) is now available for purchase.

You can order them, directly on the site, in the shop section.


For more details, or to be informed, please contact us. You may also subscribe to the newsletter at the bottom of this page.

(Shield Lora Fabian ES1.1)
(IDE Arduino)

Arduino interface

The Arduino interface is very simple, with few functions, you can send and receive messages

open source logo The source code is open source, it can be downloaded on the GitHub

Samples Arduino sketch to exchange Rx/Tx messages are also available in the package.

Arduino Library and example for V2 board :

Download GitHub Forggy board V2

Arduino Library and example for V3 board :

Download GitHub Forggy board V3

LoRa Shield library user guide

Introduction

This document describes how to use the LoRa Fabian shield with an Arduino.

LoRa is a brand new communication technology for Internet of Things. It is low power, low data rate and long range (several kilometers). It use the license free ISM band (ISM means industrial, scientific and medical).

Important note: There is no license needed to use this band but there is some rules to share the band with other users. An object must respect a duty cycle. The duty cycle is the ratio between transmission time versus wait or receive time. In this band there is sub bands with various duty cycles from 0.1% to 10%.

To simplify, all channels configured with LoRa_freq_channel() described bellow are 1% duty cycle except number four and five that are 10%.

So please be reasonable and respect this rule in your Arduino program.

Library

The Arduino library is implemented in the file lib_lora.ino. You can find it here:

https://github.com/Wi6labs/lorafabian/blob/master/ARDUINO_SKETCH/lib_arduino_beta/lib_lora.ino

To use it in your project you just have to copy it in your Arduino project folder (next to your main Arduino project file .ino).

Setup functions

The following functions are to be called in the setup() function of your project to configure the LoRa shield.

LoRa_init()

This function call is mandatory. It initialize the SPI interface and the shield.

LoRa_RF_config(int in)

This function call is optional. You can call it to change the radio configuration. Input parameter range is 0 to 4.

0 is the fastest datarate but less robust transmission channel.

4 is the slowest datarate but more robust transmission channel (better distance).

void LoRa_freq(long f)

This function call is optional. It allows you to change the radio frequency on which the message will be sent or received.

Input parameter is in Hz. Range is 863 000 000 to 870 000 000 Hz.

void LoRa_freq_channel(int nb)

This function call is optional. It calls LoRa_freq() with pre implemented radio frequency channel configurations. Its only goal is to simplify radio frequency management.

Input is the channel number. Its range is from 0 to 7.

Loop functions

The following functions are to be called in the loop() function of your project to communicate over the air.

LoRa_send(String in)

This function allow you to send a string over the air.

int LoRa_available()

This function is used to check if messages have been received by the shield.

It returns the number of bytes received. If no message have been received it return 0.

char LoRa_read()

When a message is received by the shield you must call this function to get the message on your Arduino. The message is returned one byte per one byte. So you must call this function as much as LoRa_available() says.

Example Transmit program

At first this program configure the radio in configuration number one and channel three.

Then it sends a text message every 3 seconds.

void setup() {

LoRa_init();
LoRa_RF_config(1);
LoRa_freq_channel(3);

// Warning always perform Serial.begin after LoRa_init
Serial.begin(9600);

}

// Send Example
void loop () {

LoRa_send("hehehe");
delay(3000);

}

Example Receive program

At first this program configure the radio in configuration number one and channel three. It is important to have exactly the same configuration on the transmit and receive device to achieve a transmission.

Then it checks for received message and print them on Serial if received.

void setup() {

LoRa_init();
LoRa_RF_config(1);
LoRa_freq_channel(3);

// Warning always perform Serial.begin after LoRa_init
Serial.begin(9600);

}
void loop () {

int avail;
byte c;

avail = LoRa_available();

if (avail){

Serial.print(avail);
Serial.print(" bytes received:");
// read bytes one by one
for (int i=0; i

c = LoRa_read();
Serial.write(c);

}
Serial.println("");

}

delay(100);

}

This two example are available in file lib_arduino_beta.ino. Just comment/uncomment the loop() section corresponding to transmit or receive example.

https://github.com/Wi6labs/lorafabian/blob/master/ARDUINO_SKETCH/lib_arduino_beta/lib_arduino_beta.ino

Hardware tips

Reset

There is a Reset button on the board. We linked the reset to the Arduino reset. This way, full system (shield + Arduino) is reseted when you press the button.

Note that the reverse is not true. When you press the Arduino Reset button, the shield doesn't reset. There is a voltage level shifter between the two boards. This component is unidirectional and it is routed from the shield to the Arduino.

If you don't like this behavior of Reset lines connected and you want to keep the two reset functions independent, you can remove resistor R129 on the shield. This way you will be able to reset either the shield or the Arduino independently.

Ceramic Antenna

To reduce price and size of the shield we choose a ceramic antenna. Performance can be good with it but you have to take care of antenna orientation regarding the peer device.

Here is the radiation pattern from the antenna data sheet:

logo froggy factory

As you can see, there is direction in which the antenna have bad performances, so you should take care of the orientation you choose for your device.

The easiest way to find a good position for your device is experimentation. Try different positions and see which one gives you the best results.

Radio propagation

You have to be aware that Radio link quality and performances are highly dependent of environment.


Better performances can be reached with:

- Outdoor environment.

- No obstacles.

- No high level radio interferer in the ISM 868MHz band.

- At least 1 meter above the ground.

=> In this conditions it is possible to achieve good qualities communications on several kilometers.


Radio performances are degraded with:

- Obstacles: buildings, trees...

- Inner buildings environments.

- High ISM 868MHz band usage by other technologies.


Radio communication are usually killed with bad topographic conditions. It is usually not possible to communicate through a hill, even very small.

How to change the Antenna

If you want to use the sma Antenna, you have two things to do:

- Mount the SMA connector on J112 footprint.

- Unmount resistor R128 and mount it on R135. It will cut the ceramic Antenna RF path and close the one to the SMA antenna. It may be a bit difficult to do if you are not used to. We recommend to use two solder iron to unmount the two side of the resistor at the same time. Then you will be able to grab it between the two solder iron, move it and mount it directly on R135.

Hardware schematic

You can download the hardware schematic (pdf version).