I purchased a pair of GT-24 rf transceivers (https://www.amazon.com/dp/B0CM1Y2WSD) based on the nRF24L01+ chip. It includes the PA/LNA chip, has an on-board PCB antenna but also has a ipex antenna connector for an external antenna. I had the two transceivers hooked up to a pair of UNO and verified operation. Just for verification, I hooked up a short cable to the ipex coax connector so I could measure the transmit power with a spectrum analyzer. In the code below, I used the radio.setPALevel(RF24_PA_xxxx); to set the output power between MIN, LOW, HIGH, and MAX. I also used radio.setPALevel(RF24_PA_MAX,1); to enable the LNA, which some documentation indicates that also turns on the power amp. However, I could only read a range of about -18dbm (MIN) to -2dBm (MAX). Nothing I tried would give me the advertised +20dBm output. It appears the PA is not being enabled by anything I have tried.
I had the transceiver connected to an Arduino Uno. I have a 10uf cap installed across the VCC and GND on the transceiver. I tried connecting the VCC to an external power supply, but I did not see any difference from using the UNO 3.3v power.
Is there some method of getting the PA operating to boost the output?
Thanks in advance.
#include <SPI.h>
#include "printf.h"
#include "RF24.h"
#define CE_PIN 7
#define CSN_PIN 8
RF24 radio(CE_PIN, CSN_PIN);
// Let these addresses be used for the pair
uint8_t address[][6] = { "1Node", "2Node" };
bool radioNumber = 1; // 0 uses address[0] to transmit, 1 uses address[1] to transmit
// Used to control whether this node is sending or receiving
bool role = false; // true = TX role, false = RX role
float payload = 0.0;
void setup() {
Serial.begin(115200);
while (!Serial) {
// some boards need to wait to ensure access to serial over USB
}
if (!radio.begin()) {
Serial.println(F("radio hardware is not responding!!"));
while (1) {} // hold in infinite loop
}
// print example's introductory prompt
Serial.println(F("RF24/examples/GettingStarted"));
// To set the radioNumber via the Serial monitor on startup
Serial.println(F("Which radio is this? Enter '0' or '1'. Defaults to '0'"));
while (!Serial.available()) {
// wait for user input
}
char input = Serial.parseInt();
radioNumber = input == 1;
Serial.print(F("radioNumber = "));
Serial.println((int)radioNumber);
Serial.println(F("*** PRESS 'T' to begin transmitting to the other node"));
// Set the PA Level low to try preventing power supply related problems
// because these examples are likely run with nodes in close proximity to
// each other.
radio.setPALevel(RF24_PA_LOW); // RF24_PA_MAX is default. // <<< power level set here
// I also tried radio.setPALevel(RF24_PA_MAX, 1); to enable the LNA
// I also tried the radio.setRadiation(); function with no change in performance.
radio.setPayloadSize(sizeof(payload)); // float datatype occupies 4 bytes
radio.openWritingPipe(address[radioNumber]); // always uses pipe 0
radio.openReadingPipe(1, address[!radioNumber]); // using pipe 1
if (role) {
radio.stopListening(); // put radio in TX mode
} else {
radio.startListening(); // put radio in RX mode
}
} // setup
void loop() {
if (role) {
// This device is a TX node
unsigned long start_timer = micros(); // start the timer
bool report = radio.write(&payload, sizeof(float)); // transmit & save the report
unsigned long end_timer = micros(); // end the timer
if (report) {
Serial.print(F("Transmission successful! ")); // payload was delivered
Serial.print(F("Time to transmit = "));
Serial.print(end_timer - start_timer); // print the timer result
Serial.print(F(" us. Sent: "));
Serial.println(payload); // print payload sent
payload += 0.01; // increment float payload
} else {
Serial.println(F("Transmission failed or timed out")); // payload was not delivered
}
// to make this example readable in the serial monitor
delay(1000); // slow transmissions down by 1 second
} else {
// This device is a RX node
uint8_t pipe;
if (radio.available(&pipe)) { // is there a payload? get the pipe number that recieved it
uint8_t bytes = radio.getPayloadSize(); // get the size of the payload
radio.read(&payload, bytes); // fetch payload from FIFO
Serial.print(F("Received "));
Serial.print(bytes); // print the size of the payload
Serial.print(F(" bytes on pipe "));
Serial.print(pipe); // print the pipe number
Serial.print(F(": "));
Serial.println(payload); // print the payload's value
}
} // role
if (Serial.available()) {
// change the role via the serial monitor
char c = toupper(Serial.read());
if (c == 'T' && !role) {
// Become the TX node
role = true;
Serial.println(F("*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK"));
radio.stopListening();
} else if (c == 'R' && role) {
// Become the RX node
role = false;
Serial.println(F("*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK"));
radio.startListening();
}
}
} // loop