Author Topic: Programming question, setting radio power.  (Read 1809 times)

JRoode35

  • NewMember
  • *
  • Posts: 10
Programming question, setting radio power.
« on: October 14, 2014, 01:47:44 PM »
Hello all,
I am really trying to learn programming and have spent countless hours reading and watching videos on YouTube, I'm starting to get the hang of programming in the arduino IDE using the libraries that come with standard. I am still having a heck of a time understanding using additional libraries such as the rfm69 library that Felix wrote, at this point I think if I can learn just one function at a time I will be making more progress than I have been.

As soon as I get the two radios (RFM69HW) I have connected to two separate arduino Nanos talking I would like to do some open air range testing with a couple different antennas I have made. Specifically what I would like to do is test range vs output power and create a chart to give people a rough idea of what they can expect in similar conditions. So what I'm trying to learn first on the programming side is how I would change the power output of the radios, if someone would explain exactly what I would type in and where in the sketch I would put it would be great

When I'm able to get that done I will post the charts and hopefully it will help answer the infamous question I see on any forum that has to do with radio, "what's the rang" lol.

I plan on testing 3 different antennas all at 1db increments in the end hopefully we can use it as an idea of what to set our radios at for maximum battery life while still maintaining a solid wireless link.

Thank you for your help
Justin

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Programming question, setting radio power.
« Reply #1 on: October 14, 2014, 02:28:16 PM »
Use radio.setPowerLevel(value) where value = [0..31].
For HW radios the values will go from 0-15 and will repeat from 16-31.
"What is the range" is a very generic question. Range depends on a variety of factors. The RFM69 library I created gives a good all-purpose range out of box but can/should be tweaked to your own situation if you need more range. Getting more range also involved decreasing bitrate and narrowing bandwidth, and doing temperature compensation. See this topic for more: https://lowpowerlab.com/forum/index.php/topic,357.0.html

JRoode35

  • NewMember
  • *
  • Posts: 10
Re: Programming question, setting radio power.
« Reply #2 on: October 14, 2014, 03:39:12 PM »
I am using HW radios what do you mean by repeat from 16-31?

Thanks Felix
Justin

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Programming question, setting radio power.
« Reply #3 on: October 15, 2014, 08:23:08 AM »
0..15 ~ min..max
16-31 ~ min..max
So 0 is equivalent to 16 and 15 is equivalent to 31.
This is only true for HW.

JRoode35

  • NewMember
  • *
  • Posts: 10
Re: Programming question, setting radio power.
« Reply #4 on: October 18, 2014, 11:38:42 PM »
What is the default power setting when you are using RFM69HW?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Programming question, setting radio power.
« Reply #5 on: October 18, 2014, 11:39:40 PM »
maximum :)