• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Bluetooth Serial Monitor for Arduino

ApolloDG

Lurker
Hello. I have made an arduino project that uses a keypad and OLED display to save the user's input for date, price, litres and miles for my car so I can track MPG. I have done this so it saves the data to an SD card like this (Date, Price, Litres, Miles):

020819, 12.18, 15.14, 121.4
100819, 12.18, 15.14, 121.4
160819, 12.18, 15.14, 121.4
310819, 12.18, 15.14, 121.4

This is fine for a manual extract of the SD card and then just dropping the txt file into excel on my PC, I can plot a graph for MPG over time like this fine.

But I have now implemented Bluetooth to my project just to expand my coding knowledge and to eliminate the need to extract the SD card.

My question is, could you help me try to make or find an android app to either save the incoming serial data to a .txt file (basically copying the txt file on the SD card to my phone), that I can then use excel on my phone to view; or to expand my knowledge even further to try and code an app of my own that simply looks at the serial monitor to then plot a graph and copy the txt file on the SD card as well maybe.

Is there a way that I could use the MIT app inventor? The only mildly related information I could find so far is a spanish video that I am finding hard to follow:
 
This is how I am currently taking the information from the SD card and transmitting it over bluetooth:

(I have confirmed it works by installing an app called 'Arduino bluetooth controller' and using its built in terminal which basically is the functionality I am looking for, but without the key the capability of either being able to save the terminal as a txt file or being able to copy the txt on the terminal and then paste it into a txt file myself.)

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

File myFile;
String strRead,str;
const int chipSelect = 10;

void setup()
{

Serial3.begin(9600);

Serial3.println("Initializing...");

if (!SD.begin(chipSelect))
{
Serial3.println("SD FAIL");
while(1);
}
Serial3.println("SD DONE");

myFile = SD.open("fuellog.txt");

if (myFile)
{
Serial3.println("fuellog.txt:");

while (myFile.available())
{
strRead = myFile.readString();

Serial3.print(strRead);

//myserial.write(Serial3.read());
}

myFile.close();
}
else
{
Serial3.println("SD FAIL READ");
}
}

void loop()
{

}
 
Back
Top Bottom