Hola.
Llevo 1 semana intentando hacer funcionar estos módulos, y no lo consigo, os comento detalles a ver si me podéis ayudar, ya que he leído las soluciones a este problema en el foro y ninguna me ha funcionado.
Uso la libreria de TMRh20, y para las pruebas uso los siguientes códigos:
Transmisor
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>
const int pinCE = 9;
const int pinCSN = 10;
RF24 radio(pinCE, pinCSN);
// Single radio pipe address for the 2 nodes to communicate.
const uint64_t pipe = 0xE8E8F0F0E1LL;
char data[16]="Hola mundo" ;
void setup(void)
{
radio.begin();
radio.openWritingPipe(pipe);
}
void loop(void)
{
radio.write(data, sizeof data);
delay(1000);
}
Receptor
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>
const int pinCE = 9;
const int pinCSN = 10;
RF24 radio(pinCE, pinCSN);
// Single radio pipe address for the 2 nodes to communicate.
const uint64_t pipe = 0xE8E8F0F0E1LL;
char data[16];
void setup(void)
{
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(1,pipe);
radio.startListening();
}
void loop(void)
{
if (radio.available())
{
int done = radio.read(data, sizeof data);
Serial.println(data);
}
}
Para alimentar el circuito del transmisor utilizo un módulo MB102, alimentando el arduino a 5V a través del pin de 5v y para alimentar el nrf24l01 a través del pin de 3,3V. Para el receptor igual, siendo independientes el circuito del transmisor y receptor. Los GND del arduino y del modulo están conectados.
Uso dos Arduinos uno R3 (elegoo), y están todas las conexiones hechas en protoboard. He comprobado con un multímetro las conexiones varias veces, y están correctas. Entre el GND y los 3,3v he conectado un condensador de 100uF, que tampoco me ha funcionado.
En un foro, vi un código, para comprobar que el Arduino comunica con el módulo, así que lo cargué, y el modulo si que comunica, ya que da los valores que tiene que dar, os dejo el código:
// 18 Mar 2018 - simple program to verify connection between Arduino
// and nRF24L01+
// This program does NOT attempt any communication with another nRF24
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include "printf.h"
#define CE_PIN 7
#define CSN_PIN 8
const byte thisSlaveAddress[5] = {'R','x','A','A','A'};
RF24 radio(CE_PIN, CSN_PIN);
char dataReceived[10]; // this must match dataToSend in the TX
bool newData = false;
void setup() {
Serial.begin(9600);
printf_begin();
Serial.println("CheckConnection Starting");
Serial.println();
Serial.println("FIRST WITH THE DEFAULT ADDRESSES after power on");
Serial.println(" Note that RF24 does NOT reset when Arduino resets - only when power is removed");
Serial.println(" If the numbers are mostly 0x00 or 0xff it means that the Arduino is not");
Serial.println(" communicating with the nRF24");
Serial.println();
radio.begin();
radio.printDetails();
Serial.println();
Serial.println();
Serial.println("AND NOW WITH ADDRESS AAAxR 0x41 41 41 78 52 ON P1");
Serial.println(" and 250KBPS data rate");
Serial.println();
radio.openReadingPipe(1, thisSlaveAddress);
radio.setDataRate( RF24_250KBPS );
radio.printDetails();
Serial.println();
Serial.println();
}
void loop() {
}
El fabricante de mi módulo es QooTech. No sé que más hacer, espero me puedan ayudar.


