Go Down

Topic: "Hello world" with bluetooth and Arduino  ! (Read 4196 times) previous topic - next topic

evantheking

hardware:
Arduino uno , bluesmirf gold bluetooth ( spp profile)

computer connection :
i can see the bluetooth module , connect to it using the right port , but i cant see anything on the hyper terminal !


wiring :




code:
Code: [Select]
void setup()
{
 Serial.begin(9600);
}

void loop()
{

 Serial.println("Hello World");
 }






what im doing wrong ? thanks in advance for the help

PaulS

What do you have on the PC side connecting to the bluetooth device?

evantheking

#2
Nov 28, 2010, 10:58 pm Last Edit: Nov 28, 2010, 11:12 pm by evantheking Reason: 1
bluetoth dongle




i also have this "





both worked and i can see the bluetooth and connect to it  ( i use the toshiba bluetooth software)


arbarnhart

Are you sure about that baud rate? Your picture looks like the one I have (SFE?) and I think the default was 38k (I don't have it with me). What happens with the blinking light? Does it change when you open the serial port on the PC?

evantheking

the bluetooth blinks red light . once i connect to it it turns to solid green light.

so my problem is in the hardware? usually the software doesnt change if its usb serial or bluetooth connected?

arbarnhart

I think your problem is in communicating from the Arduino to the BlueTooth module. The blinking going to solid means that the connection from the PC to the module was made successfully.

Are you powering the Arduino with the barrel jack or USB during the test? I am not sure, but I think you may get port contention if the USB is connected. I use a MEGA for a lot of testing so I have the extra ports and can use the main one for diagnostics. I know on Pro Minis where I have an xBee on the Serial connection I have to disconnect my xBee for FTDI to work and I think I have to disconnect FTDI for the xBee to work (I always do; I am not sure I ever tried leaving it connected).

arbarnhart

#6
Nov 29, 2010, 08:11 pm Last Edit: Nov 29, 2010, 08:21 pm by arbarnhart Reason: 1
One thing more - read the comments on this listing:

http://www.sparkfun.com/products/582

One poster says you are right about default baud rate being 9600.
Another poster said HyperTerminal did not work for him and suggests an alternative. I use PuTTY for most of my testing.

EDIT - one more note: I don't have it in front of me, but the comment about shorting DTR to RTS lit up some synapses; I think I did that. I did serial data comm stuff decades ago and it is one of those things you just do without giving it much thought except for those rare occasions where flow control was really necessary. On many installations it was a big waste of wire as it was shorted on both ends to form a disconnected circle...

evantheking

#7
Nov 30, 2010, 09:52 pm Last Edit: Nov 30, 2010, 09:52 pm by evantheking Reason: 1
thanks for all the replies..

it worked by changing the serial baud rate !!!

Serial.begin(115200);  in code side

and in the hyper terminal , now i can receive from the bluetooth !

didnt expect the baud rate was the problem


Go Up