-1

I am trying to establish connection between two BLE (BT43) through AT commands from an Arduino Uno. I am not getting any response from the AT commands. The connections are as follows:

Arduino Tx --> BLE Rx Arduino Rx --> BLE Tx Arduino 3.3v --> BLEVcc Arduino Gnd --> BLE Gnd

Can someone please help me with this? Thanks in advance! this is my code

#include <SoftwareSerial.h>
SoftwareSerial BTserial(6, 7); // RX | TX

const long baudRate = 115200; 
char c=' ';
boolean NL = true;

void setup() 
{
    Serial.begin(9600);
    Serial.print("Sketch:   ");   Serial.println(__FILE__);
    Serial.print("Uploaded: ");   Serial.println(__DATE__);
    Serial.println(" ");

    BTserial.begin(baudRate);  
    Serial.print("BTserial started at "); Serial.println(baudRate);
    Serial.println(" ");
}

void loop()
{

    // Read from the Bluetooth module and send to the Arduino Serial Monitor
    if (BTserial.available())
    {
        c = BTserial.read();
        Serial.write(c);
    }


    // Read from the Serial Monitor and send to the Bluetooth module
    if (Serial.available())
    {
        c = Serial.read();
        BTserial.write(c);   

        // Echo the user input to the main window. The ">" character indicates the user entered text.
        if (NL) { Serial.print(">");  NL = false; }
        Serial.write(c);
        if (c==10) { NL = true; }
    }

}
5
  • Your wiring appears to be correct, what arduino model are you using? What pins are arduino TX/RX exactly? What does your code look like?
    – mystery
    Apr 4, 2018 at 15:18
  • I am using arduino uno and i have connected ble tx--> arduino 6th pin, ble rx pin--> arduino 7th pin
    – vinitha
    Apr 5, 2018 at 12:10
  • Thanks mystery for your reply. I have added the code to my question. I have set the baud rate to 115200 and I am not getting response for the AT commands which i enter in serial monitor.
    – vinitha
    Apr 5, 2018 at 12:22
  • The Uno only has 1 HW UART interface (your Serial object), which is connected to the usb port. You can't connect the bt module to these and communicate independently. On the Uno, your only alternative is Software Serial as used in your code. Double check if specified pins (6, 7) are NOT the ones of the hardware serial AND are actually connected to the bt module. Also look up the default baud rate of the bt module (115k seems quite high as initial value).
    – mystery
    Apr 6, 2018 at 7:37
  • The pins(6,7) are connected to my ble module only and regarding the baudrate, 115200 is the default baud rate they have given in the document and i also tried different baud rates of
    – vinitha
    Apr 7, 2018 at 9:32

3 Answers 3

0

Since these modules are connected to their respective Arduinos to give them BLE capability, Rx and Tx should be connected to the same, not crossed.

1
0

You are missing critical info on page 10 datasheet i.e. not connecting CTS and RTS.

It maybe possible handshake is necessary for communicating to this module. Give it a try using with some board with Synchronous UART.

Also can try grounding CTS. i.e. connect blue-tooth moduls's CTS to 0V.

read this for more clarity.

Hope this solves your problem.

2
  • The module(BT43) I use doesn't have any routing for CTS and RTS pins and that is why i didnt connect CTS and RTS
    – vinitha
    Apr 7, 2018 at 9:40
  • I don't have this module but if you are using same as shown in datasheet link above you have 11 RTS and 12 pin CTS follow datasheet for pinout
    – Devidas
    Apr 7, 2018 at 11:50
0

EDIT

Just found this*:

On Arduino or Genuino 101 the current maximum RX speed is 57600bps *https://www.arduino.cc/en/Reference/SoftwareSerial

You may be over max speed for Uno.

What are you using to send data via Bluetooth? Are you sure data is being sent to the device?

Android App

You can try my android app that I created for this specific type of testing. You can get it at : http://raddev.us/btmessenger.apk

If you point your Android device at that, it will download the app and ask if you want to install it. In case you're afraid it is malicious you can get the Open Source code to the simple app at GitHub : https://github.com/raddevus/BTMessenger

To use:

  1. pair your bluetooth device
  2. Type a message in top TextEdit box.
  3. Press the [Send] button.

btmessenger

Baud Rate Issues

Generally if you get the baud rate incorrect you'll just see garbage characters. Here's a write up I just did on setting up Bluetooth devices. It may help you work through some issues. https://www.codeproject.com/Articles/1254611/Bluetooth-Messenger

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.