When I have an HC-05 Bluetooth module (clone) connected to an Arduino Nano (clone), any AT command I enter into the serial monitor returns with nothing.
If I connect the same HC-05 to an Arduino UNO in the exact same way however, I get no issues.
Details
-
My pin setup for the HC-05 with both Arduino UNO and Arduino NANO are,
|EN ~> 3.3v| VCC ~> 5v| GND ~> GND | TX ~> TX| RX ~> RX|
(I have tried crossing the TX and RX pins but it does nothing. The setup above works for my Uno)
-
My Arduino Nano clone uses a WCH340G chip. I have installed the CH341 driver.
-
I'm using no code. Just the plain startup code with the serial monitor set to 38400 baud.
-
My Arduino Nano receives code. The blink program uploads with no issue.
-
Every time I try to send an AT command, the RX LED on my Nano blinks yet I receive no OK message.
-
The HC-05 is in AT mode.
-
I know the HC-05 module works fine since my UNO can connect to it seamlessly. Using two UNOs, I am able to pair two of the HC-05s together so there shouldn't be anything wrong with them.
-
I do sometimes get responses to my AT commands by repetitively entering the same command.
Please let me know if there is something super obvious I'm missing here. I'm pretty new to Arduino and I'm using cloned devices on top of that (nice and cheap), so I'm very lost.
How much current can the 3.3V pin supply on a Nano?
I believe it to be around 40mA.
...and how much peak current does the BT module require? Hold on, You are powering it from 5V?
Also around 40mA. Could my issue be something to do with current?
Isn't the MCU still connected in that case? Unless you are using a serial passthrough sketch, you should have the MCU held in reset state by grounding the reset pin, if you are not using it with the TX/RX pins (i.e. just using the Nano as a USB-serial converter).
I'm just using the bare minimum sketch. When I use an Arduino UNO hooked up to the HC-05 with the |EN ~> 3.3v| VCC ~> 5v| GND ~> GND | TX ~> TX| RX ~> RX| layout, my AT commands work properly. I applied the same logic to my Nano but to no avail. What are you suggesting I do with the reset pin?
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
The TX/RX pins are used to program the MCU. They are dedicated to that use. Thus any sketch will utilize those pins. The Uno has resistors to isolate the USB adapter from the pins, so that sketches can manipulate the pins. Tying the RESET pin to ground, disables the MCU and so disables the MCU TX/RX signals and they are only routed to the USB-serial chip on board the Uno/Nano.
What is your end goal, with this testing?
I'm just trying to get a response from my AT commands.
For fun? Educational purposes?
You can communicate directly with devices on the TX/RX pins, by making the Nano into a pure USB-serial converter - ground the reset pin.
I eventually hope to use HC-05 modules and Arduino Nanos to control stuff like servos wirelessly, but I cant do any of that until I get the Nano and HC-05 to actually work together
Arduinos with a single serial port are not good choices for this - if you use the native TX/RX pins, you will not be able to communicate with the PC via the USB port any more.
Do you understand the nature of the issue I'm telling you about? You are trying to use the same lines to communicate with two different devices - the PC, and the HC-05. They conflict.
So its too much for a device like a Nano to handle? Having to communicate with both HC-05 and PC?
It's not a general issue like that. It's very specific. You're attempting to place data from two sources, onto one set of signal lines. Most people solve this by using Software Serial, but it has its own issues and limitations. I recommend using a board that has a second serial port, like a Pro Micro.
For your long term goals, you really need to know whether a PC will be attached to the board. If not, then you can use TX/RX.
Would a pro micro behave like an Uno?
In what way? It's an official Arduino, at least a spin off of the Micro. Leonardo also has two serial ports, and lots more do also now.
You have to decide whether any device of yours has to support both a PC and BT interface. If so, you can not use TX/RX pins directly.
Means what, "establish as a ..."? Load appropriate sketches you mean?
My long term goals involve no PC connection. I just need to use the PC to establish an HC-05 as master and slave.