Introduction: How to Install and Use the JY-MCU Bluetooth Module for Arduino

Picture of How to Install and Use the JY-MCU Bluetooth Module for Arduino

Hello, in this instructable i will be teaching you how to install and use the JY-MCU Bluetooth module for Arduino. This little module will let you control your arduino wirelessly from your computer or phone. Lets start.

Step 1: Wire JY-MCU to Arduino

Picture of Wire JY-MCU to Arduino

Your JY-MCU should have four pins, with labels for each one on the back. The VCC pin should go to the 5V pin on your arduino. The ground pin on your JY-MCU should go to the ground pin on your arduino (duh) which is right next to the 5V pin. The TXD pin on the JY-MCU goes to the digital pin 0, which should have the letters RX next to it. Finally, the RXD pin on the JY-MCU should go to digital pin 1, which should have the letters TX next to it. The RX and TX pins are right next to each other.

VCC ------ 5V

GND ------ GND

TXD ------ Digital pin 0

RXD ------ Digital pin 1

Step 2: Test Code

Test Code:

char vel;

int ledPin = 13;

void setup() {

pinMode(ledPin, OUTPUT);

Serial.begin(9600);

}

void loop() {

if(Serial.available()) {

val = Serial.read();

}

if(val == 'H') {

digitalWrite(ledPin, HIGH);

}

else {

digitalWrite(ledPin, LOW);

}

delay(100);

}

Step 3: Connect to and Test JY-MCU

Picture of Connect  to and Test JY-MCU

The JY-MCU module uses bluetooth's serial communication to send and recieve characters that can be used to control things. For example, in the test code, when the module recieves the character "H", led 13 will light up on your arduino board. To connect to the module, your arduino needs to be powered. You should also have the test code running on the arduino. Before you have connected the module, there will be a red light blinking.

Connect on a Computer(windows):

Your computer needs to have built in bluetooth or an external usb dongle.

1. Download PuTTy

2. Go to the control panel. Then click "Add a device" under the Hardware and Sound section. In a second your Bluetooth device should show up on the list. Mine was called HC-06. The default password is 1234. The add a device window should close automatically after you enter the password. The module won't say it is connected - this is fine do not worry about it. Right click on your device, click properties and go to the hardware tab. The window should say what COM port it is on. In my case the COM port was COM5.

3. Open putty. When you open putty it will automatically be on the SSH connection type. Change this to the serial connection type. In the Serial line box, type what COM port your module was on (I had to put COM5). Change the speed to 115200. Click open. A window will open if everything goes right. The JY-MCU should go from blinking red to solid red. Now, if you have the test program in the arduino, when you press "H" in the window led 13 should light up on the arduino. When you press "L", the light will turn off.

Congrats! You have succesfully connected to the Bluetooth module!

Connect on Android:

This method is much easier than the computer one. Your android phone must have built in Bluetooth.

1. Go the the bluetooth settings. Connect to the module and put int the password, 1234. Like the computer the android won't say it's connected.

2. Download this from the play store: Bluetooth Serial Controller

3. In the app, click the magnifying glass. Then click on your JY-MCU module. It should then connect. The blinking red light on the module should go to solid red. Then you can type "H" on the line and click send. Led 13 should light up. It will turn off is you send "L".

Congrats! You have successfully connected to the Bluetooth module via your phone!


Step 4: The Rest Is Up to You!

The rest is up to you! You now have the power of Bluetooth. You can create tons of remote-controlled robots now. There are many projects on instructables that use this awesome little module. One of my favorites is this rover made by ASCAS: DIY Phone Controlled FPV Rover (Fast & Agile)

Have fun! Leave a comment with any questions/concerns.

Comments

dopke13 (author)2017-03-05

vel on top of the code should be val

taika22 (author)2014-10-21

Hi,

when connect the JY-MCU Bluetooth module to the arduino uno and want to upload the test code, I received this message:

avrdude: stk500_getsync(): not in sync: resp=0x00

do you have an explanation

Thank you very much

Mateco (author)taika222015-01-21

that is the problem of the atmel chip. same happened to me, i bought a new one. its pretty cheap

lhenrique9 (author)taika222014-12-14

Always disconnect TX and RX pins from Arduino when uploading the code. Good Luck!

vak52 (author)taika222014-10-21

Hi, that error happens when your computer has trouble communicating with the arduino. Make sure you have the correct board chosen in the arduino IDE. Please let me know if this helped you or not.

Good luck!

lhenrique9 (author)2014-12-14

Congratulations! Awesome instructable. What about the 3,3V Voltage on RX pin of the module (Arduino delivers 5V)?

apburner (author)2014-08-27

Very nice.

vak52 (author)apburner2014-08-31

Thanks!

About This Instructable

11,496views

60favorites

License:

Bio: Hello! I'm 14 and I have a love for electronics. I enjoy messing with arduino, raspberry pi, and circuits.
Add instructable to: