Android bluetooth HC05 comms w/ byte-flags?

Hello! My HC05 bluetooth module came in the mail and I’ve had a few hours so far to get familiar with it. I was able to send and receive messages from the serial monitor on my PC and the Bluetooth Chat Android Studio sample project.
Now, I want to implement my own system using simple ASCII characters: a byte is sent from my Arduino UNO to Android after an event occurs (for example, after sensor data is received). The byte is received in the Android app, which then begins a new event in-app. Simple! :slight_smile:

But I would like to hear suggestions on where to begin before I journey into the unknown. I have heard of similar projects done in many different, complicated ways. In this thread, I would like to gain knowledge about the minimum steps needed on both Arduino and Android to accomplish such a basic transmit/receive system.

It is worth noting that I am skilled in C and serial comms. I’m new to bluetooth and understand there are different approaches to my project.

That said, if you have experience with what I’m trying to do, I’d appreciate some pointers. Thanks!

pmcg521:
I am skilled in C and serial comms. I’m new to bluetooth and understand there are different approaches… if you have experience with what I’m trying to do,

In the light of what you have already done, what you are trying to do is far from clear, but it sounds rather like you are looking for a complexity that isn’t there. In the immortal words of some guru on this forum, bluetooth is simply “serial without wires”. Since you are already skilled in serial comms, there isn’t much else to say.

If you are actually looking for Arduino<>Arduino comms rather than Arduino<>Android, try
http://www.martyncurrey.com/connecting-2-arduinos-by-bluetooth-using-a-hc-05-and-a-hc-06-pair-bind-and-link/

Nick_Pyner:
In the light of what you have already done, what you are trying to do is far from clear, but it sounds rather like you are looking for a complexity that isn’t there. In the immortal words of some guru on this forum, bluetooth is simply “serial without wires”. Since you are already skilled in serial comms, there isn’t much else to say.

If you are actually looking for Arduino<>Arduino comms rather than Arduino<>Android, try
http://www.martyncurrey.com/connecting-2-arduinos-by-bluetooth-using-a-hc-05-and-a-hc-06-pair-bind-and-link/

I was very clear with what advice I’m looking for: Arduino<>Android. If this was as simple as serial without wires, I would have no need to post here. I’ve found it difficult to find extensive resources that handle information regarding Android reception of Arduino data. I posted with hopes to gather such info, whether it be code samples or detailed advice.

pmcg521:
I was very clear with what advice I’m looking for: Arduino<>Android. If this was as simple as serial without wires, I would have no need to post here. I’ve found it difficult to find extensive resources that handle information regarding Android reception of Arduino data. I posted with hopes to gather such info, whether it be code samples or detailed advice.

You were not clear at all, hence my comment. You might start by attempting an explanation as to why your “basic transmit/receive system” will be different from everybody else’s, and thus not simple. Don’t spend too long on this…

Bluetooth really is as simple as serial without wires, this to the point where Arduino neither knows nor cares if bluetooth, wire, or even nothing, is connected to the COM port it is talking to. If you know nothing about bluetooth, which is clearly the case, this is the first thing you need to learn, and posting here to find that out is not such a bad idea. I did the same.

If you want to re-invent the wheel, the place to do it is at the Android end, and I’m sure some assistance, and some home truths, will be found on an Android forum. For Arduino users,Serial.print(ladedah); usually suffices. It suffices for most Android users as well.

The above might also go some way to explain your failure to find “extensive resources that handle information regarding Android reception of Arduino data”.

pmcg521:
I was very clear with what advice I’m looking for: Arduino<>Android. If this was as simple as serial without wires, I would have no need to post here.

You have described what you want to do but even that is only in a very general way. You have not told us what it is that you need help with.

If you want useful advice then give us a good description of the whole project so we can see your questions in context.

It sounds to me as if you are having difficulty with your Android program - and if so this is not the place to seek advice.

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. The same concepts are just as relevant at the other end of the communication system.

…R