JY-MCU Arduino Bluetooth Wireless Serial Port Module

From air
Revision as of 19:55, 6 May 2013 by Donsez (talk | contribs)
Jump to navigation Jump to search

JY-MCU Arduino Bluetooth Wireless Serial Port Module


VCC 3.6V - 6V


  • To initlalize the BT module, send it the following AT commands: AT+PIN1234 <cr> AT+NAMEdongle <cr> AT+BAUD4 <cr>. The last command will set the baud rate to 9600.
  • Then on the PC, connect to a new Bluetooth device, use the same PIN number as above, make note of which serial (COM) port it maps to and then use Putty (Windows) or screen (Linux) to test!

Read the forums http://club.dx.com/forums/Forums.dx/threadid.1166641


// @from http://club.dx.com/forums/Forums.dx/threadid.1166641
// @see http://arduino.cc/en/Reference/SoftwareSerial

#include <SoftwareSerial.h>

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

void setup()
{
Serial.begin(9600);
Serial.println("Goodnight moon!");
//mySerial.begin(115200);
mySerial.begin(9600);


delay(1000);
mySerial.print("AT");
delay(1000);
mySerial.print("AT+VERSION");
delay(1000);
mySerial.print("AT+PIN1342"); // Set pin to 1342
delay(1000);
mySerial.print("AT+NAMEFresaBT"); // Set the name to FresaBT
delay(1000);
//mySerial.print("AT+BAUD8"); // Set baudrate to 115200
mySerial.print("AT+BAUD4"); // Set baudrate to 9600
delay(1000);
}

void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
} 

Tools