Home / Snippets / Interfacing Bluetooth Modules HC-05, HC-06, JY-MCU BT_BOARD v1.02 and v1.03 with Arduino Uno and Arduino Mega 2560

Interfacing Bluetooth Modules HC-05, HC-06, JY-MCU BT_BOARD v1.02 and v1.03 with Arduino Uno and Arduino Mega 2560

This tutorial guides you, how to interface Bluetooth module with Arduino UNO and Arduino Mega 2560. Interfacing HC-05, HC-06, JY-MCU v1.02 or v1.03 with Arduino Uno or Arduino Mega 2560 using two serial ports.

HC-05 Pinouts:

Bluetooth HC-05 pinouts

HC-05 & HC-06 have different pin numbers of LEDs only, power and Serial Communication pins are same.

JY-MCU Pinouts:

Bluetooth JY-MCU Pinouts

JY-MCU BT_BOARD v1.02 and v1.03 have same pinouts.

Connections:

Interfacing bluetooth HC-05 with Arduino, Connection Diagram

Interfacing bluetooth HC-05 with Arduino, Connection Diagram - bluetooth device in command mode

Interfacing bluetooth HC-05 with Arduino, Connection Diagram - JY-MCU

Connect Bluetooth Module JY-MCU BT_BOARD v1.02 and v1.03 with Arduino as:

Bluetooth JY-MCUArduino Mega 2560Arduino Uno
1 – GndGNDGND
2 – Vcc+5v+5v
3 – RXTX1TX
4 – TXRX1RX

Connect HC-05 or HC-06 with Arduino as:

BluetoothArduino Mega 2560Arduino Uno
1 – GndGNDGND
2 – Vcc+3.3v+3.3v
3 – RXTX1TX
4 – TXRX1RX

Code for Arduino Mega:

void setup()
{
Serial1.begin(9600);
Serial.begin(9600);
}

void loop()
{
if(Serial1.available())
{
byte a=Serial1.read();
Serial.write(a);
}

if(Serial.available())
{
byte a=Serial.read();
Serial1.write(a);
}

}

 

Code for Arduino Uno:

As Arduino Uno has only one serial port. So we will connect Bluetooth Module with RX and TX pins of Arduino Uno. This code will continuously transmit text “GalaxySofts” and “http://www.galaxysofts.com” with a delay of 1 second.

void setup()
{
Serial.begin(9600);
}

void loop()
{
Serial.println(“GalaxySofts”);
Serial.println(“http://www.galaxysofts.com”);
delay(1000);
}

Video on Interfacing Bluetooth Modules with Arduino Uno and Mega 2560:

 

 

 

Check Also

Smart Messenger with Self Reminder app doesnt show notifications on time

Avoid apps from being removed from Recent Apps List

To save the RAM, apps are usually being removed from Recent Apps List, but with …

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: