Pages: [1] 2 3 ... 6   Go Down
Author Topic: How to get the JY-MCU bt board to work  (Read 76051 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have bought a JY-MCU bt board also called RS232 TTL i think, I want to use it to controll my arduino uno, with my android phone, using the app amarino. But I don't get it to work. I had to change the baud rate to 115200, form 9600. To do that I read that I had to pull pin 34 high. So I soldered a wire to that pin and connected it to 5v. Then I conected the vcc pin on the bt to 5v on the arduino, and the gnd to gnd. I also connected the rx on the bt board to the tx on the uno, and the tx on the bt to the rx on the arduino.

When all these connections are done, and I connected the arduino to a battery. The bt boards led start to blink. And that's all it does. When I try to connect to it with my laptop, i find it, and the code is right. But when i tryed to send at comands to it trough the serial monitor, nothing happens, and the monitor freezes. And i can't do anything with my phone either. What should i do. What is wrong.

Sry, for my bad english.   
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I read that i should get a usb to serial thing i think. So instead of try to run the AT commands over bt. I should do it through the usb serial thing to the bt board. Sounds that right to you guys?
Logged

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

I got it working. Its pretty straight forward.
If you are connecting to a PC use RS232 to serial converter else it can be connected directly to the arduino's Tx and Rx.
Logged

0
Offline Offline
Full Member
***
Karma: 2
Posts: 125
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The JY-MCU module will only accept AT commands while not paired via Bluetooth, which means you have to send commands over the RX and TX pins of the module.

1. Use this code to create two serial ports on your Arduino and connect the JY-MCU RX to pin 3 and TX to pin 2. http://arduino.cc/hu/Reference/SoftwareSerial

You have to change the line that says
Code:
mySerial.begin(4800);
to
Code:
mySerial.begin(38400);
because the JY-MCU defaults to this baud rate. Open your Arduino serial monitor and set it to 57600. You should see "Goodnight moon!"

2. You should now be able to send "AT" and it should reply "OK". You can also pair with your computer bluetooth or phone bluetooth and anything you type in the serial monitor should now show up on your computer bluetooth or phone, but AT commands will not work while bluetooth is paired. If you get strange characters instead of "Goodnight moon!", your baud rate is not set correctly.

3. To change the baud rate, refer to this webpage: http://byron76.blogspot.com/2011/09/one-board-several-firmwares.html

In this case you want to send the command "AT+BAUD8", which should give a reply "OK115200". If it does not reply like that then you did not change anything.

Good luck.
Logged

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

I am using the modern device usb bub and putty to change the baud rate. using this tutorial http://wiki.openpilot.org/display/Doc/Serial+Bluetooth+Telemetry I have done everything it asked me to do. I can send it the AT command and it sends back OK but when I try and put AT+BAUD7 IT DOESNT WORK. I hit AT and it sends back OK before I can add the plus and baud rate. I know its something simple that I am doing wrong. I have the module working with my android phone at 9600 but I want to use the amarino toolkit and it tells me I need it at a higher rate. Any thoughts?

thanks
bryan
Logged

0
Offline Offline
Full Member
***
Karma: 2
Posts: 125
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I hit AT and it sends back OK before I can add the plus and baud rate.

Try sending the entire string "AT+BAUD7" at once. Use another program to send the serial if you have to.
Logged

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

thanks that was it I needed to paste it in at once. knew it was something simple

thanks
bryan
Logged

Delray Beach, FL USA
Offline Offline
Full Member
***
Karma: 0
Posts: 113
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I also have one of these modules, and it seems to work fine at the default 9600 baud rate, but I haven't been able to find the answer to one question: When does the baud rate actually change? Does it change the baud rate in command mode, or is command mode always operating at 9600 baud no matter what the setting?

I plan to experiment tomorrow to find out for sure, but thought someone might already know the answer.

(Mine has the "Linvor1.5" HC-06 firmware BTW).
Logged


Delray Beach, FL USA
Offline Offline
Full Member
***
Karma: 0
Posts: 113
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

When does the baud rate actually change?

My experiments seem to indicate the baud rate changes real soon after it returns the OKBAUDxxxx message, and once the baud rate has changed, that is the baud rate it talks in both command mode and when connected to a bluetooth master. (So if you get a used one, you might have to try every baud rate to find out what it is set to).
Logged


0
Offline Offline
Full Member
***
Karma: 2
Posts: 125
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, you're right. You can also change the name of the module in command mode but not much else.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The JY-MCU module will only accept AT commands while not paired via Bluetooth, which means you have to send commands over the RX and TX pins of the module.

1. Use this code to create two serial ports on your Arduino and connect the JY-MCU RX to pin 3 and TX to pin 2. http://arduino.cc/hu/Reference/SoftwareSerial

You have to change the line that says
Code:
mySerial.begin(4800);
to
Code:
mySerial.begin(38400);
because the JY-MCU defaults to this baud rate. Open your Arduino serial monitor and set it to 57600. You should see "Goodnight moon!"

2. You should now be able to send "AT" and it should reply "OK". You can also pair with your computer bluetooth or phone bluetooth and anything you type in the serial monitor should now show up on your computer bluetooth or phone, but AT commands will not work while bluetooth is paired. If you get strange characters instead of "Goodnight moon!", your baud rate is not set correctly.

3. To change the baud rate, refer to this webpage: http://byron76.blogspot.com/2011/09/one-board-several-firmwares.html

In this case you want to send the command "AT+BAUD8", which should give a reply "OK115200". If it does not reply like that then you did not change anything.

Good luck.

I tried that, and i did get the "Goodnight moon!". But when i send "AT" nothing happens, it dosn't work with any at command.
Logged

0
Offline Offline
Full Member
***
Karma: 2
Posts: 125
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That means you have the Arduino -> PC set up correctly, but the JY-MCU -> Arduino is not set up correctly. Check the baud rate and the RX/TX lines again. Try using the JY-MCU board in bluetooth mode to know that it works at the baud rate you expect.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That means you have the Arduino -> PC set up correctly, but the JY-MCU -> Arduino is not set up correctly. Check the baud rate and the RX/TX lines again. Try using the JY-MCU board in bluetooth mode to know that it works at the baud rate you expect.
Now i changed the baudrate in the arduino sketch to 9600, and now it works. When i send "AT" i get a ok back, but i can't get any other AT command to work. And i'm not writing them, i paste them in to the command line. My arduino serial monitor is set to 57600baud and "No line ending".
« Last Edit: June 25, 2012, 12:07:20 pm by himym » Logged

0
Offline Offline
Full Member
***
Karma: 2
Posts: 125
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright that's good that you got it communicating with you with AT commands. In my case when I sent AT+VERSION I got "linvor 1.5". If you get the version working then this might be different. Did you try the AT commands without the plus, like "ATVERSION"?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright that's good that you got it communicating with you with AT commands. In my case when I sent AT+VERSION I got "linvor 1.5". If you get the version working then this might be different. Did you try the AT commands without the plus, like "ATVERSION"?
Did not work either.
Logged

Pages: [1] 2 3 ... 6   Go Up
Jump to: