I've used HC-05s and HC-06s before for several successful projects, but each time I used a Bluetooth module, it was using a hardware serial port.
Now I'm trying to make an update to my tutorial here to handle the case where people only have an Uno or Nano and don't have access to multiple hardware serial ports to configure their Bluetooth modules. If anyone can help me figure this out I'll give a shutout to you in the tutorial
The problem:
I have a Nano I'd like to use to put my HC-06 into AT mode. I have wired up my Nano and HC-06 as so:
BT VCC <--> Nano 5V
BT GND <--> Nano GND
BT TX <--> Nano D2 (SW RX)
BT RX <--(voltage divider)--> Nano D3 (SW TX)
I've used the following code from this tutorial.
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(2, 3); // RX | TX
void setup()
{
Serial.begin(9600);
Serial.println("Arduino with HC-06 is ready");
// HC-06 default baud rate is 9600
BTSerial.begin(9600);
Serial.println("BTserial started at 9600");
}
void loop()
{
// Keep reading from HC-06 and send to Arduino Serial Monitor
if (BTSerial.available())
Serial.write(BTSerial.read());
// Keep reading from Arduino Serial Monitor and send to HC-06
if (Serial.available())
BTSerial.write(Serial.read());
}
I also made sure that the serial monitor was at 9600 baud with "no line ending" selected.
The issue is that when I run the code and send "AT", I get no response from the HC-06 at all.
This is driving me INSANE cause there is no reason this shouldn't be working - I've even reswapped TX and RX with no luck. Any thoughts?