Hello, ive been trying to set up a wireless communication in between 2 arduinos and i am using a teensy 3.2 board as a sender and a arduino pro micro as a receiver. i have hooked up both arduinos as this picture shows:
--> (i have used the picture of the arduino micro to the right for both boards)
https://www.aeq-web.com/media/48572DA07072018225732.jpg
now the problem is that i dont get any output on the receiver.
I have defined the SCI pins for both boards to propper sci compatible pins and the code should also work.
I have used a propper voltage regulator for the arduino pro micro (since it only has a 5v out.)
So there really shuoldnt be any problems and they should work...
Does anyone have any ideas to why there is no communication?
Receiver code:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define SOFT_SPI_MISO_PIN 14
#define SOFT_SPI_MOSI_PIN 16
#define SOFT_SPI_SCK_PIN 15
RF24 radio(8, 9); //Define radio (CE-PIN,CSN-PIN)
const byte rxAddr[6] = "00001"; //RX adress (Same as on TX)
String received_data;
void setup()
{
// Start the serial
Serial.begin(9600);
Serial.println("NRF24 Receiver");
radio.begin();
radio.setPALevel(RF24_PA_LOW); // Transmit Power (MAX,HIGH,LOW,MIN)
radio.setDataRate( RF24_250KBPS ); //Transmit Speeed (250 Kbits)
radio.openReadingPipe(0, rxAddr);
radio.startListening();
}
void loop()
{
if (radio.available())
{
char text[100] = {0}; //Buffer
radio.read(&text, sizeof(text));
received_data = String(text);
Serial.println(received_data);
delay(20);
}
}
Sender code:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define SOFT_SPI_MISO_PIN 11
#define SOFT_SPI_MOSI_PIN 13
#define SOFT_SPI_SCK_PIN 12
const byte rxAddr[6] = "00001"; //TX adress (Same as on RX)
int counter = 0; //Count TX (Only for demo example)
RF24 radio(8, 9); //Define Radio (CE-PIN,CSN-PIN)
void setup() {
Serial.begin(9600);
radio.begin();
radio.setPALevel(RF24_PA_MAX); // Transmit Power (MAX,HIGH,LOW,MIN)
radio.setDataRate( RF24_250KBPS ); //Transmit Speeed (250 Kbits)
radio.setRetries(15, 15);
radio.openWritingPipe(rxAddr);
// Disable Receiver
radio.stopListening();
}
void loop() {
counter++;
String str = "Send Counter: ";
str += String(counter);
int str_len = str.length() + 1;
char char_array[str_len];
str.toCharArray(char_array, str_len);
radio.write(&char_array, sizeof(char_array));
Serial.print("Actual Transmission: ");
Serial.println( char_array );
delay(250);
}
Antenna and voltage regulator used:
https://www.amazon.de/WayinTop-Empfänger-Transceiver-Breadboard-Kompatibel/dp/B07P95X6HM/ref=sr_1_3?__mk_de_DE=ÅMÅŽÕÑ&dchild=1&keywords=NRF24L01%2BPA%2BLNA&qid=1604582929&sr=8-3