Bluetooth communication - how to communicate in Strings

Hi,

I have a HC-05 connected to my Uno, I want to make it do things with my PC and eventually other devices, so far I am trying to do a sanity check using TeraTerm.

My test code:

#include <SoftwareSerial.h>
SoftwareSerial BTserial(10, 11); // RX | TX

void setup()
  {
    BTserial.begin(9600);
  }
void loop()
  {
    BTserial.print("Hello World"); 
    delay(4000);
  }

My Serial port setup in TeraTerm:
Port: COM6
Baud rate: 9600
Data: 8 bit
Parity: none
Stop: 1 bit
Flow control: none

Transmit delay: 0 msec/char, 0msec/line

The terminal displays some circles and foreign characters every 4 seconds.

What have I overlooked?
Thanks.

Has you PC's Bluetooth device paired with the Arduino Bluetooth device?

The settings in TerraTerm should match those required by the Bluetooth device on your PC. And the serial settings on the Arduino should match the requirements of the Bluetooth device connected to the Arduino.

For the future, if you want to send data to the Arduino have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R

Thanks for the reply Robin2.

Yes actually I originally followed the examples in the link you have provided and I had problems.

Please see the attached snap for a better explanation of my problem.

Perhaps I have a hardware issue? I’m not sure what you mean by matching the settings.

The upper left screen shot in the picture shows the communication between the Arduino and the Serial Monitor application, on COM4.

The lower left screen shot shows the communication between Tera Term and some unknown device, on COM6.

Why are you asking questions about the unknown device on the Arduino forum?

Image from Reply #2 so we don’t have to download it. See this Simple Image Guide

c2bbcbb04fca82a5a04d508662a1240d49360e4c.png

…R

@PaulS must have better eyesight than me. I can’t read those pictures.

Please don’t post pictures of text. Just copy and paste the text.

…R

Robin2:
@PaulS must have better eyesight than me. I can't read those pictures.

Please don't post pictures of text. Just copy and paste the text.

...R

I opened the pictures using the links, then zoomed in. The text was then readable.

I was going to comment on the text as pictures, too, but I think there is important information in the window titles.

PaulS:
I opened the pictures using the links, then zoomed in. The text was then readable.

I don't have any use for those pictures on my hard disk.

The OP can easily copy the header text if it is important

...R

Robin2:
I don't have any use for those pictures on my hard disk.

The OP can easily copy the header text if it is important

...R

Normally, I'd agree. But, how often do we berate users for deciding, for us, what is important? How often does it occur that what they thought was important wasn't really what was important?

I'm not yet convinced that OP recognizes the significance of the window titles.

Apologies for not uploading the image in the preferred way, it is noted.

The upper left window is the Serial Monitor from the IDE which is monitoring COM4 connected via USB.

The lower left is monitoring COM6, which is Serial over Bluetooth Link, it is not an unknown device, it's just the HC-05 module which is paired to the PC Bluetooth. I am expected communication through here, is my expectation wrong?

Apologies if I have asked in the wrong place, I have a software background and trying to develop skills in some hardware applications.

The code in the picture doesn't match the code in your first post.

The code in the picture is not using SoftwareSerial to talk to the bluetooth device, unless you connected it to the hardware serial pins. The code in the first post does not indicate that you have done that.

So, what HAVE you connected the bluetooth device to?

codemode:
Apologies for not uploading the image in the preferred way, it is noted.

I'm glad to see that you have noted it. But that does not make it possible for me to read it.

...R

Yes, that is because the guide on this website does not use SoftwareSerial, and when I failed to make that work I found some other tutorials, which make use of this library.

Regardless, the terminal is connected to the HC-05 module via the PC's Bluetooth adaptor in both cases, I'm not sure what the confusion is with that.

To reiterate, the aim is to have two-way communication between the terminal and Arduino.

Thanks.

Regardless, the terminal is connected to the HC-05 module via the PC's Bluetooth adaptor in both cases, I'm not sure what the confusion is with that.

Draw a picture. Every time you try to describe what is connected to what, you cause more confusion than you clear up.

You keep referring to THE HC-05 module. One radio is useless. You need two of them to communicate.

You have some code that you are actually running. It does something. It does not do other things. Post the code. Describe what it actually does. Describe what it does not do.

I thought it was pretty clear but here is a data flow diagram:

bluetooth-dfd.png

I have since changed the baud rate to 38400 and it works flawlessly, I'm not sure what this means at a hardware level but all the guides and documentation involving the HC-05 seem to use 9600.

I am now able to communicate strings to the terminal in the laptop and to an Android device.

Thanks for your help.

bluetooth-dfd.png

codemode:
I thought it was pretty clear but here is a data flow diagram:

Your diagram does not show the power and GND connections which are essential.

...R

Robin2, of course power and ground are essential. See data flow diagram.