RFM69 radio modules: Not getting stated range

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ValenceElectrons
 
Posts: 20
Joined: Sat May 21, 2022 11:47 pm

RFM69 radio modules: Not getting stated range

Post by ValenceElectrons »

My post deals with not getting the stated (desired!) range from RFM96 radio modules on Raspberry Pi's.
My setup:
* A Pico connected to an RFM96HCW 915MHz Radio Breakout Board (Adafruit product 3070) with a spring 915MHz antenna (Adafruit product 4269) soldered on.
The Pico has a sensor and sends data to:
* A PiZeroW connected to an RFM96HCW 915Mhz Radio Bonnet (Adafruit product 4072) with an identical spring antenna soldered on. (WiFi and BT turned off in /boot/config.txt)

The test programs for both units use CircuitPython. For the test, the Pico sends a 20-byte packet every 10 secs, and the PiZero receives using default timeout frequency (0.5 sec). Both radios are similarly initialized and configured:

Code: Select all

    rfm69 = adafruit_rfm69.RFM69(spi, CS, RESET, 915)
    rfm69.tx_power = 20
    rfm69.bitrate = 10000
And the "send" is also vanilla:

Code: Select all

     rfm69.send(bytes(msg, "utf-8"))
Both radios are positioned with their antenna vertical, with the two units in unobstructed line-of-sight.

I can get about 200m before I start losing packets, and at 225m I appear to be about at the limit. When I start out, the PiZero shows a "last RSSI" of around -20db, when I reach 150m or so it's down to -80, and at 200m it's at -85 or less. This seems well below the claimed 500-1500m range line-of-sight for the radios.

Any suggestions on why the range is so low and how to improve this? (Short of going to LoRa with a higher power draw.)
Additional configuration?
Different antenna (although I want to keep the package small)?

User avatar
languer
 
Posts: 102
Joined: Fri May 17, 2013 2:02 pm

Re: RFM96 radio modules: Not getting stated range

Post by languer »

I've been using the RFM69 devices for some time now and they are pretty reliable. Your numbers certainly do call for some attention. But in my case I have used the Arduino LowPowerLabs library and have not deviated much from the standard settings. In your case you are using the circuitpython library and are purposely changing the bitrate. Looking at the circuitpython lib notes they mention:
"This means the library sets up the radio modulation to match RadioHead’s default of GFSK encoding, 250kbit/s bitrate, and 250khz frequency deviation. To change this requires explicitly setting the radio’s bitrate and encoding register bits. Read the datasheet and study the init function to see an example of this–advanced users only! "
Are you changing the bitrate for a specific purpose or just because you thought it would be better? Maybe you could try with the default settings.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: RFM96 radio modules: Not getting stated range

Post by adafruit_support_mike »

Estimating the range of a radio link is basically impossible without a bunch of (fairly expensive) RF test equipment. Every physical object near the line of sight between antennas has an effect, as do atmospheric conditions and any other radio sources within receiving range.

The banner specs from a datasheet assume ideal conditions. Any deviation from ideal conditions will reduce performance, whose most obvious symptom is loss of range.

A couple hundred meters isn't bad for a connection using spring antennas with no particular alignment.

If you want connections out to 1000m, you'll need directional antennas. The 2km example mentioned in the tutorial involved laser-aligned parabolic antennas with an uninterrupted line of sight.

User avatar
Rcayot
 
Posts: 321
Joined: Sat Feb 08, 2020 6:48 pm

Re: RFM96 radio modules: Not getting stated range

Post by Rcayot »

My experience is that the edge mount sma conne tor ans antenna work well. My units are 350 + feet apart, and the receiver is indoors and receives through the roof and 12 inches of cellulose plus foil lined urethane rigid.

I NEVER lose packets, and send multiple sensor data every few minutes.

Try a better antenna.

Roger

User avatar
ValenceElectrons
 
Posts: 20
Joined: Sat May 21, 2022 11:47 pm

Re: RFM96 radio modules: Not getting stated range

Post by ValenceElectrons »

