HC-05 troubleshooting
Some HC-05 modules are more equal than others
I've been playing with some cheap HC-05 bluetooth modules I picked up off Amazon. They are a very convenient and easy way to add remote control to a project, using two wire UART (RX/TX) in the usual way, so can replace an existing serial connection to a PC for example. They work pretty much out the box and there are loads of guides to using them. I thought I would share a few thoughts on using these modules though as I've come to realise that all HC-05s are not created equal...
There are some visual clues. On the back of my modules I have an "EN" pin whereas some other HC-05 modules have a "KEY" pin. The KEY pin is used to place the module into "AT command mode", by putting it high (3.3V) before powering up the module. I initially thought that the EN pin was analogous to the KEY pin (a different name perhaps), but the EN pin can be used to disable the bluetooth module, which I guess is useful to someone...
In fact a surface mount button is supplied to replace the "KEY" functionality. It must be held down and then the module powered up. This is incredibly fiddly! It does put the module into the command mode, the status LED flashes slowly and sending "AT" gives the requisite "OK" reply. It turns out that although the module is in command mode, a lot of commands weren't working for me. I wondered whether this might be because of a different version of firmware, but after a bit of frustration, it turned out that some AT commands require KEY to be held high through out the command - it is not enough that the module is in AT command mode, KEY must be also held concurrently high as well. Consider my case, that means attempting to hold the button down on the board whilst trying to type multiple commands one-handed without slipping on the button pressure! Very frustrating - but there is a simple fix:
Simply soldering a connection to pin 34 (equivalent to PIO11) on the castellations breaks out the "KEY" pin which is not otherwise represented. Some people have reported that in some cases, neither the KEY or EN may be physically connected to anything useful on the board! *sigh* All the more reason to bust out the soldering iron.
Connecting to an Android phone was really easy with an app, Bluetooth Terminal by Alexander Vozjennikov.
This is a really great picture that summaries some key connections in the break out boards, from here: (great job making this image!) http://k6vhf.com/simple-bluetooth-cat-interface/
I leave it here as a reference.
Addendum:
I bought two uber-cheap modules - one works fine and the other TX connection doesn't work and checking the connection with a mulit-meter/ soldering a breakout wire to pin 1 doesn't help. I think it's just stuffed! Either it was something I did (hmmm) or it was supplied broken! Maybe the lesson is I get what I pay for.
Comments
Post a Comment