DX  » Community » Forums
«See all threads (in Product Forum)
Product Forum

Thread Closed How to change default baud rate?

  • zabx2 Saturday, April 14, 2012 5:38 AM Reply
    I need to change bluetooth modem default 9600 baud rate to 115200 for my project. How can I do thi using my Andruino Uno? Any ideas?
  • nlandini Wednesday, April 18, 2012 8:27 PM Reply
    Hi zabx2,
    Take a look to this code.
    The posible baudrates are:
    1-------1200
    2-------2400
    3------4800
    4------9600
    5------19200
    6-------38400
    7------57600
    8-----115200
    9------230400
    A-----460800
    B-----921600
    C-----1382400

    If you set it to more than 9600 the "echo" to the USB serial is not going to work :P beacouse is slower

    #include

    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());
    }
  • niakat Wednesday, May 02, 2012 2:39 AM Reply
    There is an easier way if you have the arduino using this complex code =P

    void setup()
    {
    Serial.begin(9600); // Change the speed to the current working speed of your bluetooth device
    }

    void loop()
    {
    }


    Once uploaded the code to the arduino connect:
    RX pin of the bluetooth to the TX of the arduino
    TX pin of the bluetooth to the RX of the arduino
    VCC and GND ¬¬


    All you have to do is to open the serial console of the arduino IDE, select baud speed (current working speed of the bluetooth device --> 9600 by default) and "no line-ending". In this way you can write AT commands (if the bluetooth is unpaired) or whatever you want to send to other bluetooth device (must be paired with your bluetooth device)

    Remember that you can't upload new code to the arduino while you have the bluetooth connected to the pins 0,1 (RX, TX) that's why the code posted above is generally used, but it can give you some problems depending on which IDE version are you using and you can't use the integrated serial console (it only writes through pins 0,1)
    Posts(3) | Reviews | Tip post

    post edited by niakat on 5/2/2012 at 2:46 AM
  • originel Saturday, July 14, 2012 2:41 AM Reply
    My module came with a baud rate 38400 and I am having problems about changing it. Can you suggest anything about that?
  • nlandini Sunday, July 15, 2012 10:30 PM Reply
    #include

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

    void setup()
    {

    mySerial.begin(38400);
    delay(1000);
    mySerial.print("AT+BAUD4"); // Set baudrate to 9600
    delay(1000);
    }

    Now is at 9600 or choose another baudrate.
  • lchagas Tuesday, August 14, 2012 8:39 AM Reply
    your include is including absolutely nothing, change it to " #include " (without the "") and the code should work.

    just put bluetooth module TX pin on digital 10 from your arduino and bluetooth RX on digital 11.

    just tested here and worked with sku 81877.
  • georgetsin Wednesday, June 19, 2013 5:48 PM Reply
    Does this module supports non standard baud rates?
    To be more specific, I need:
    812500
    406250
    203125
    Is this possible?
  • robbage Friday, September 20, 2013 6:43 AM Reply
    No, the baud rates are listed near the top of this thread and don't include any of those.
Please note that DealExtreme Forums are not a sales or product support board. While we do constantly participate in this forum, please contact us via support ticket for a guaranteed fast response. We make every effort to make the quickest replies.

WHY CHOOSE DX.COM?

Get great weekly deals and offers like: Collections