How to send .txt file from Arduino Uno SD Card to phone via HC05?


I currently have numeric data from sensors saved in a SD card in .txt file.
I want to send this .txt file from Arduino Uno to a phone/phone's storage via HC05?

What are some ways I can do it?

Any help is highly appreciated. Thanks.

This example sends the contents of the SD_HELP text file to from my Uno with a HC05 Bluetooth module and micro SD card reader to my Android tablet running the Serial Bluetooth terminal app. I do not know how to save the data to a file on the tablet. That is out of the scope of an Arduino forum.

Replace "SD_HELP.TXT" with the name of your file and set the pins to match your setup.

#include <SoftwareSerial.h>
#include <SPI.h>
#include <SD.h>

SoftwareSerial BTserial(4, 7); // RX | TX
File root;

void setup()
   Serial.println("SD text file sender starting");
   BTserial.println("SD text file sender starting");
   if (!SD.begin(10))
      Serial.println("initialization failed!");
      while (1);
   Serial.println("initialization done.");

   File dataFile ="SD_HELP.TXT");

   // if the file is available, write to it:
   if (dataFile)
      while (dataFile.available())

void loop()

If you want help with using a specific Arduino board and/or SD module, you will need to tell us what you have.

Read the forum guidelines to see how to get the most from this forum.

Can you pair the HC05 with your PC and connect the HC05 to a Bluetooth enabled app?

Yes, thank you. I tried the Serial Bluetooth terminal app as well. Apparently, when the bluetooth connection is ended, the data in bluetooth terminal, with the timestamps, is automatically saved into into the phone's internal storage as a .txt file. Indirectly, this does what I am looking for lol.

PS: Shouldn't the code also have datafile.write() to save data into the SD card?

Thanks again.

Your OP said nothing of code to save the data from the sensor to the SD card. Unfortunately my crystal ball is out for service so I had no way to know. :slight_smile:

Right right. Apologies, my bad :slight_smile:

Thanks again. I will give it shot.

If you have trouble post the code and tell us what the code actually does and how that is different from what you want. Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

1 Like

The DumpFile example included in the IDE should be all you need. You just need it to wait for an input from the receiving device, usually the filename. Any device will do, although there is one Bluetooth terminal I know of that does not record a datastream. I think it's called Bluetooth Terminal for Android. You can download several different files in one session as they are identified by your triggering command.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.