In this article, we’ll be talking about the usage of radio transceivers NRF24 and LoRa and their pros and cons when used as wireless devices to transmit data between two Raspberry Pis.
Time to read:
When it comes to IoT projects connectivity, there are many popular mediums that are being used to enable communication between multiple Raspberry Pis or other microcontrollers. Some of the most popular methods are through WiFi/LAN or Bluetooth which usually come built-in to the Raspberry Pis. But, what if you have a few dozens of Raspberry Pis in a building that needs to be connected together? And WiFi or Bluetooth is not an option?
A good example for this are Wireless Sensor Networks. As Silvia and Sinha states, ‘Wireless Sensor Networks are spatially dispersed and dedicated sensors that monitor and record the physical conditions of the environment and forward the collected data to a central location. WSNs can measure environmental conditions such as temperature, sound, pollution levels, humidity and wind’. So, as the name suggests the WSNs require having multiple ‘sensor-nodes’ which transmit back to a base station or the central location through some form of network connectivity.
Therefore, it is apparent that these ‘nodes’ should not be too complex and most often, not power hungry. Therefore, WiFi and Bluetooth are easily ruled out as connectivity options.
This is where RF (Radio Frequency) communication devices come in.
There are many types of RF communication devices and protocols available in the technology market. However, there are multiple technologies that have been recently subjected to discussion due to their extreme versatility and features. Two of the most popular modules from those are Semtech's SX1278 LoRa module and the Nordic’s NRF24L01 modules.
The Semtech’s LoRa SX127x series transceivers features the patented LoRa® communication protocol (software/hardware) and works from 137MHz to 525MHz ISM radio band. This allows this module to be used in any country without special permissions. Also, this module has following key features:
Transmission: 20-120mA (selectable power output)
Reception: 10.8-12.0mA (Booster enabled or disabled)
These modules are used typically in:
And due to the operating voltage of 3.3V and the SPI connectivity, this can easily be interfaced with a Raspberry Pi to add RF connectivity to your Pi. These modules also come in multiple configurations and package sizes, enabling the easy integration into products.
CircuitDigest has an awesome article written by Aswinth Raj on How to connect the SX1278 LoRa module to Raspberry Pi.
The NRF24L01+ is manufactured by Nordic Semiconductor ASA and is an equally powerful and versatile device as the SX1278. This module operates in 2.4GHz and has a special protocol named Enhanced Shock Burst (ESB) to enable high power transmission and reception at lower power consumption.
Following are some of the key features of the NRF24L series radio transceivers:
5V tolerant input pins
900nA power down and 26uA standby mode current
Typical applications of the NRF24L01+ radio includes:
Similar to SX1278, the NRF24L01+ also features the SPI interface, enabling easy communication with the Raspberry Pi.
The NRF24L01+ also comes in multiple configurations as modules from different vendors. The NRF24L01+PA+LNA model features a separate antenna for the module, which improved the transmission and reception capability of the module(s).
To interface an NRF24L01+ module with a Raspberry Pi, check out this link for a guide created by Wirekraken.
At first, one might be tempted to go for the SX1278 LoRa module, since it has a significantly larger range. Yes, that was the case for us too. But considering the maximum bandwidth supported by the modules, the NRF24L01+ offers a much higher bandwidth (2Mbps vs. 37.5kbps) so if you need high bandwidth for larger datastreams such as Audio or constant up-link for real-time data, the NRF24L01+ might be the best solution for you.
The SX1278 really shines where there are power constraints as it only consumes about 20mA at transmission and 10mA at reception, and this can be brought down further by tweaking the configuration of the module. GreatScott does a thorough test on those modules and presents a final verdict on the modules’ power and performance.
One of the drawbacks of the NRF24L01 series is that they do not offer the full-duplex communication as SX1278 therefore it is not favorable in conditions where bi-directional communication is preferred. However, there are methods that can overcome this shortcoming by using methods such as TDM(Time Division Multiplexing).
Lastly, there’s no clear winner in this competition since both modules are equally powerful and one holds advantages over the other in different aspects. Ultimately, considering the requirements, the selection is up to the user.
For more information regarding the SPI subsystem of Raspberry Pi, feel free to check this article written by the Raspberry Pi foundation
Now that you have your wireless sensor network running, how about accessing your base station, the Raspberry Pi and managing it remotely? Well, that’s where we come-in to help you.
We offer you a range of services, up-to-date with the industry standards and requirements to provide you a one-stop-shop for all your embedded Linux edge IoT device management solutions. Sign up for the free trial through this link and explore what JFrog Connect has to offer!