You are on page 1of 4

PREPARE BY : MOHD RAZIN ROZILAN FB : https://www.facebook.

com/inraz
YOUTUBE : http://www.youtube.com/watch?v=tD2TfDRYjSg&list=UU76JpAJkDUrVW6R1HHLBhZQ




TITLE : ARDUINO + BLUETOOTH + ANDROID
Objective : Using an arduino microcontroller board to be the brain of an application with the
combination of a Bluetooth module to get the instruction to be execute that is send by an
android phone using android application example lighting up the outdoor lamp using phone
and much more application that can apply.
List Material :
1. Arduino Uno
2. Bluetooth Bee or any Bluetooth module
3. LED (can use on board led pin 13)
4. Android phone
5. USB Cable type B
6. PC
Software :
1. Arduino 1.0 IDE
2. Tenet Meet Arduino.apk or BlueTerm.apk (get at Google Play)
Instruction :
Arduino Part
1. Connect Bluetooth Bee to the Arduino Uno









PREPARE BY : MOHD RAZIN ROZILAN FB : https://www.facebook.com/inraz
YOUTUBE : http://www.youtube.com/watch?v=tD2TfDRYjSg&list=UU76JpAJkDUrVW6R1HHLBhZQ
2. Connect the LED or use the on board LED (pin 13)

3. Connect USB cable to the PC
4. Open the Arduino IDE and select the board type and COM port
5. Write the example code
6. Burn the code into the arduino
Android Part
7. Turn on the phone B2luetooth
8. Go to Setting > Bluetooth
9. Search the Bluetooth module then pair it with the phone (password 1234)





>>>>>>>>











PREPARE BY : MOHD RAZIN ROZILAN FB : https://www.facebook.com/inraz
YOUTUBE : http://www.youtube.com/watch?v=tD2TfDRYjSg&list=UU76JpAJkDUrVW6R1HHLBhZQ
10. Open the apps and connect with the Bluetooth module that is connected to the arduino















11. Then press A or press Turn ON
















12. The LED on pin 13 now while light UP
13. If press other that A or press Off the LED on pin 13 now while ligh off

PREPARE BY : MOHD RAZIN ROZILAN FB : https://www.facebook.com/inraz
YOUTUBE : http://www.youtube.com/watch?v=tD2TfDRYjSg&list=UU76JpAJkDUrVW6R1HHLBhZQ
Example Code :
#include <SoftwareSerial.h>
char val; // variable to receive data from the serial port
int bluetoothTx = 0;
int bluetoothRx = 1;

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

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

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

void loop()
{
if( Serial.available() ) { // if data is available to read
val = Serial.read(); // read it and store it in 'val'
}

if( val == 'A' ){ // if 'A' was received
digitalWrite(13, HIGH); // turn ON the LED
delay(1000);
}

else {
digitalWrite(13, LOW); // otherwise turn it OFF
}
delay(100); // wait 100ms for next reading
}

You might also like