Hello everyone,
thanks for taking the time to read my post and try to help.
I am using NRF24L01 with Antenna long range module 1100 meters. So what i am trying to do is send a potentiometer value from one to the other where I am Serial.print on the receiver side. My pot connections are good i sent Serial.print and tested it I received the values on the controller monitor. But I am not receiving the value on receiver side. I am using arduino Nano on the controller side with D13 pin on the left side and arduino Uno for the receiver side. My connections are:
Pins of NRF24L01:
pin1 to GND
pin2 to VCC 3.3V on arduino
pin3 to pin 7 of arduino
pin4 to pin8 of arduino
pin5 to pin13 of arduino
pin6 to pin11 of arduino
pin7 to pin12 of arduino
pin8 to nothing
this setup is on both the receiver and the controller.
I took my multimeter and tested the pins of the module, i got 3.3V on vcc but some of the pins i got 0.33V and other 0.1V on the receiver and controller and on the controller I got 0V on the CE pin of the module. So I need your help to determine what is the problem please.
Edit
RX on the controller side is flashing too fast and I added a picture of my setup
I am using an old sketch which I have used in a robot project and works fine.
here are my sketches:
Controller:
#include <SPI.h>
#include <RF24.h>
//1st byte is for throttle value from pot
int msgTX[2]; //Message to be transmitted, can contain up to 2 array elements, 2 bytes
int ackMessage[2]; //Acknowledgment message, means the message that will be received from the receiver or the car, 1 element for the moment
//Defining radio object for the RF24 function
RF24 radio(7, 8); // CE, CSN
//const byte address[6] = "00001";
//Defining the radio variables and values
const uint64_t pipe = 0xE8E8F0F0E1LL; //pipe address
const rf24_datarate_e dataRate = RF24_250KBPS; //Data rate defined in the documentations, RF24_250KBPS, RF24_1MBPS or RF24_2MBPS
//Throttle potentiometers
const byte Throttle = A0;
void setup() {
Serial.begin(9600);
radio.begin();
radio.setDataRate(dataRate);
//radio.openWritingPipe(address);
radio.enableAckPayload(); //enables receiving data from receiver side
//radio.setPALevel(RF24_PA_MIN); //Power Amplifier (PA) level to one of four levels RF24_PA_MIN, RF24_PA_LOW, RF24_PA_HIGH and RF24_PA_MAX
//radio.stopListening();
}
void loop() {
int ThrottleValue = analogRead(Throttle); // read the value from the sensor
Serial.print("Throttle : ");
Serial.println(ThrottleValue);
radio.openWritingPipe(pipe);
msgTX[0] = ThrottleValue;
//msgTX[1] = SteeringValue;
radio.write(msgTX, sizeof(msgTX)); //Sends the Data
AcknowledgmentDATA();
}
//DATA Receiving from the Receiver part, Acknowledgment Data
void AcknowledgmentDATA(){
while ( radio.isAckPayloadAvailable() ){
//Serial.println("Ack Available");
radio.read(ackMessage, sizeof(ackMessage));
int value = ackMessage[1];
}
}
And Receiver:
#include <SPI.h>
//#include <nRF24L01.h>
#include <RF24.h>
int msgRX[2]; //Message to be transmitted, can contain up to 2 array elements, 2 bytes
int ackMessage[2]; //Acknowledgment message, means the message that will be received from the receiver or the car, 1 element for the moment
RF24 radio(7, 8); // CE, CSN
//const byte address[6] = "00001";
//Defining the radio variables and values
const uint64_t pipe = 0xE8E8F0F0E1LL; //pipe address
const rf24_datarate_e dataRate = RF24_250KBPS; //Data rate defined in the documentations, RF24_250KBPS, RF24_1MBPS or RF24_2MBPS
int Throttle;
void setup() {
Serial.begin(9600);
radio.begin();
radio.setDataRate(RF24_250KBPS);
//radio.openReadingPipe(0, address);
radio.openReadingPipe(1, pipe);
//radio.setPALevel(RF24_PA_MAX);//Power Amplifier (PA) level to one of four levels RF24_PA_MIN, RF24_PA_LOW, RF24_PA_HIGH and RF24_PA_MAX
radio.enableAckPayload();
radio.startListening();
}
void loop() {
//ackMessage[1] = 200;
//radio.writeAckPayload(1, ackMessage, sizeof(ackMessage));
if (radio.available()) {
radio.read(msgRX, sizeof(msgRX));
Throttle = msgRX[0]; //middle throttle value is 121
Serial.print("Throttle: ");
Serial.println(Throttle);
}
}