The Wireless Connection: A Comparative Analysis of RF, LoRa, and nRF24 Modules
As you may know, I recently created my first version of an electric longboard using a simple RF transmitter and receiver to establish a wireless connection. This DIY setup was sufficient for the initial prototype but required upgrades as I progressed with improved designs.
In this video, we will explore the LoRa wireless communication method and compare it to the other two mentioned techniques: RF and nRF24 modules. We'll delve into how easy it is to use LoRa with an Arduino, its transmission range, and power consumption.
To begin, let's take a look at the LoRa module, which features patented modulation technology and transmits at 868 megahertz. This frequency falls within the ISM Band, also known as the Industrial, Scientific, Medical band, which is free to use in most countries. Unfortunately, the subject of wireless communication is quite complex and goes beyond the scope of this video.
After acquiring my LoRa modules, I found that there already exists an Arduino library with example sketches and a wiring description. This made it relatively easy to connect the pins of an Arduino Pro Mini to the LoRa boards. To create a receiver, I repeated the process and soldered an LED with a current-limiting resistor.
To program and power the boards, I added a 6-pin female header to each and connected a USB-to-Serial Converter, setting both boards to run at 3.3 volts. It's essential to note that the LoRa modules can only handle 3.3 volts, unlike the NRF24 modules which require 5 volts.
I then uploaded the transmitter example sketch to one board and the receiver sketch to the other, opening the receiver serial monitor to confirm that communication worked flawlessly. Next, I edited the code using the timer1 library, so that the LED would turn on when receiving data but also automatically turn off every second.
With the codes in place, my setup was ready for range testing. To compare it with the other two mentioned modules, I built an nRF24 receiver and transmitter using two more Arduino Pro Minis and the final transmitter and receiver pair with generic RF modules and two Arduino Nanos.
For the codes, I used the TMRH20 library for the nRF24+ and the VirtualWire library for the generic RF modules. According to the LED, the nRF24 wireless connection worked without any issues, but the generic RF module setup had problems with the TimerOne library.
To determine if we got a successful connection, we observed the small TX LED. I then grabbed my laptop and a power bank and started outdoor experiments, powering the transmitter of the nRF24 system and walking away in an open area with the corresponding receiver.
After only 5 meters, the LED started acting strangely, and after around 10 meters, it stopped working altogether. The generic RF module setup fared slightly better, allowing us to walk approximately 10 meters before the LED began acting strangely, and around 25 meters before it stopped lighting up.
It was now time for the LoRa setup, which I attached the antennas to before starting the test. During the first round, we managed a distance of 90 meters before the LED started acting strangely, followed by an impressive range of 140 meters as the system stopped receiving data and held the transmitter above the air.
To wrap up our analysis, let's look at the current consumption of each module. The nRF24 required the most current during receiving (14 milliamps) but almost nothing during sending. The LoRa setup consumed 10 milliamps during both receiving and sending. Finally, the generic RF modules had the lowest current consumption, with 2.9 milliamps during receiving and around 0.3 milliamps during sending.
The last thing to consider when choosing a communication method for your project is the data transfer rate. The generic RF module offered only 4 kilobits per second, while LoRa offered up to 37.5 kilobits per second, and nRF24 had speeds of up to 2 megabits per second.
In conclusion, LoRa with its long range does offer interesting project implementation possibilities that I will explore further in the future, but it is certainly not a solution for all wireless projects.
I hope you enjoyed watching this video. Don't forget to like, share, and subscribe, and stay creative until next time!