How do you configure the bluetooth kit with the rover? I cant see the pairing device when I have the blue tooth attached to the board. I attached some pictures of what I have built so far.
Same thing here. My Bluetooth setup is same as OP. My Mac, iPhone and Android tablet cannot find it. I got the Bluetooth rover kit yesterday so it is brand new. The state LED on the Bluetooth module just keeps blinking and I have switched to xbee2. I tried xbee1, same thing.
Did you upload code to the board, and if so, which? Note that the Bluetooth module needs to be physically removed when uploading new code.
Check which baud rate is specified in the code you uploaded, and then see which baud rate the Bluetooth module is set to.
What device will you be using to send commands to the rover via Bluetooth? A computer? Laptop? Tablet etc?
If there is nothing installed in the XBee slots, the XBee switch does not matter.
I uploaded the “wasd” code before I attached the Bluetooth module and I was controlling the rover without the Bluetooth through my computer. The baud rate I’m using is the the same baud rate specified in the code 9600
Your computer has a Bluetooth module connected? What program are you using to send the serial commands via the BT module connected to the computer?
No, I’m using and android phone to control the rover.
You also specified that I need to check the baud rate for the Bluetooth. Is there a specific code for the Bluetooth I need to input in the wasd code also.
If you are using an Android phone, you are likely using a specific application, so you will need to configure that application to use the same communication as the rover (unless certain things are fixed). Can you provide more details? The more information you provide, the better we can help. The pairing code for most Bluetooth modules is either 1234 or 0000.
Here is my code, my question is there suppose to be a code for the bluetooth module in the code so I can control the rover through the Android App. With this code I put below, I can operate the rover when it connected to my laptop with the USB. After I ran a few test with rover connected through the USB, it works perfectly. When I disconnect the rover from the USB and try to find the device through via Bluetooth on my android tablet, it cannot be found. What maybe the problem, is it the bluetooth module or something wrong with my code?
int E1 = 6; //M1 Speed Control
int E2 = 5; //M2 Speed Control
int M1 = 8; //M1 Direction Control
int M2 = 7; //M2 Direction Control
void setup(void)
{
int i;
for(i=5;i<=8;i++)
pinMode(i, OUTPUT);
Serial.begin(9600);
}
void loop(void)
{
while (Serial.available() < 1) {} // Wait until a character is received
char val = Serial.read();
int leftspeed = 255; //255 is maximum speed
int rightspeed = 255;
switch(val) // Perform an action depending on the command
{
case 'w'://Move Forward
forward (leftspeed,rightspeed);
break;
case 'a'://Move Backwards
reverse (leftspeed,rightspeed);
break;
case 's'://Turn Left
left (leftspeed,rightspeed);
break;
case 'd'://Turn Right
right (leftspeed,rightspeed);
break;
default:
stop();
break;
}
}
void stop(void) //Stop
{
digitalWrite(E1,LOW);
digitalWrite(E2,LOW);
}
void forward(char a,char b)
{
analogWrite (E1,a);
digitalWrite(M1,LOW);
analogWrite (E2,b);
digitalWrite(M2,LOW);
}
void reverse (char a,char b)
{
analogWrite (E1,a);
digitalWrite(M1,HIGH);
analogWrite (E2,b);
digitalWrite(M2,HIGH);
}
void left (char a,char b)
{
analogWrite (E1,a);
digitalWrite(M1,HIGH);
analogWrite (E2,b);
digitalWrite(M2,LOW);
}
void right (char a,char b)
{
analogWrite (E1,a);
digitalWrite(M1,LOW);
analogWrite (E2,b);
digitalWrite(M2,HIGH);}
The code itself is fine (seems to be copy / paste from the manual). It is odd that you cannot find the device on your phone (Bluetooth Devices -> Pair). Are you certain the On/Off switch is set to ON? What app are you using?
Attached are my photos of how my entire board looks and the app I’m using is the Arduino Bluetooth controller. Is there a particular app im suppose to be using ?
Have not tried that specific app - when you get it running, perhaps provide a bit of feedback.
Can you unplug the BT module from the rover and plug it into the BT/APC slot on the shield?
Note that you’ll need to change the switch between RUN and PROG (program).
Check the configuration settings of the app to see if there is anywhere to change the communication settings (Baud rate, Xon / Xoff, stop bits etc)
I tried all those steps and it still did not work. Is there any other way I can control the rover through bluetooth? Do i have to buy another bluetooth module or can I buy another arduino board ? My main goal is to control the rover by bluetooth and have two analog gas sensors on it, so it can detect gas while driving the rover.
Is it possible can I use DFRobot Bluetooth Bee and the product code is RB-Dfr-95. Can I attach that bluetooth bee to the DFRobot I/O Expansion Shield for Arduino v7 the product code is RB-Dfr-475. Will that work ?
You can get a Bluetooth module for your computer - they are all relatively inexpensive these days and can be purchased locally or online
robotshop.com/en/bluetooth-u … -mini.html
RB-Dfr-95 should be able to work as well. robotshop.com/en/dfrobot-bluetooth-bee.html
I finally got it working. Turned out that the module was incorrectly configured as a master device so I had to configure it as a slave device. You need a USB to TTL converter to access the BT module which I managed to turn my Arduino Uno as a USB to TTL converter.
Watch this video to turn your Uno into a USB to TTL converter - youtube.com/watch?v=qqSLwK1DP8Q
Then read this wiki for the DFRobot BT Module to access it and configure it correctly. dfrobot.com/wiki/index.php?title=DF-BluetoothV3_Bluetooth_module_(SKU:TEL0026). I assume your module is also configured as a master so all you have to do is to configure it as a slave with this command, “at+role=0”. Also, check that it is already initialized with the “at+state?” command.
After configuring it, my Mac and Android tablets were able to detect it and pair with it.
Really appreciate the explanation. We will need to look into it a bit more on our end as we have sold many of these kits and not had any significant issues with BT configuration. Looking forward to seeing a video of your rover!
I appreciate it so much !!!
I’m Still having trouble turning the module into slave, I done all the steps but when I have the software cool term up and try communicating with the bluetooth module it still does not work. I even wired up the board just like in the video to turn it into TTL converter. Will it be better if I just buy the USB to TTL converter because the only thing my board is properly doing is working when I have the “wasd” code in and have the rover connected through the USB.
I used an actual Arduino Uno, not the one on the rover. I tested it again and it only worked with an actual Arduino board, not the rover. I have tried different wiring configurations with the rover and somehow blew up both LEDs on the Bluetooth module. Haha. At least the module is still alive. Phew! Obviously, the rover’s Uno is set up differently so can’t convert it into a USB to TTL converter… I have tried using the Tx and Rx lines on both black and green pins, nothing. I even switched the lines (Rx->Tx and Tx->Rx then Tx->Tx and Rx->Rx), still nothing. I tried using 3.3V instead of 5V, nothing.
If you have an actual Uno then use it. If not, then yeah, buy the converter.
Thanks I appreciate it