Go Down

Topic: SOLVED: Seeedstudio BT Shield (Read 21 times) previous topic - next topic

twychopen

I am using it with the Arduino UNO R3. If I am correct R3 is just the latest version, please correct me if I am wrong. So this shield does work with the Arduino UNO.

soyamericano

Seeed BT shield should work with UNO, but I have been unable to actually get it to connect to my android phone. The original poster has had success using the code above, however I have had no such luck.

WinstonP

Yes, the shield DOES work with the UNO R3. The R3 is different in the placement of the reset switch. The prior two designs had the reset towards the center of the board making it difficult to press when other shields are in place.

And yes, the BT shield does work connecting to my laptop. But I want it to connect to my android phone also; and that's where I'm having the problem. Today I'm going to try using the BT shield in Master mode to see if it will at least detect my phone. Basically that's all I want it to do for now - just DETECT my phone, no connections yet.

Winston

soyamericano

Winston, im interested in your results; I've had no luck detecting or connecting to Android

sam_92

#19
Aug 30, 2012, 10:21 am Last Edit: Aug 31, 2012, 07:16 am by sam_92 Reason: 1
Hi everyone.I was frustrated because of seedstudio BT is not connecting to my android Phone(samsung vibrant running ICS 4.0.4).after doing lot of change in code i had finaly made a simple code to work with seedstudio BT also u can connect your android phone and send commands to arduino board.

make sure that your jumper connection is as shown in picture it is default arduino serial com port.
Tx of sheild is connected to RX of arduino(Pin 0)
Rx of sheild is connected to TX of arduino(Pin 1)
Baudrate is 38400bps so no need to change baudrate of sheild its default baudrate of sheild.

Code: [Select]
char val; // variable to receive data from the serial port
int ledpin = 8; // LED connected to pin 48 (on-board LED)
#include <NewSoftSerial.h>   //Software Serial Port


#define DEBUG_ENABLED  1



void setup() {
 pinMode(ledpin, OUTPUT);  // pin 48 (on-board LED) as OUTPUT
 Serial.begin(38400);       // start serial communication at 9600bps
 
 setupBlueToothConnection();
}


void loop() {
 if( Serial.available() )       // if data is available to read
 {
   val = Serial.read();         // read it and store it in 'val'
 }
 if( val == 'H' )               // if 'H' was received
 {
   digitalWrite(ledpin, HIGH);  // turn ON the LED
 } else {
   digitalWrite(ledpin, LOW);   // otherwise turn it OFF
 }
 delay(100);                    // wait 100ms for next reading

}


void setupBlueToothConnection()
{
 Serial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
 Serial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
 Serial.print("\r\n+STNA=SeeedBTSlave\r\n"); //set the bluetooth name as "SeeedBTSlave"
 Serial.print("\r\n+STOAUT=1\r\n"); // Permit Paired device to connect me
 Serial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here
 delay(2000); // This delay is required.
 Serial.print("\r\n+INQ=1\r\n"); //make the slave bluetooth inquirable
 Serial.println("The slave bluetooth is inquirable!");
 delay(2000); // This delay is required.
 Serial.flush();
}

This is a simple led toggle program make sure that to upload this program to your arduino board you need a older version of arduino softwae 0022 .you can write any other program like to control servo here we can write PWM Generation program in this sketch.you can send commands from mobile using Bluetooth SPP software.
I had found that seedstudio BT is not going to inquiry mode automatically that means every time it restart MCU need to send the commands to set it to inquirable mode and also set to slave mode.To work with BT sheild need to write this lines in to code
{
 Serial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
 Serial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
 Serial.print("\r\n+STNA=SeeedBTSlave\r\n"); //set the bluetooth name as "SeeedBTSlave"
 Serial.print("\r\n+STOAUT=1\r\n"); // Permit Paired device to connect me
 Serial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here
 delay(2000); // This delay is required.
 Serial.print("\r\n+INQ=1\r\n"); //make the slave bluetooth inquirable
 Serial.println("The slave bluetooth is inquirable!");
 delay(2000); // This delay is required.
 Serial.flush();
}
.

Go Up