I am trying to connect the wireless module nrf24l01 with the gyro mpu-6050. Each works perfectly on its own. However, when connecting both to a single atmega328 (in order to send over wireless the gyro data), the code runs for between 30 seconds and 5 minutes.

I have seen many people have issues, none of the suggestions have worked, but it seems like it is more about the combination than the mpu itself. I have not had any errors, in that all the attempts have uploaded fine.

Some things I have tried (If you have experience with this device, im sure you will know what i am referring to ): Changing clock rates from 24 to 12, and 400 to 200 Changing the header file for mpu from 100 hz to 20 hz and back Adding pullup and pulldown resistors on sla/sda Using external variable power supply to make sure exact voltage Powering devices off arduino 3.3 and external 3.3 Running code without using serial reader on computer and just transmitting data


After more debugging, I reduced the issue (I think). As each module works fine independently, i thought there could be a code issue. It seems though, that the issue is the combination of buffers. I don't think this is exactly right, but to us it seems like the gyro needs to run quickly to stop the risk of causing the arduino to hang(even though we clear the buffer).

The second part is the wireless. It seems like the code is looking by default for an acknowledgment the package is received. This slows down the broadcasting. So, if we disable the ack requirement, the gyro becomes stable. However, the receiver stops receiving any packets at all. If someone knows why, please explain.

So what we thought would work is by sending only some packets as the write with ack on a particular pipe. This way, the gyro will be able to run stably, and the data can sometimes be sent and we can see if this is really the problem. Again, this does not get recognized by the receiver at all.

Questions: Does it make sense that the buffers are working against eachother, and this is not solvable through hardware. Is there a clear reason why the receiver can not find packets that are being sent, just without the ack requirement?

  • i'm trying to do the same but can't get the code right... i need to read the gyro gy-521 position and to transmit it to move servo's on the other side... i will happy to get help with that and move to the n ext level (that is you problem now, i believe that changing the baud can help )
    – user11117
    Commented Jul 9, 2015 at 17:54
  • Correct me if I am wring, but the nrf24l01 is not a WIFI module. Its a RF Transceiver.
    – PhillyNJ
    Commented Jul 10, 2015 at 1:37
  • @PhillyNJ Thanks, just modified it. meant wireless Commented Jul 10, 2015 at 1:49
  • You only used the gyroscope for data transmission? please post the complete code that you used to communicate between the nrf24l01 and the mpu-6050. Thank you Commented Nov 13, 2016 at 21:45

2 Answers 2


I could not figure out what was wrong, but I changed to this library for NRF24: http://tmrh20.github.io/RF24/

and I started using the GY-85 with the FreeIMU Library : http://www.varesano.net/projects/hardware/FreeIMU

Following this advice: http://forum.arduino.cc/index.php?topic=164222.msg1539961#msg1539961

It works now, so if it was SRAM as @Avamander suggested, it was not on my side.


It seems to me you are running out of memory (SRAM). https://www.arduino.cc/en/Tutorial/Memory

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.