How do I send AT Commands from my PC to my Bluetooth modules via Arduino UNO R3?

Discussion in 'Programmer's Corner' started by Utkarsh Verma, Feb 10, 2017.

  1. Utkarsh Verma

    Thread Starter Member

    Oct 30, 2016
    40
    0
    I want to send AT Commands to my “XS3868” and “BK8000L” modules, whose AT commands I know well. But being a beginner in Arduino, I have no knowledge about the packages of Arduino and so I need help with the code. The code should also display the module’s response message after entering any command. By the way, I need a code which is interactive with the module, that is I should be able to the response messages of the module on my PC. And XS3868 contains OVC3860 which requires baud rate of "115200" while BK8000L requires baud rate of "9600". The details of these modules:
    BK8000L: http://www.electrodragon.com/w/BK8000L
    XS3868: just google up for OVC3860 datasheet. It will be the first link.
     
  2. R!f@@

    AAC Fanatic!

    Apr 2, 2009
    9,082
    836
    Welcome to AAC.
    I am sorry but I do not think any one here has a such code.
    I can do like that on a PIC but not for an arduino.
    Besides as a beginner you cannot debug such complex codes.
     
  3. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    3,233
    1,055
    It can likely be done on an Arduino, but unless you learn to write it yourself, I doubt anyone here will write it for you. I hope for you that someone proves me wrong.

    The serial library that comes with the Arduino is a good place to start. See if any of the example sketches make sense.
     
  4. LesJones

    Member

    Jan 8, 2017
    332
    68
    Here is a method I have used to configure Bluetooth modules. It uses the serial monitor under the "tools" option on the Aduino IDE.

    Using the Arduino Uno to configure an HC05 Bluetooth module.


    Either remove the ATMEGA328P or program it with this sketch which will not enable the TX pin on the ATMEGA328P. (It just runs a tight loop doing nothing.)


    Connect the RX pin on the Aduino board to the RX on the HC05 module via a potential divider consisting of a 5K6 restistor from the RX pin on the Arduino and a 10 K resistor to ground. NOTE Connecting the RX pin to the RX pin seems strange but the RX pin on the Arduino board is actualy the TX pin on the ATMEGA16U2.

    Connect the TX pin on the Arduino to the TX pin on the HC05 together with a 3.3 volt zenner to ground. (+ to TX pin - to ground.)


    In the Arduino window click on the "Tools" dropdown box and select "Serial monitor"

    In the "serial monitor window" set the baud rate to 38400 bauds. In the box to the left of the baud rate box select "Both NL & CR"
    Type the required AT command in the send window then click send.
    You will see the response in the main part of the serial monitor window.

    NOTE The baud rate for AT commands is always 38400

    Les.
     
Loading...