Bluetooth

 
 

diagram BT setup mode. 

BlueTooth serial board JY-MCU default baud rate is 9600 bps, name is "LinvorV1.8", firmware version is 1.8. this unit version is 1.06.

this unit can operate 3.3 V to 6 V. ( old version need to connect 3.3 V TTL logic. so need to use FET and/or resistance to change voltage to connect to 5 V Arduino unit. )

to change baud rate, need to send AT command to this unit.

following is how to do this.

1: need to un pair BlueTooth unit in case you had done it.

2: connect 3 wire :  BlueTooth use power from Arduino unit. 

BlueTooth GND - Arduino Nano GND.

BlueTooth TXD - Arduino Nano Digital 10 pin (SoftwareSerial RX).

BlueTooth RXD - Arduino Nano Digital 11 pin (SoftwareSerial TX)

( old version with voltage divider : use resistance, 470 ohm + 1 K ohm.  photo is 1 K ohm + 2 K ohm. with JY-MCU version 1.06 no need to use this voltage divider ).


need program to Arduino Nano with USB port Mac/PC as following.


----------------------------------------------

#include <SoftwareSerial.h>


SoftwareSerial mySerial(10, 11); // RX, TX


void setup()  

{

  // Open serial communications and wait for port to open:

  Serial.begin(9600);

  while (!Serial) {

    ; // wait for serial port to connect.

  }



  Serial.println("connected to computer");


  // set the data rate for the SoftwareSerial port

  mySerial.begin(9600);

  mySerial.println("to BlueTooth"); // nothing effect this to BlueTooth

}


void loop() // run over and over

{

  if (mySerial.available())

    Serial.write(mySerial.read());

  if (Serial.available())

    mySerial.write(Serial.read());


delay (10);

}


-------------------------------------------


then use terminal soft zoc6 for Mac to connect Arduino Nano with USB connection.

need to setup Configure Serial speed 9600 bps, 8N1, RTS signal off, DTR signal off, select port name for Arduino Nano USB.


hardware connection test:

copy string  "AT" from text application and past it to terminal soft. then get return "OK" is hardware connection is OK.


get version:

copy string  "AT+VERSION" from text application then past it to terminal soft. then get return "OKlinvorV1.8".

( this name maybe different )


change bluetooth name to brain-duino:

copy string  "AT+NAMEbrain-duino" from text application then past it to terminal soft. then get return "OKsetname".


change bluetooth pincode to 0000: default is 1234

copy string  "AT+PIN0000" from text application then past it to terminal soft. then get retune "OKsetPIN".


change baud rate to 230400, form 9600:

copy string  "AT+BAUD9" from text application then past it to terminal soft. then retune "OK230400".



now this unit start working with speed 230400.


attention: once change speed to 230400 can not set other way again with Arduino Nano software serial connection. to do so need to use other serial interface to connect Bluetooth. Arduino Nano software serial connection max speed is 115200, so can not connect with Bluetooth speed 230400.



disconnect Arduino Nano.

diagram run mode.

re wire Bluetooth unit to Arduino Pro mini.

BlueTooth GND - Arduino Pro mini GND.

BlueTooth VCC - Arduino Pro mini + 5V output.

BlueTooth TXD - Arduino Pro mini  RXD.

BlueTooth RXD - Arduino Pro mini TXD.


pair Bluetooth with system Bluetooth setup. name is linvor and pin code is 1234 in case not change it.

name brain-duino. pair code 0000 is new setup.

test with set terminal soft speed 230400 and IBVA application.

--------------------------------------


http://arduino.cc/forum/index.php?topic=101452.0

http://arduino.cc/en/Reference/SoftwareSerial

http://byron76.blogspot.com/2011/09/one-board-several-firmwares.html


radio communication distance is around 10 m at open space.





Connection with Arduino Pro mini and Bluetooth:

























program Arduino Pro mini  with Arduino Nano:


  1. *Arduino UNO code use external Reference V, but Arduino Pro mini CPU external Reference V PIN is not open for end user use. so need to change Arduino code for internal Reference V use.

  2. *Line 159 : analogReference(EXTERNAL);

need to change like this : // analogReference(EXTERNAL);

 

JY-MCU Bluetooth Wireless Serial Port Module for Arduino


how to setup :