I have been attempting to program my HC-05 ZS-040 Bluetooth module for quite some time, and I cannot get the AT commands to return any values. I have searched google for quite some time, and I none of the answers seem to work for me. I have been following along with this website:
https://sites.google.com/site/wayneholder/inexpensively-program-your-arduino-via-bluetooth
I am using an Arduino Mega 2560 clone by Elegoo to program this Bluetooth module. Currently I have it wired up using this diagram
Currently I have it modified slightly to use a voltage divider between the Arduino's Tx and the HC-05 Rx, as the HC-05 works on 3.3v logic. The one possibility I think could be causing this problem is that the Arduino Mega is just interpreting all Tx incorrectly as I measured that it sounds ardoun 3.2 volts for a high voltage. According to multiple websites the HC-05 is in AT command mode when the LED flashes slowly, about once every 2 seconds, which is happening. I put it in command mode by holding down the button above the EN pin while providing power to the HC-05.
I have been using pin 14 and 15, which are Hardware Serial3 on the Arduino Mega. Here is the code I have written:
/*
Software serial multple serial test
Receives from the hardware serial, sends to software serial.
Receives from software serial, sends to hardware serial.
*/
#include <SoftwareSerial.h>
SoftwareSerial mySerial(15, 14); // RX, TX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("AT");
// set the data rate for the SoftwareSerial port
Serial3.begin(38400);
}
void loop() { // run over and over
if (Serial3.available()) {
Serial.write(Serial3.read());
}
if (Serial.available()) {
Serial3.write(Serial.read());
}
}
Any suggestions are much appreciated!
EDIT: I have now received some unrecognizable responses from the controller after sending AT multiple times, here is the screenshot, included is a video of my circuit, which shows how the LED is flashing:
https://drive.google.com/open?id=1mc8PEEnhiKpPzzy5kL9QxTvoQA3NAH6b
The only modification to the code is adding a Serial.println("TESTING");
in the while loop that reads Serial3. I have tried using other Hardware serial ports as well, all with the same result as the above screenshot.