Echo RX -> Serial Monitor

Hi,

I’m trying to connect a Bluetooth module (BT) to an Arduino Uno (AU), and get some basic communication going. Here’s what I’ve connected so far:

BT RX <-> AU TX
BT TX <-> AU RX
BT GND <-> AU GND
BT 5V <-> AU 5V

I’ve verified that I can send and receive data on the BT module from an iPhone, where I have a simple terminal program that sends and receive bytes. However, I want to send/receive data to/from iPhone <-> BT <-> AU <-> Serial Monitor (USB).

Basically, I want to be able to send a character from the iPhone, and have it output to my Serial Monitor over USB. I also want to send a character from my Serial Monitor, and have it output on my iPhone.

How can I get the Serial Monitor to echo what is being received on the RX (Pin 0), and have the Serial Monitor send a character to the TX (Pin 1)?

I have both USB and BT Module at 38400 baud. So far, I can do this:

void setup()
{
  Serial.begin(38400);
}

void loop()
{
  Serial.print('Hi');
  delay(1000);
}

And I see “Hi” each second on my iPhone. However, if I open up Serial Monitor and type “Hi”, I see nothing. What’s wrong?

can not, do. you need to have two entries arduino serial communications. for example, Arduino Due

you need to have two entries arduino serial communications. for example, Arduino Due

Or use SoftwareSerial on any Arduino with one hardware serial port.

Connect the bluetooth device to any two digital pins (except 0 and 1) and use SoftwareSerial.

And I see "Hi" each second on my iPhone. However, if I open up Serial Monitor and type "Hi", I see nothing. What's wrong?

Where are you, on the Arduino, reading anything that comes in from the Serial Monitor? You are writing to the serial port that both the bluetooth device and the Serial Monitor are monitoring, but you are not reading anything that comes from the bluetooth device or from the Serial Monitor.

programmarchy:
Hi,

I’m trying to connect a Bluetooth module (BT) to an Arduino Uno (AU), and get some basic communication going. Here’s what I’ve connected so far:

BT RX <-> AU TX
BT TX <-> AU RX
BT GND <-> AU GND
BT 5V <-> AU 5V

I haven’t tried this myself, but I remember reading that you can use an Arduino as a USB-to-serial TTL converter by connecting the device’s Rx to the Arduino Rx and the device’s Tx to the Arduino’s Tx, then holding the Arduino in reset. That’s not quite as you’ve described the connections, but it’s close.

The alternative is to run a sketch that uses two digital pins to provide a software serial interface and copies characters between the hardware and software serial ports. The SoftwareSerial library includes an example sketch that does this.