1

I am trying to send messages to my Android device's terminal through the HC-06 Bluetooth Module.

Here is the current code.

#include <SoftwareSerial.h>    
SoftwareSerial BTserial(2, 3); // RX | TX 
// Connect the HC-06 TX to Arduino pin 2(as RX).    
// Connect the HC-06 RX to Arduino pin 3 (as TX) through a voltage divider.
 
char c = ' '; //initializes to a space
 
void setup()
{    
    Serial.begin(9600);    
    Serial.println("Arduino is ready");
    // HC-05 default serial speed for communication mode is 9600    
    BTserial.begin(9600);  
    Serial.println("BTserial started at 9600");    
}
 
void loop()    
{
   // Keep reading from HC-05 and send to Arduino Serial Monitor
    if (BTserial.available())

    {  
        c = BTserial.read();
        Serial.write(c);
    }     
   // Keep reading from Arduino Serial Monitor and send to HC-06
    if (Serial.available())
    {
        c =  Serial.read();
        // Copy the serial data back to to the serial monitor.
        // This makes it easy to follow the commands and replies   
        Serial.write(c);    
        BTserial.write(c);  
    }     
}

Here are the connections I have to my Arduino Nano board:

  • d3 -> 1k resistor -> 2.2k resistor, and connected to rxd on the HC-06 module from the middle
  • d2 -> TXD
  • GND -> GND
  • 5V -> VCC

Again, I can only send things from my android device to the serial monitor of the Arduino, not the other way around. I would like to be able to send data to my android device's terminal.

zx485
  • 28,498
  • 28
  • 50
  • 59
  • I'm a little confused. The title of your question asks about sending data from the HC-06 to the Arduino, but your actual question seems to be about why you can't receive text typed at the terminal (serial monitor)? – lurker Mar 25 '21 at 12:27
  • @lurker I want to send data from the hc-06 module to my android device's Bluetooth terminal. – Americancain Mar 25 '21 at 12:43

0 Answers0