Bluetooth connection with app

Hello, I'm working on a project with 2 thermocouples and a RTC that are connected to an Arduino. I'm in the works of having an app that will display the temperature and the time on it. I'm very new to C++ and Arduino so i am not sure how to output my data via Bluetooth and to make the system wait for input via Bluetooth. I've been looking over the forums and it seems that each library has a different method of going through this but i cannot find what i need.

Any help would be greatly appreciated.

1 Like

Welcome to the forum

Which Arduino board are you using ?

More to the point, what Bluetooth? If you are using standard Bluetooth HC 05, you don't need any library.
Also, where is the app?

Thank you!

I'm using the Arduino uno R3

I'm still in the process of making the app on MIT app inventor. I'm trying to figure out how to make the app read the data and assign it to a variable, and how to make the code send the data for the app to read. Yes, I am using HC 05.

Would it be easier if i created a listed with all of my data and then used "," as a delimiter to break it apart?

In that case you could use a serial link to an HC-05 Bluetooth classic module to transmit the data to the Android app

The Arduino code will implement serial link using SoftwareSerial which will leave the hardware Serial port available for debugging

How does serial link work?

I was reading some code from the forum and they were doing BTSerial.write(Serial.read()) what would this output?

Sorry, these are probably very basic concepts.

It would read a byte from the hardware Serial interface and write it to a serial interface names BTSerial

However, that is not what you see to want to do. Rather you want to read a sensor that returns the temperature and an RTC that returns the time and output that to an instance of SoftwareSerial that is connected to the Blue tooth module. How often that you do that and the format of the output is controlled by the program running on the Uno

What data format is the app expecting ?

I believe its UUID, although I'm not exactly sure what that is.

That makes no sense

The Arduino will be sending two data values. One is a temperature, so probably a floating point value and the other a time, but what format will the time be in ?

From your answers I believe that you are a long way from succeeding with this project

I'm sorry I misunderstood your question. Yes, the temperature will be a float value and the date will be a string.

And I believe it would be easiest if the app was receiving a list.

I was given this project and it definitely exceeds my knowledge, so i appreciate all the help. Prior to this project I had only coded in python hence the limited knowledge of c++.

Which temperature sensor are you using ?

I'm using a K type sensor that is going to a max6675 then to the Arduino.

How far have you got with the Arduino sketch ? Can you print the temperature an/or time to the Serial monitor ?

Yes I have both the date and the temperature assigned to variables that can be printed to the serial monitor.

My code is about 230 lines but if you would like to see it I can send it. It also includes other unfinished parts trying to display to LCD and writing to an SD card when the temperature goes over a certain amount.

If you can print the data to the Serial monitor then you can just as easily "print" it to a Bluetooth module. Do you have such a module ?

Yes, I have a HC 05 Module.

What spare pins do you have on the Uno ?

Yes, this is a CSV file. You send the data each time round the loop, the last being followed by a lineshift. This can be pasted sraight into Excel.

In that event you simply connect Bluetooth to hardware serial pins 0,1 Rx to tx and tx to Rx, and you are done.

Only the analog pins. All the other pins are being used. In fact I might run out of pins. I already gave the BT module pins 0 and 1 for TX and RX.

I'm sorry for my lack of knowledge. My pins are also probably not correct.