Data Retreival

Hello,

I am working with a GPS and and accelerometer. I am able to get the module to work and print to the Serial monitor, but I was hoping that I could have this information be stored for retreival at a later date, and also the option to have the data be sent via bluetooth to an android or iphone for Real Time collection. Has anyone worked with this?

I currently have the bluemate silver bluetooth module, the BNO055 accelerometer/gyroscope, and the GPS 60 Hz Breakout module. I have been able to get the data that I want with these, and I have been able to use an Android app and send infromation from the android to the Serial Monitor using bluetooth, but I have not understood how to use the Android app as a receiver, and have the data that is printed to the serial monitor be sent to the android app. Again, I would like to be able to store the information that the GPS and accelerometer print to the serial monitor to be able to collect at a later time as another feature.

Any help would be amazing! Thanks!

ProfessorFuturama: have the data that is printed to the serial monitor be sent to the android app.

  1. If you really are printing to the serial monitor, I fail to see where Android comes into it. All you need do is ditch the serial monitor and use a proper terminal programme instead. RealTerm, and several others, all free, allow you to record direct to the PC hard drive.

  2. If the serial monitor is really just incidental, you can send the same data to a bluetooth terminal on Android by simply connecting bluetooth to the serial port - no change of code required.

  3. You may also store the data on an SD card and download the file at leisure. This sure as hell beats standing around with a phone in your hand. The same Android bluetooth terminal programme can be used to collect the file(s).

You might find the following background notes useful

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

Thank you for your replies.

As far as this project, I am trying to get a working product that is not connected to a computer. Essentially, I wilkl have a battery power arduino nano, GPS module. bluetooth, and accelerometer. The dat collected will transmit throught the bluetooth to an andoid for real time data collection, and will also store the data into memory (sd, ram) for allowing the user to retreieve the data if the android has power failure.

At the moment, I have been able to test the modules to make sure they are functioning the way i want, and can prove this by printing to the serial monitor. However, I do not understand how I get that same information that is printing to the serial monitor to transmit through bluetooth to the andriod, as well as store into a memory.

I hope this clarifies my project better.

Learn the Android OS, Java/Kotlin and yeah...have fun! A simple bluetooth capable app is fairly simple to write. The documents are well resourced.

Android Developer Notes: Bluetooth

As far as a project and your questions...you don't seem to have much of a plan for an app...other than "it gets the data and saves it to memory". That is a 5 minute android programming job...

You have tested your bluetooth. So how did you write/print?

Instead of printing to serial monitor, you can use the print that you used for the bluetooth.

Again thanks for the replies.

My goal is to obtain data from sensors (accelerometer, gps). I have tested the bluetooth using a android app called serial bluetooth, in which I was able to connect to the bluetooth module, and send data that would be printed on the serial monitor. I used a simple commands using the Serial1 for bluetooth and Serial for serial monitor. If serial1.available, serial.print(char(Serial1.read)). Something like that.

To summarize, I would like the information that I can see that displays on my serial monitor (when I have the computer connected to the arduiino with the GPS and accelerometer, feeding the data directly to the computer serial monitor), to be sent via bluetooth to an android app (hopefully one that is already created) so I can view the real time data on this app. additionally, I would like to have the data that wsa collected to be stored into memory in which I can later access. At the moment when testing with everything connected to the computer, The data scrolls down the serial monitor, and if I were to close the serial monitor, the data is lost and starts over.

Any ideas on android (or iphone if possible) apps that have been made for the purpose of displaying what is printed to a serial monitor? Also, what would be the best way to store the information gathered for later retreival?

You write code for the Arduino to write to HC-05 which in turns will write

ProfessorFuturama: Any ideas on android (or iphone if possible) apps that have been made for the purpose of displaying what is printed to a serial monitor?

No.

And you are still not understanding how this works.

if I were to close the serial monitor, the data is lost

Then do not use the serial monitor, instead use a terminal program, as you were advised in reply #1.

