I’m working on a project with an Arduino Mega that has transmits data through an XBee and records data to an SD card. I’ve done similar projects in the past with success but I’ve run into an issue with the XBee on my current project. I randomly lose XBee telemetry when simultaneously transmitting data and recording to an SD card. The telemetry will stop for a random period of time (sometimes seconds and sometimes minutes) and then will start again for another random period of time. The Arduino Mega continues to function as expected otherwise. If I power the Mega through USB, I can watch the Arduino Serial monitor and see that the Serial data is still being processed even when the XBee is not receiving data. If I disable the SD card then the XBee never loses telemetry. Also, when the XBee is not receiving telemetry, commands I transmit to the XBee are not received. As a code check, I went back to uploaded an old code, that I know worked on a previous project, and attempted to use the XBee and SD card at the same time. The same anomaly is present. Also, it may be worth noting that when I open the SD card I’ve noticed that there are almost always corrupted files included, in addition to the working data logs created by my project.
Some thoughts:
Both use the 3.3v output, could I be overloading this line?
Any issues with the Mega using Serial & SPI simultaneously?
Previous projects used Uno / Nano, does the Mega have limitations these platforms do not?
Here’s a list of the components I used for this project: