i've got an Arduino Nano and an bluetooth modul CZ-HC-05 which works with 5V on every pins, so that I dont need an voltage devider. The last configuration i've tried is from this page:
In normal Slave mode the bluetooth modul works fine and sends Data as it should be.
But when I get into the AT Command mode trying the command "AT" I'll get this strange characters: "O§†…". I also took other baudrates, but only at 38400 i'll get an answer ("AT" -> "O§†…"). I also tried Tera Term and ReaTerm but got the same problems with other strange characters.
I also tried the baudrate 38400 for both, the arduino and bluetooth modul, but got the same problem.
My sketch is:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(4, 5); // RX, TX
#define bt_power 11
#define bt_key_power 12
String command = ""; // Stores response of the HC-06 Bluetooth device
void setup() {
// set the pins to OUTPUT
pinMode(bt_power, OUTPUT);
pinMode(bt_key_power, OUTPUT);
// set the pins to LOW
digitalWrite(bt_power, LOW);
digitalWrite(bt_key_power, LOW);
// make sure the key has been LOW for a bit
delay(100);
// set the key pin to High
digitalWrite(bt_key_power, HIGH);
// small delay
delay(100);
// now power on the BT
digitalWrite(bt_power, HIGH);
// Open serial communications:
Serial.begin(9600);
mySerial.begin(38400);
delay(1000);
Serial.println("Type AT commands!");
}
void loop() {
if (mySerial.available())
Serial.write(mySerial.read());
// listen for user input and send it to the HC-05
if (Serial.available())
mySerial.write(Serial.read());
}
So I dont know if the module is damaged or there is an other problem i cannot see.
Is the LED on the HC-05 blinking? It should be blinking fast for normal mode and about once every two seconds in AT mode.
I tried this using a CZ-HC-05 module on an Arduino and Moteino but the output pin didn't have enough current to power the HC-05. The Arduino has an output current 0f 40 mA while the Moteino and Flutter Wireless have outputs of 30 mA. There are multiple manufactures of the HC-05 chips and the amount of input current varies.
This program works fine after connecting pin 11 to a relay to control the power to the HC-05.
I have the cz-HC-05 module and I'm also having trouble with it. It goes into command mode and light blinks every 2 seconds. I don't get any response at all from the module. I have tried many different ways to get into command mode, all which seems to work, but no response no matter which way I try. Any suggestions as to why I can't get any response?
Ditto on that. I have the CZ version. I tried already two different tutorials, one using analog pins on the Arduino Uno and one using digital, windows 8.1. I tried in Arduino IDE and using Atmel/Visualmicro. I tried all combinations of baud and string termination, etc. etc. Cannot get that dang "OK" for the life of me.
UPDATE: tried this and it worked. I think I may have had my serial port baud set wrong. 9600 worked.
/*
AT+ORGL (Restore the factory default state)
AT+UART=115200,0,0 (Set baud rate to 115200, one stop bit and no parity bit)
AT+NAME=TinyG
*/ #include <SoftwareSerial.h> #define rxPin 10 #define txPin 11
SoftwareSerial mySerial(rxPin, txPin); // RX, TX
char myChar ;
void setup() {
Serial.begin(9600);
Serial.println("AT");
mySerial.begin(38400);
mySerial.println("AT");
}
void loop() {
while (mySerial.available()) {
myChar = mySerial.read();
Serial.print(myChar);
}
while (Serial.available()) {
myChar = Serial.read();
Serial.print(myChar); //echo
mySerial.print(myChar);
}
}
and it worked first time. The ZS-040 has a switch on board for configuring but, if yours doesn't, he provides an alternative method that may work for you.