Thanks for the comments! I had a hunch the antenna may be the key to the problem. Does a better/bigger antenna imply more power consumption? In general for these antennas (spring as well as uFL or SMA connected) is vertical the optimum orientation?

User avatar
sj_remington
 
Posts: 997
Joined: Mon Jul 27, 2020 4:51 pm

Re: RFM96 radio modules: Not getting stated range

Post by sj_remington »

Does a better/bigger antenna imply more power consumption?
No, assuming antennas are properly matched.

Better antennas direct the available power for improved communications, rather than indiscriminately radiating it into outer space, for example.

User avatar
languer
 
Posts: 102
Joined: Fri May 17, 2013 2:02 pm

Re: RFM96 radio modules: Not getting stated range

Post by languer »

The following link (https://linxtechnologies.com/wp/wp-cont ... eth-ds.pdf) gives you a good idea if what type of pattern to expect with the antenna you are currently using. There will certainly be some implications on how you use it (e.g. are you too close to a ground plane that shorts the pattern), but it gives you a general idea.

The pattern on the perpendicular axis of the helix should be pretty constant with the top of the helix showing a local null (similar to a cardioid - perhaps less pronounced). My point is that the helical you are using should be providing a fair response (make sure the helix end on both devices is pointing towards the sky so that the broad pattern is used (and not the cardioid-looking end).

When Adafruit states "They can go at least 500 meters line of sight using simple wire antennas", though that could be a little of marketing-speak, I am fairly certain they can get there (these are the devices used by LowPowerLab people and they have good results with them) though they require tweaking the radio parameters.

The little helix you have, as long it is for the correct frequency, should be a better (more stable/repeatable) than the simple wire. But you do need to use the radio properly; you want to use ATC, you want to use ACK/RETRIES, you want to set the threshold for ATC around -90dBm. Similar to Rcayot, I've been using them through block walls for inside-to-outside house connections at some 150-200ft range with no issues (I get that 150-200ft is not even close to 100m, but that 150-200 is not LOS with significant obstructions).

Best of luck.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: RFM96 radio modules: Not getting stated range

Post by adafruit_support_mike »

ValenceElectrons wrote: Mon Mar 20, 2023 12:51 pm Does a better/bigger antenna imply more power consumption?
No, the antenna just changes the way the energy is arranged.

The theoretical baseline for antennas is a device called the 'isotropic antenna' which radiates the same amount of energy in all directions. If you mark points that see the same amount of radiated energy, you'll get a sphere around the antenna.

That's mathematically simple, but not necessarily an efficient way to use the radiated energy. The part of the sphere going straight up doesn't do anything useful if all the radios you want to talk to live along the same plane, for instance.

In that context, you'll get more value from the same amount of energy if you have an antenna whose equal-energy points plot out to form a torus: you still get equal amounts of energy in every horizontal direction, but you don't have energy going up and down.

If you drive the toroidal antenna (technically an 'omnidirectional antenna') with the same amount of energy as the isotropic one, the total amount of energy they radiate will also be the same. But the surface are of the omnidirectional antenna's torus is smaller than the surface area of the isotropic antenna's sphere, so a point on the surface of the torus will have more energy than a point on the surface of the sphere.

For a typical omnidirectional antenna, a point on the surface of the toroid has 25% to 60% more power than a point the same distance from an isotropic antenna. That's why they're described as having "+2db gain" or "+4db gain".. the number measures the effect of concentrating energy relative to the emission pattern of an isotropic antenna radating the same total energy.

Taking the same idea farther gives us the idea of a parabolic antenna.

As a quick review, any line that passes through the focal point of a parabola will reflect from the parabolic surface onto a path parallel to the parabola's axis. In effect reflection from the surface of a parabola converts a sphere into a cylinder.

The cross-sectional area of a cylinder is constant, so in theory a parabolic reflector concentrates all its radiated energy into a circle that stays the same no matter how far the energy travels. In practice the energy does spread out a bit, but we can get extremely good concentration of energy over huge distances.

That leads to the practical difficulty of pointing a 1m disc directly at another 1m disc a few kilometers away. Even the smallest angular vibrations turn into large offsets if you put them at the end of a long enough radius.

In practice we start off with a given amount of total radiated energy, then have to make tradeoffs between concentrating it and spreading it out enough to be sufficiently easy to work with at the distance we want to span.

User avatar
ValenceElectrons
 
Posts: 20
Joined: Sat May 21, 2022 11:47 pm

Re: RFM96 radio modules: Not getting stated range

Post by ValenceElectrons »

Many thanks for the above comments - what an education!
I've seen reference to "the ground plane" above and elsewhere. With respect to my project, is that the radio module PCB itself? And if so, should the helical antenna (assuming I stick with it for now!) be mounted parallel off the end, or upright and perpendicular to, the module's plane? Adafruit's product pictures suggest parallel, but I have seen other similar radio modules/projects with it mounted perpendicular.

User avatar
ValenceElectrons
 
Posts: 20
Joined: Sat May 21, 2022 11:47 pm

Re: RFM96 radio modules: Not getting stated range

Post by ValenceElectrons »

languer wrote: Mon Mar 20, 2023 11:30 pm But you do need to use the radio properly; you want to use ATC, you want to use ACK/RETRIES, you want to set the threshold for ATC around -90dBm.
I was poking around adafruit_rfm69.py and I did not see any configuration or attribute for "ATC". Perhaps an abbreviation I am not familiar with! Can you explain? Thanks!
I am not using ACK/Retry yet - I want to pin down the more basic configuration settings first to optimize distance, then I'll implement ACK/Retry remediation.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: RFM96 radio modules: Not getting stated range

Post by adafruit_support_mike »

ValenceElectrons wrote: Tue Mar 21, 2023 3:19 pm I've seen reference to "the ground plane" above and elsewhere. With respect to my project, is that the radio module PCB itself?
Yes.

Radio waves pass energy back and forth between a magnetic field (the electrical equivalent of momentum) and an electric field (the electrical equivalent of potential energy). A radio wave passing through a block of conductive material creates the electric field by pushing electrons to one face of the block.

The wave can't do that if the block of conductive material is connected to an electrical power source though.. any electrons the wave pushes around are replaced by the power source. The only way the wave can cope with that is to align its own 0V state (which it has to pass through twice every cycle) to the surface of the block.

Mechanically, it's equivalent to a wave moving along a rope that suddenly hits a point where the rope is tied off. The wave's only option is to put one of its zero-displacement nodes at that point. And since the wave can't move the point, all the energy in the wave has to reflect from that point and go back the other way.

Functionally, that means a block of conductive material held at a fixed voltage is a mirror for radio waves.

That's useful because antennas detect radio waves by collecting energy from different positions in the wave. The maximum possible difference between two points on a sine wave lives between 0 degrees (sin=1) and 180 degrees (sin=-1), and for a wave moving through space those points will be half the wavelength apart.

The antenna that takes advantage of that has two pieces of wire, each 1/4 wavelength, with a resistor connected between them. The passing radio waves push electrons from the far tip of one wire to the far tip of the other (half a wavelength away). Those moving electrons are an electrical current that generates voltage across the resistor in the middle.

If you put a single quarter-wave wire on a ground plane held at a fixed voltage, the wave 'sees' a reflection of the real quarter-wave wire in the mirror surface of the ground plane. In practice, the parts of the wave that would go to the tip of the reflected wire reflect from the ground plane and go to the top of the real wire. The math works out so the single quarter-wave antenna over a ground plane is equivalent to a dipole antenna in free space.

That's especially handy because the surface of the Earth can be considered a plane with a fixed voltage (fun fact: the resistance between any two points on the planet is about 300 Ohms). Most radio towers are quarter-wave conductors pretending to be dipoles.

To get the advantage of a ground plane, you need the conductive surface to extend far enough to capture useful reflections. Extending the PCB ground plane with a piece of aluminum connected to GND can give you a larger reflective surface.
ValenceElectrons wrote: Tue Mar 21, 2023 3:19 pm And if so, should the helical antenna (assuming I stick with it for now!) be mounted parallel off the end, or upright and perpendicular to, the module's plane?
It doesn't matter.. the reflections from the ground plane will make incoming waves travel to the appropriate point for a dipole regardless of the real wire's orientation. The math just gets more complicated when the wire isn't straight and perpendicular to the plane.

However..

The wave that comes out of a perpendicular-to-the-plane virtual dipole is different from the wave that comes out of a wire with a different shape or orientation.

The math to express that precisely is exceptionally ugly, so I'm going to hand-wave a high-level argument by resorting to a couple of well-supported physical principles: superposition and reversability.

Superposition means that every atom in an antenna is doing its own thing, and has no knowledge-of/interaction-with any other atom in the antenna. We can break an antenna down into as many tiny-little slices as we want, and treat each of them as an isotropic antenna (radiating equally in all directions). The behavior of the antenna as a whole is exactly the sum of the effects of all those slices stacked up (superimposed) on each other in space and time.

Reversability is a fact of the way the universe works: if electrical energy excites an electron in a way that sends out a radio wave, the same radio wave coming in will produce the same electrical excitation. Basically, if we reverse time we can swap cause and effect. And if we don't actually want to reverse time, an incoming wave with the same properties as a time-reversed wave will produce the same effect as a 'real' time-reversed wave.

(That last bit is known as 'symmetry': physics being unaffected by changes like moving the experiment to another place, pointing it a different direction, doing it at a different time, etc)

The upshot of all that is: the ideal thing to receive a radio wave emitted by some slice of an antenna is exactly that same slice of the same antenna. Failing that, we want the equivalent slice of an identical antenna located somewhere else.

We can get the original antenna back by superimposing all the slices, but in the process we lose some symmetry: the sum of the slices in space depends on where the slices are relative to each other. That means, to get the best performance, the receiving antenna needs to be the same shape as the transmitting antenna, and needs to be in the same orientation.

To demonstrate the loss of symmetry in orientation, imagine a vertical dipole: the waves it emits push electrons up and down in any conductive material they pass through, and for any point on the wave, the best place to capture the most energy is half a wavelength above or below it.

If that wave passes through a horizontal dipole, almost nothing happens. The wave pushes electrons across the thickness of the wire, but doesn't to anything to create voltage between points half a wavelength to the left and right of each other. For ideal dipoles, the reception would be zero.

The same is true for antannas of any other shape and orientation. For a helical antenna, the wave that generates the radio signal is coiled along the wire. The ideal thing to receive that wave is another helix with the same pitch, diameter, and twist, whose slices are the same distance and orientation from the ground plane as the transmitting antenna.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: RFM96 radio modules: Not getting stated range

Post by adafruit_support_mike »

ValenceElectrons wrote: Tue Mar 21, 2023 3:44 pm I did not see any configuration or attribute for "ATC". Perhaps an abbreviation I am not familiar with! Can you explain? Thanks!
ATC is Automatic Threshold Correction.

There are many different ways for radios to transmit a 1 or a 0. When you use the modulation scheme known as Frequency Shift Keying, the transmitter switches from one frequency to another.

In practical terms, there's no guarantee that the radio waves for the two frequencies will be the same strength (and lots of reasons why one will pick up more noise or interference than the other). As a result, the receiver might see one frequency drop out but won't see the other half pick up. Instead, that looks like a simple loss of signal.

A radio with Automatic Threshold Correction will track both frequencies independently to see where their high and low levels are, and apply some amplification to make the transitions work properly.

Software-based receivers have the option to capture the raw signal then chew on the data for a while before they decide what it means. That includes the ability to read ahead and find out what happens, then go back to a previous location in the signal and 'predict the future'. That happens to be extremely useful in filtering applications.. if you have the option to remember a couple dozen cycles before the edge and read a couple dozen cycles past the edge, you can eliminate almost all the information at other frequencies and see just the behavior of the frequency you want to track.

That would be a very low-level feature of the radio, and I don't know if the RadioHead library (or the radio itself) supports it off the top of my head.

If you're using LoRa it's irrelevant because that uses completely different methods to encode data. LoRa is a 'broadband' scheme, meaning the radio uses a range of frequencies much, much wider than is necessary for the information it wants to encode. All that extra range is used to make the signals noise resistant and unlikely to interfere with signals from other radios in the same region.

As an example, some broadband schemes encode 1 and 0 as 'chirps'.. a sweep that starts at a lower frequency and goes to a higher one, or starts high and goes low. It's basically impossible to mistake one for the other, noise at a specific frequency has little effect on the ability to recognize 'getting faster' versus 'getting slower', and forms of distortion like Doppler Shifting (a real issue when a radio is in a car or a plane) just move the starting and ending frequencies of a sweep a little higher or lower. It's also possible to isolate two sweeps that overlap but start at slightly different times, which reduces interference from other radios.

Other broadband techniques involve tricks borrowed from BANNED.. if two radios begin by sharing a random number, they can use that to generate an irregular timing sequence. If they only send or receive bits on that sequence, and ignore any signals that happen at other times, the chance of other radios generating interference at just the right time is statistically negligible, even if you have thousands of radios all operating in the same footprint and on the same frequencies.

Throw in some redundant bits calculated from subsets of the original message and you get the ability to detect and correct multiple errors in the received signal. As long as you get good bits more than 50% of the time and you're willing to add enough redundancy, you can be confident of reconstructing the original message correctly.

There are whole bodies of math to calculate the probability of a broadband signal collision for a given set of transmission parameters, and the probability of still getting a mistake with X-much redundant data. The results are called a protocol's Bit-Error Rate, and are usually tuned for values like 'one wrong bit per century of operation'.

LoRa is a complete (and proprietary) collection of broadband techniques designed to support high recovery probability even with low-energy radios separated by long distances. There's no option to tinker with it directly, but you can add layers of reliability protocols on top of the framework it provides.

The ACK/Retry model comes from TCP internet protocol, whose reason for existing is to create reliable and accurate transmission systems from unreliable and inaccurate pieces.

The short version is that a transmitter sends a bundle of data along with a checksum. The receiver calculates its own checksum and compares it to the transmitted one. If they match, the receiver sends an ACK message. If the transmitter doesn't hear an ACK within a given amount of time, it sends the data and checksum again. That "I'm going to keep sending this until you tell me to shut up" approach guarantees that a message will get through eventually. That 'eventually' could be beyond the heat death of the universe, but the guarantee is there.

In practice, ACK/Retry systems rarely need to retry a packet more than a handful of times before it gets through, so again we can calculate the probability of a failure after N attempts, and tune the system to make that value about as small as we want.

The RadioHead library has a Reliable Datagram library, which provides that feature on top of the signal voodoo handled by the LoRa protocol.

User avatar
ValenceElectrons
 
Posts: 20
Joined: Sat May 21, 2022 11:47 pm

Re: RFM96 radio modules: Not getting stated range

Post by ValenceElectrons »

A classroom's worth of education! Thanks so much. Forums are wonderful things!
I'll continue to tweak the antenna (maybe resolder it, knowing my primitive skills) and tweak the radio parameters. I also have LoRa units on order that might just bypass the issue completely!

User avatar
ValenceElectrons
 
Posts: 20
Joined: Sat May 21, 2022 11:47 pm

Re: RFM96 radio modules: Not getting stated range

Post by ValenceElectrons »

I have ended this post, but posted a followup question in this same forum: RFM9x module with a "spring" dipole antenna (viewtopic.php?p=967858&hilit=radio+distance#p967858)
Thanks for everyone's comments!

Adafruit Forum Support: I realized I screwed up the title and my initial paragraphs, saying "RFM96" when I meant "RFM69", which is significant because the former implies LoRa, which I did not have. I can no longer edit the post - could you correct this for me so future readers and searches aren't misdirected? Thanks1

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”