nRF24/RF24Audio

Data hum/buzz

andraugust opened this issue · 2 comments

Hi, Thanks for the library. There is a buzz in the recieved data. Any ideas why?

The received data in a quiet environment looks like this:
Screen Shot 2020-01-21 at 8 54 33 PM

If I read the mic directly with analogRead (no streaming) there's no hum.

SETUP

Transmitter: Similar to examples/GettingStarted.

/*
Transmitter
*/
#include <SPI.h>
#include <RF24.h>
#include <RF24Audio.h>


RF24 radio(7, 8);    // CE, CSN
RF24Audio rfAudio(radio,0);

void setup(){
    radio.begin();
    rfAudio.begin();
}

void loop(){
    rfAudio.transmit();
    delay(1000);
}

Receiver: Similar to examples/USB_Audio.

/*
Receiver
*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>


RF24 radio(7, 8);    // CE, CSN
const int PAYLOAD_SZ = 32;            // payload can be 1-32 bytes
const uint64_t addresses[2] = { 0xABCDABCD71LL, 0x544d52687CLL};

void setup(){
    while (!Serial);
        Serial.begin(115200);              // 9600, 14400, 19200, 28800, 31250, 38400, 57600, 115200
    radio.begin();
    radio.setChannel(1);
    radio.setAutoAck(0);
    radio.setCRCLength(RF24_CRC_8);       // Only use 8bit CRC for audio
    //radio.setDataRate(RF24_1MBPS);      // Library default is RF24_1MBPS for RF24 and RF24Audio
    radio.openWritingPipe(addresses[0]);  // Set up reading and writing pipes. 
    radio.openReadingPipe(1,addresses[1]);// All of the radios listen by default to the same multicast pipe  
    radio.printDetails();
    radio.startListening();               // Need to start the radio listening
}

byte data[PAYLOAD_SZ];
void loop(){
    if (radio.available()){
        radio.read(&data, PAYLOAD_SZ);
        for (int i=0; i<PAYLOAD_SZ; i++){
            Serial.println(data[i]);
        }
        Serial.println("");
    }
}

Devices

Thanks

I tried everything. And solved it using 470uF cap on power rails of the rf module, 1000uF on the power rails of my arduino (nano) and change the sample rate to 20khz and datarate to 240kbps. Now even usb power via computer is fine. Good luck (had the exact same noise fingerprint the OP shows, also with proper psu)