Printing to the serial monitor is strictly for testing that the sensors work. Now that I know that they work, I do not understand how to have the data sent to the bluetooth. I am using example codes from the GPS and accelerometer, in which write to the serial monitor.

"You write code for the Arduino to write to HC-05 which in turns will write"

What I don't understand how to do is the retreival of the bluetooth data.

So maybe showing you the code that I have written will better enunciate my problem.

GPS code

void setup() {}
void loop() {}

That’s it for the GPS module. As you can see I do not have any code written, but if I load that and connect the TX and RX to the TX and RX of the nano, open the serial monitor, I will retreive the data from the GPS.

Bluetooth Code

#include <Wire.h>
#include <arduino.h>
#include <SoftwareSerial.h>
SoftwareSerial Serial1(11,12);
char message[256];
int index = 0;

void setup()
{
Serial.begin(115200); // Begin the serial monitor at 115200bps
Serial.println(“Bluetooth Example”);
Serial1.begin(115200);
Wire.begin();
}

void loop()
{
if(Serial1.available()) // If the bluetooth sent any characters
{
message[index] = (char)Serial1.read(); // Add the character to the message buffer
if (message[index] == 0x3F) { // Check for the “?” character
for(int i=0;i<index;i++) { // Print the message to the console
Serial.print(message);
}
index = 0; // Reset the message buffer index
Serial.println(); // Print carriage rturn and line feed
}
else {
index++;
}
}

if(Serial.available()) { // If characters were typed in the serial monitor
// Send any characters the Serial monitor prints to the bluetooth modem
Serial1.print((char)Serial.read());
Serial.println();
Wire.
}
}

This works and allows me to send data to the arduino via the blueooth, and print it to the serial monitor. However, when I open the app that I have used to send the data to the arduino, and I try to type information into the serial monitor and send to the app, I do not see anything in the app.

Information goes to the Serial Monitor because your code tells it to! If you want it to go else where, do that !

I don't need to see your code. I understand perfectly what you want.

You are not understanding the concept.

Ya I don't know how to send the information elsewhere. That's what I am asking I guess. I am new, sorry.

For the first step, write whatever you are writing to the Serial Monitor to an SD card.
Use an SD card shield for that.

Once you get that working, you are ready to write that same information to a HC-05 Bluetooth module which is paired with your smartphone Bluetooth app. There are lots of apps in Google Play store to choose from. I used https://play.google.com/store/apps/details?id=me.aflak.bluetoothterminal&hl=en

Thanks for the responses and sorry if this sounds like a broken record.

The project is to throw a device and have data recorded using an accelerometer and GPS. This will obviously be needing a battery supply and will not be connected to a computer.

I have been testing the GPS and accelerometer, as well as a bluetooth mdule (silvermate) to make sure that they are functioning. I was able to use example sketches for the accelerometer, and have been able to print what I would like (acceration and angle) to the Serial monitor.

The GPS unit I strictly just connected the TX and RX of the GPS and the microcontroller, and uploaded a blank sketch. After doing so, I opened the Serial monitor and information about the velocity, coordinates time, etc was logged to the Serial monitor.

The bluetooth I was able to find an app on an android (Bluetooth Serial Controller) and connect it to the bluetooth. I then tested the code which I found that I was able to send data from the android (prssing a button or typing a string) and retreive the data on the serial monitor.

However, I will want to do the exact opposite of this, and I will want to take the data from the GPS and the accerletometer, and send it to an android( or Iphone) app, for which I will be able to see in real time as the device is flying through the air. Also, I would like to store this data (log to an SD or EEPROM perhaps?) so that when I grab the device, I can plug it into a computer and see the data that it logged.

I was informed that the serial software may have problems at communicating using 115200 baud rate. I am NOT USING THE HC-05. I AM USING THE BLUETOOTH MATE SILVER which has a default BAUD of 115200.

I hope this explains my issues better, and hope that I am not coming off as a broken record. Thanks for the patience.

