Modifying the HC-05 Bluetooth module defaults using AT commands

The HC-05, a Bluetooth to serial bridge, can be found for around $5 on the internet and therefore may be the cheapest way to add Bluetooth connectivity to your project.

However, its default settings may need to be changed depending on your application. [Hazim] explains a way to enter the HC-05 AT command mode to benefit from the rich set of features that the device can provide. The process is fairly simple as it only consists of maintaining the key pin of the HC-05 high while powering on. The device then boots in AT command mode with a default 38400bits/s speed and listens for all of the AT command set (PDF). As an example [Hazim] provides a sketch allowing you to write the AT commands directly in your favorite terminal.

With the basics out of your way you may want to further research the hardware, especially if you will be using modules from different sources. They don’t always come with the same firmware.

40 thoughts on “Modifying the HC-05 Bluetooth module defaults using AT commands

    1. Actually you can’t enter into AT mode by just taking one pin HIGH. It has to be high before you power the HC-05. Then you have to ensure the baud rate is 38400. Then you have to ensure you are communicating with the HC-05 via software serial since that’s the Arduino Serial Monitor is using pins 0 and 1. So it’s a number of little things that can throw off most hackers and waste considerable time when taking the HC-05 into AT mode. I have been there. These instructions could have saved me considerable time.

      1. seriously?? all it takes is googling ‘HC-05 + datasheet’… I don’t normally get annoyed, but when I do it’s because ppl don’t know how to find information on the internet :-P

        1. This “hack” can be done by anyone who just reads the datasheet. wow.

          This is possibly the lamest post on hack-a-day of all time.

          Reading the datasheet is a “hack” now? Come On hack-a-day, can you have some standards?

          Where do we draw the line?

          The next “hack” will no doubt be an “unboxing” – probably something like “how to remove an arduino from a UPS package”.

    2. dmitry, if you read carefully, I don’t think this was intended as a hack. It was meant to be an easy to follow guide on how to configure the most popular bluetooth module the HC-05. You should say thank you when people take the initiative to make our lives easier. I had a tough time configuring the HC05 and this helps. Just because you are a guru who can figure things out on your own, the rest of us humans still need some help now and then. if you think this is as simple as turning one pin high, you should try it then you will see what the docs have left out. So be nice or keep your opinion to yourself.

      1. Plenty of things are obvious after spending 6 hours trying every other way you can think of. Lost things are always in the last place you look, too.

    3. Hack or no hack this could have saved me countless hours of aggravations and frustrations. Before you tell people to RTFM maybe you should tell vendors and hackers to learn how to write.

  1. The cool feature on these modules, is that with the right firmware, they can be used as master devices instead of slaves.

    I’ve put together a little setup that uses this and an arduino to interact directly with a mindwave mobile to light up a row of leds based on my perceived levels of concentration. Removing the need for a pc in there completely.

    1. read a wikipedia article on bluetooth – there are generally two classes of bluetooth devices. Class 2 has range of about 10 meters in direct LOS (vast majority of all devices are of this class). Class 1 devices achieve 100 meters. You can achieve more using directional antennas or even amplifiers just as with wifi and there exist special long range modules. It’s all a matter of price and practicality really. If I ever needed longer range I’d probably choose RFM22B – I personally never used one but they do seem pretty impressive

  2. i tried this a few months ago but gave up. the manual is a piece of s@#t. now i can change the settings. thank you for the instructions

  3. I used a bunch of pins or needles in a block of Sculpey (and an LED directly inserted – it had an internal resistor) to program the modules without soldering them to a board.

  4. I heard rumours that some HC-05’s secretly support a DTR signal. Some manufacturers in China say yes in correspondence but English wasn’t so good so I’m unsure. Has anyone had any success?

  5. kerimil: I see your name along with an army off your fake aliases pop up every time someone posts anything about arduino and bluetooth, always trying to start flame wars. grow up and get a life man. There are more important things in life than bluetooth and your project which you keep promoting as if the greatest thing since sliced bread. It’s just bluetooth dude :)

  6. Big like. I had to wrestle for hours with crappy HC-05 documentations when I should have been focused on my project. Unfortunately I gave up and bought a different Bluetooth transceiver. Time to dust off the HC-05 for the next project.

  7. this isnt working for me, i followed everything, and nothing happens when i open serial monitor and type AT. =/ frustrating

    1. I am trying to do the same thing and cant find out. if you managed to find a way can you inform me of how you did it?

      1. no i Didn’t got any way to do, but the thing which we can try is reducing the power. That what answer i got over irc, but i havn’t tried it yet.

        1. how would do i do that? i have two bluetooths, one connected to my initial project and one which has to portable. For the one conncted to my projected, i have it on a breadboard, can i just put resistors to decrease the power and for the wireless just give it a weak battery?

  8. Hello Everyone Eh Created a program to Set all parameters of a Hc-05 Bluetooth Module, arduino By,
    Is Very Intuitive and shows the potential of these modules,
    download:

    https://mega.co.nz/#!IlgEhL7D!49AyfrlgPI2pjhWUyRTMK85TBGRP-BbSxW712nDXsdg

    Various Tools As has:
    Slave Name
    The Error Manager
    The Finder Device
    Configure All in one
    etc
    Since the program is written in Basic, the Deputy Pograma compiled and Soft for uploading to the Arduino
    It is compatible with Arduino Uno, Duemilanove, Nano, MiniPro, Etc
    Requirements,
    Micro: ATmega328P
    Clock: 16Mhz
    Baud: 4800
    Send the CR at the end of any order.
    regards

  9. As for someone who has been working with digital electronics since the 8080 cpu, I welcome any and all insight. I’ve just started messing with arduino and find there is much more to HC-05 than one rule. There are many versions out there, are they all the same? I can see physically they aren’t some have 4 pin carriers, some 6. Is the firmware the same? IDK because I have yet to learn how to get to it. Am I dumb, no I’m inexperienced. So all you know it all’s give those fresh to the technology a break.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s