Introduction
Parts of list
- Arduino Mega2 560
- Bluetooth (HC05)
- Breadboard
- Hookup wires
Software required
Connection:
Step 1: Connection from the Bluetooth (HC05) to the Arduino Mega 2560.
Figure1: Bluetooth(HC05)

- In the Bluetooth the Vcc can be connected to the 5v supply of the Arduino Mega board.
- In the Bluetooth the Gnd can be connected to the Gnd supply of the Arduino Mega board.
- In the Bluetooth the Tx can be connected to the Rx of the Arduino Mega board.
- In the Bluetooth the Rx can be connected to the Tx of the Arduino Mega board.
Step2: Connection from the LED to the Arduino Mega2560.
- The positive pin of the LED can be connected to the digital pin 13 to the Arduino Mega board.
- The negative pin of the led can be connected to the Gnd to the Arduino Mega board.
Software steps:
- Open the MIT App Inventor
- Click Start, then a new project
- Design the Bluetooth connection in the app inventor.
- Click the toolbar and add the buttons and set the device of the Bluetooth.
- In the program set the code and click the connect, than Al companion.
- Scan the code and see the output on the board.

Programming
- int led - turn - on - off - in -bluetooth - using - android - apps - in -arduinompin = 13;
- String readString;
- void setup()
- {
- Serial.begin(9600); // Baud Rate
- pinMode(led - turn - on - off - in -bluetooth - using - android - apps - in -arduinompin, OUTPUT);
- }
- void loop()
- {
- while (Serial.available()) //Send data only when you receive data
- {
- delay(4); //delay time
- char c = Serial.read();
- readString += c;
- }
- if (readString.length() > 0)
- {
- Serial.println(readString);
- if (readString == "ON")
- {
- digitalWrite(led - turn - on - off - in -bluetooth - using - android - apps - in -arduinompin, HIGH); // LED ON
- }
- if (readString == "OFF")
- {
- digitalWrite(led - turn - on - off - in -bluetooth - using - android - apps - in -arduinompin, LOW); //LED OFF
- }
- readString = "";
- }
- }
Explanation
- In this article it can work through the Android and Bluetooth set up.
- The LED turns on clicking the ON button.
- The LED turns off clicking the OFF button.
- In another case, we can see the LED on/off in the serial monitor also.
Output

Figure 3: Output
Read articles on Arduino:


Sr KarthigaPosted Feb 29, 2016, 2:42 PM EST
thank you asfend sir
Asfend YarPosted Feb 29, 2016, 9:23 AM EST
good
Sr KarthigaPosted Feb 24, 2016, 2:49 PM EST
Thank you vignesh mani sir
Vignesh ManiTOP 100Posted Feb 24, 2016, 1:13 PM EST
Nice
Sr KarthigaPosted Feb 12, 2016, 11:21 PM EST
Thank you santhakumar sir
Santhakumar MunuswamyPosted Feb 12, 2016, 10:00 PM EST
Thanks for nice share
Sr KarthigaPosted Feb 11, 2016, 8:38 PM EST
Thank you sir
Sibeesh VenuTOP 100Posted Feb 11, 2016, 7:37 PM EST
Nice Share
Sr KarthigaPosted Feb 11, 2016, 2:27 PM EST
Thank you Mohammed sir
Mohammed IbrahimPosted Feb 11, 2016, 8:16 AM EST
nice
Sr KarthigaPosted Feb 11, 2016, 5:42 AM EST
Thank you gowtham sir
Gowtham KTOP 100Posted Feb 11, 2016, 5:30 AM EST
Good One
Sr KarthigaPosted Feb 11, 2016, 4:53 AM EST
Thank you raja sir
Raja TPosted Feb 11, 2016, 3:16 AM EST
Nice, Thanks for sharing
Sr KarthigaPosted Feb 11, 2016, 3:08 AM EST
Thank you shubham sir
Shubham KumarPosted Feb 11, 2016, 2:38 AM EST
Nice one
Sr KarthigaPosted Feb 11, 2016, 2:10 AM EST
Thank you kumaresh sir
Kumaresh RajalingamPosted Feb 11, 2016, 2:10 AM EST
Good one