Bluetooth Bee Standalone & DFROBOT IO Expansion Shield

Hello,…

today i recieved a DFRobot IO Expansions Shield V5 and a Seeeduino Bluetooth Bee Standalone. My Problem is that i cant get it work together. When i plug the Xbee on the IO shield and run this code, my arduino can not be found as Bluetooth. When i plug the Bee on my Mega Sensor Shield on the COM2-Socket for XBees and set the Tx/Tx-Pin in the Code then it works.

Whats wrong?

Thanks
Peter


/*
BluetoothBee Demo Code - Delay Based Implementaion
2011 Copyright (c) Seeed Technology Inc.  All right reserved.
 
Author: Visweswara R
 
This demo code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
 
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.
 
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
For more details about the product please check http://www.seeedstudio.com/depot/
 
*/
 
/* Upload this sketch into Seeeduino and press reset*/
 
#include <NewSoftSerial.h>   //Software Serial Port
#define RxD 0
#define TxD 1
 
NewSoftSerial blueToothSerial(RxD,TxD);
 
void setup() 
{ 
    //Serial.begin(38400);          //Serial port for debugging, Comment this line if not required  
    pinMode(RxD, INPUT);
    pinMode(TxD, OUTPUT);
    setupBlueToothConnection();
 
} 
 
void loop() 
{ 
 
  if(blueToothSerial.read() == 'a')
  {
    blueToothSerial.println("You are connected to Bluetooth Bee");
    //You can write you BT communication logic here
  }
} 
 
void setupBlueToothConnection()
{
    Serial.print("Setting up Bluetooth link");       //For debugging, Comment this line if not required    
    blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
    delay(1000);
    sendBlueToothCommand("\r\n+STWMOD=0\r\n");
    sendBlueToothCommand("\r\n+STNA=Arduino\r\n");
    sendBlueToothCommand("\r\n+STAUTO=0\r\n");
    sendBlueToothCommand("\r\n+STOAUT=1\r\n");
    sendBlueToothCommand("\r\n+STPIN=987654\r\n");
    delay(2000); // This delay is required.
    blueToothSerial.print("\r\n+INQ=1\r\n");
    delay(2000); // This delay is required.
    Serial.print("Setup complete");
 
}
 
void sendBlueToothCommand(char command[])
{
    char a;
    blueToothSerial.print(command);
    Serial.print(command);                          //For debugging, Comment this line if not required    
    delay(3000);
 
    while(blueToothSerial.available())              //For debugging, Comment this line if not required  
    {                                               //For debugging, Comment this line if not required   
       Serial.print(char(blueToothSerial.read()));  //For debugging, Comment this line if not required  
    }                                               //For debugging, Comment this line if not required   
}

For the Bluetooth Bee standalone,it already have a MCU there,so you can download the demo code directly to the Bluetooth bee.
For you code,there have a problem,for the D0,D1 is the hardware Serial port,so for you code,you use the software and the hardware serial port as the same one,so it’s confuse to the Bluetooth.For the DFRobot IO Expansions Shield V5,its TX/RX is directly connect to the hardware serial,so it can not use the hardware to communicate with the PC by hardware serial.
For the Bluetooth Bee standalone you can see our wiki http://www.seeedstudio.com/wiki/Bluetooth_Bee-Standalone

mhh but can i use my MEGA as ISP to programm that 168? And how?

Hi,
I try the mega,but it can not work.
Try the UNO,It’s ok.
I just follow the linkhttp://arduino.cc/en/Tutorial/ArduinoISP

It can…
instructables.com/id/How-to- … duino-isp/

Well its an Xbee. Can i programm it via a XBee-Port?

Thats not necessary… on your Mega Sensor Shield it runs without problems (?).

I think the reset-circuit on the DFRobot IO Shield is incombatible with bluetooth bee. The bee already has a reset-circuit on board.

Just try a simple program (hardware serial print or blinking led) to check this.