Can I reduce the range of RFM69HCW with software?

Started by [email protected], October 06, 2024, 10:40:55 PM

[email protected]

I'm working on a Moteino based project in which I need to use the RFM69HCW to send commands between Moteinos #1 & #2 over a 'long range' and also have Moteino #2 detect when #1 is more than ~75 feet away.  I'm wondering if there is something I can do in software to reduce the power of the transmitter in Moteino #1.  My thoughts are as follows: 1- I'd send commands between #1 & #2 using the higher power setting. 2- To detect a gap of more than ~75 feet between them, I'd have #1 reduce power and send the 'can you hear me' signal to #2.  Moteino #2 would consider #1 beyond the ~75 ft gap if it did not get the message within a set timeframe.  I'm hoping to be able to do this with the RFM69HCW, but if not, I'll need to use a shorter range transmitter/receiver.  Any help you can give me is much appreciated!
That is the question....here is the project.  We usually walk our well trained dog off leash.  Unfortunately, she is loosing here hearing.  I'm building an 'assistive device' for her in which Moteino #1 is the basis for a FOB and Moteino #2 is the basis for a vest our dog wears.  The FOB has buttons for commands such as 'wait', 'come', 'heel', and 'no'.  Each command actuates a vibratory motor in the vest....I'm pretty sure I can train her to understand the meaning of the vibratory signals.  One thing she does is lag behind us as we go for a walk....lotz-o-good smells abound :-).  I'd like to have her get a vibratory 'ping' when she is more than ~75 feet behind or ahead of us. 

Felix

So you could just use these library function that increase or reduce the transmit power.

setPowerLevel(powerLevel)
//   - the HW/HCW 0-24 range is split into 3 REG_PALEVEL parts:
//     -  0-15 = REG_PALEVEL 16-31, ie [-2 to 13dBm] & PA1 only
//     - 16-19 = REG_PALEVEL 26-29, ie [12 to 15dBm] & PA1+PA2
//     - 20-23 = REG_PALEVEL 28-31, ie [17 to 20dBm] & PA1+PA2+HiPower (HiPower is only enabled before going in TX mode, ie by setMode(RF69_MODE_TX)
https://github.com/LowPowerLab/RFM69/blob/master/RFM69.cpp#L238

// return stored _powerLevel
getPowerLevel() { return _powerLevel; }

setPowerDBm(dBm)
//Set TX Output power in dBm:
// [-18..+13]dBm in RFM69 W/CW
// [ -2..+20]dBm in RFM69 HW/HCW
https://github.com/LowPowerLab/RFM69/blob/master/RFM69.cpp#L272

Even if you lower the output power, there's still a chance a farther node will pick it up.
You could also set different network IDs to separate sets of nodes so they don't receive between them but maybe that's not what you're after.
Anyway there's different strategies how you can approach a problem like this and the library offers plenty of functionality that allows you to play with the radios in whatever way you'd like.

[email protected]

Thank you Felix.  I've got some experimenting to do :-)  It will take a little while, but I'll post the results of my experiments to this thread.  Thx again....jim

[email protected]

Hello again, back after doing some experimentation and am looking for some more advice.  As a reminder, I have two moteinos (FOB and MAD) and they communicate using two 'channels' of communication. Both use a send-command-echo-command between the FOB and the MAD. The distance monitor channel is at lowest power (-2dBm) and the command channel is at higher power (14 dBm). The purpose of the distance monitor is to detect when the FOB and MAD are about 25 paces apart. When the FOB doesn't get a response from the MAD on the low power channel, then the distance threshold is considered exceeded (out of range). 
Test results:
distance monitor channel at -2 dBm goes out of range at 120 paces (ideally want 25 paces).    I thought, ok, let's make the antenna not as effective for the frequency I was using (915.0).  I tried multiple different frequencies (from 875 - 1000) but it didn't make any real difference in the out-of-range distance between FOB and MAD.  Next, I thought about shortening the antenna.  Before doing that, I removed the antenna from the MAD, and the out-of-range distance was ~ 2 paces.  Sooooooo, is the solution to shorten the antenna on the MAD?  If so, is there any specific length I should use, or should I just snip it mm at a time and retest?  Is there any danger to the transceiver from doing this? 
I wish I could be more cognitive about solving this....it just isn't in my skillset.  Many thanks for your advice....jim

Felix

Just use these examples - they use the RFM69_ATC library extension which automatically reduces the power to the minimum that is required to be "heard" at the receiving end. That is great in many ways, especially power savings and keeping your network "quiet" yet still performant.

https://github.com/LowPowerLab/RFM69/tree/master/Examples/Node
https://github.com/LowPowerLab/RFM69/tree/master/Examples/Gateway

[email protected]

Thanks Felix!  I'm not sure I fully communicated what I am trying to do.  I did find a solution and I want to post it in case anyone else is wanting to do the same thing.  I have two moteino's walking around and I want to detect when the distance between them is ~ 25 paces.  The problem is that the transceivers are just too darn good, even at the lowest power setting.  When I set the transmitter power at the lowest setting (-2), the transceiver range is  ~150 paces, which is way more than the 25 paces I want.  My solution was to keep the antenna length unchanged, but to "pig tail" them both.  I started winding each antenna around a pencil, increasing the number of winds until I got the reduced range I was looking for.  Now, I use the lowest power to detect when the two moteinos are further apart than 25 paces, and use higher power to send commands between the two. 
Thanks again for your input.....jimf

Felix

Wow, what a great problem to have, radios being too good  :)
But thanks for sharing your hack solution to degrade that performance to meet your requirement!