The project is to throw a device and have data recorded using an accelerometer and GPS. This will obviously be needing a battery supply and will not be connected to a computer.

I have been testing the GPS and accelerometer, as well as a bluetooth mdule (silvermate) to make sure that they are functioning. I was able to use example sketches for the accelerometer, and have been able to print what I would like (acceration and angle) to the Serial monitor.

The GPS unit I strictly just connected the TX and RX of the GPS and the microcontroller, and uploaded a blank sketch. After doing so, I opened the Serial monitor and information about the velocity, coordinates time, etc was logged to the Serial monitor.

The bluetooth I was able to find an app on an android (Bluetooth Serial Controller) and connect it to the bluetooth. I then tested the code which I found that I was able to send data from the android (prssing a button or typing a string) and retreive the data on the serial monitor.

However, I will want to do the exact opposite of this, and I will want to take the data from the GPS and the accerletometer, and send it to an android( or Iphone) app, for which I will be able to see in real time as the device is flying through the air. Also, I would like to store this data (log to an SD or EEPROM perhaps?) so that when I grab the device, I can plug it into a computer and see the data that it logged.

ProfessorFuturama: Thanks for the responses and sorry if this sounds like a broken record.

The project is to throw a device and have data recorded using an accelerometer and GPS. This will obviously be needing a battery supply and will not be connected to a computer.

I have been testing the GPS and accelerometer, as well as a bluetooth mdule (silvermate) to make sure that they are functioning. I was able to use example sketches for the accelerometer, and have been able to print what I would like (acceration and angle) to the Serial monitor.

The GPS unit I strictly just connected the TX and RX of the GPS and the microcontroller, and uploaded a blank sketch. After doing so, I opened the Serial monitor and information about the velocity, coordinates time, etc was logged to the Serial monitor.

The bluetooth I was able to find an app on an android (Bluetooth Serial Controller) and connect it to the bluetooth. I then tested the code which I found that I was able to send data from the android (prssing a button or typing a string) and retreive the data on the serial monitor.

However, I will want to do the exact opposite of this, and I will want to take the data from the GPS and the accerletometer, and send it to an android( or Iphone) app, for which I will be able to see in real time as the device is flying through the air. Also, I would like to store this data (log to an SD or EEPROM perhaps?) so that when I grab the device, I can plug it into a computer and see the data that it logged.

I was informed that the serial software may have problems at communicating using 115200 baud rate. I am NOT USING THE HC-05. I AM USING THE BLUETOOTH MATE SILVER which has a default BAUD of 115200.

I hope this explains my issues better, and hope that I am not coming off as a broken record. Thanks for the patience.

You don't use the software serial, you use the hardware serial. Or you use an Mega.

I have already told you that you write to an SD card. Is that really so hard to understand? ? ? >:(

continuation of http://forum.arduino.cc/index.php?topic=534179.new

reported to moderators to have it merged

ProfessorFuturama: I was informed that the serial software may have problems at communicating using 115200 baud rate.

This is an understatement, thereby leaving you with two obvious choices: 1. Put bluetooth on hardware serial. If you have another serial device, put that on software serial. 2. Reconfigure bluetooth for 9600. I hear rumour that this can be done with a jumper.

Perhaps you and I have a different definition of real-time. How often does your GPS update your Arduino and how accurate is your GPS? How long does all this take before you see a change on your hand held device?

Paul

How do I use the Hardware Serial for the NANO? How would I go about testing?

My guess is that I would connect the RX of the Bluetooth BLUEmate SILVER (default setting of 115200BPS per the datasheet), to the TX1 of the NANO. I would then connect the TX of the Bluetooth Silver (default setting of 115200 BPS) to the RX0 of the NANO. Is this what is you are saying for using the Hardware Serial? If so, I have tried and that doesn't seem to work for receiving on an Android. However, if I open up the serial monitor, I see what was printed.

I cannot use a MEGA.