Pages: [1]   Go Down
Author Topic: Connecting Arduino to Android Phone using Bluetooth  (Read 7933 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
My brother and I have made a tutorial on making an Arduino project to connect an Android phone to and Arduino using Bluetooth.

Check it out here: Connect an Android phone to and Arduino using Bluetooth.

I've rated the tutorial as intermediate, please tell me if you think this is too high!
« Last Edit: September 03, 2011, 06:02:55 pm by TobyM95 » Logged

Author: Best CPU
Co-Author: Arduino Projects

Offline Offline
Full Member
***
Karma: 1
Posts: 200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks fine Toby.
Logged

Rome - Italy
Offline Offline
Full Member
***
Karma: 2
Posts: 246
Arduino UNO "Noob" User
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The BT module is set at 9600 baud rate.

On the Amarino site is written: IMPORTANT!!! Please set your Bluetooth module to 57600 baud (using Putty or other Terminal programs) otherwise you will get corrupted data. Only the Arduino BT board works with 115200 baud without flaws.

How did you set the baud rate?  smiley-sad-blue
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Nikka93,

Have a look at http://www.circuit-blog.com/how-to-change-baud-rate-of-bluetooth-modem-bluesmirf-gold-using-arduino-terminal/

This should tell you how to set the baud rate, although it may depend on your module. 57600 would be ideal, but if you can't change it try using the default baud rate and see if that works smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nikka93, the default baud rate (9600 baud) worked fine for me. I've added this to the tutorial so other people don't get confused! I will also add a note linking to the guide Nubula suggests, just in case.
Logged

Author: Best CPU
Co-Author: Arduino Projects

Rome - Italy
Offline Offline
Full Member
***
Karma: 2
Posts: 246
Arduino UNO "Noob" User
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also worked fine at 9600  smiley-lol
Logged

0
Offline Offline
Edison Member
*
Karma: 20
Posts: 2231
Have you mooed today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
i'm using the same bt module:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1284987911

I 'm using that through SoftwareSerial; in this way it's possible to use the serial for debugging purpose  smiley-wink

Code:
#include <NewSoftSerial.h>

#define rxPin 2
#define txPin 3

NewSoftSerial myBluetooth(rxPin,txPin);

void setup() 
{
  Serial.begin(9600);
  Serial.println("Let's Start with pitusso!");

  // set the data rate for the NewSoftSerial port, idem as Serial for DEBUG purpose
  myBluetooth.begin(9600);
}

and so on...

Instead of Amarino, i've used AppInventor, to build my app.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

I'm having trouble with the bluetooth communication. I'm using the bluetooth mate gold from sparkfun and the arduino MEGA ADK. my code is below. Any help would be greatly appreciated. Thanks!


#include <SoftwareSerial.h>

//RX AND TX PIN ASSIGNMENTS FOR THE ARDUINO MEGA ADK
int bluetoothTx = 2; 
int bluetoothRx = 3;

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

void setup()
{
  //Setup usb serial connection to computer
  Serial.begin(9600);

  //Setup Bluetooth serial connection to android
  bluetooth.begin(115200);
  bluetooth.print("$$$");
  delay(100);
  bluetooth.println("U,9600,N");
  bluetooth.begin(9600);
}

void loop()
{
  //Read from bluetooth and write to usb serial
  if(bluetooth.available())
  {
    Serial.print((char)bluetooth.read());
  }

  //Read from usb serial to bluetooth
  if(Serial.available())
  {
    bluetooth.print((char)Serial.read());
  }
}
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 31
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

that link is giving me a 404

I have been playing around with the jy mcu bluetooth module and have had some success. I used this instructable
http://www.instructables.com/id/Androino-Talk-with-an-Arduino-from-your-Android-d/

I had to install the sla4 android and python for android but it works pretty well. As of now I can only receive sensor data from one pin but I havent played around with the code too much to see how I can get data from more pins and send data back to the arduino which is my ultimate goal
as for the amarino project I havent had as much luck with it. I have changed my baud rate and the test event is sending data but I get nothing from my serial monitor. I really want to get this up and running.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino Mega 2560 board shows port 2 as a non-serial port. My mega has 0, 15,17 and 19 as rx ports, 1, 14, 16 and 18 for tx
Logged

Pages: [1]   Go Up
Jump to: