The Ultimate Guide to HC05 AT Commands: Unlock Your Module's Full Potential

Welcome to the DIY Electronics Hub!
Dive into the world of wireless communication with our comprehensive guide to HC05 AT Commands. Unleash the hidden power of your Bluetooth module and transform your projects! Ready to master the essential commands and unlock its full potential? Let's get started!
- Introduction to the HC-05 and AT Commands
- Preparing the HC-05 for AT Command Mode
- Essential AT Commands: A Detailed Overview
-
Frequently Asked Questions
- What is the HC05 Bluetooth module, and why would I need to use AT commands?
- Where can I find a comprehensive list of all available HC05 AT commands?
- How do I enter AT command mode on my HC05 module?
- What is the most common mistake people make when using HC05 AT commands?
- Can I use AT commands to change the Bluetooth name or password of my HC05 module?
- Final Reflection: Unleashing Wireless Potential
- Unlock Your HC05's Hidden Power Now!
Introduction to the HC-05 and AT Commands
Understanding the HC-05 Bluetooth Module
The HC-05 is a widely used Bluetooth module for enabling wireless communication in DIY electronics projects. Operating in the 2.4GHz ISM band, it provides a cost-effective and relatively simple way to add Bluetooth Classic functionality to microcontrollers and other embedded systems. This module supports Serial Port Profile (SPP), making it ideal for creating a wireless serial connection between devices. It has two operating modes: data mode, where it transmits and receives data wirelessly, and AT command mode, which allows you to configure the module's settings.
The HC-05 module is generally available in two form factors: a bare module with pins spaced at 2.0mm, and a breakout board that includes a voltage regulator and level shifters, simplifying interfacing with 5V microcontrollers like the Arduino Uno. The bare module requires careful handling due to its small pin pitch and sensitivity to voltage levels. The breakout board version, however, is much more user-friendly, especially for beginners. Understanding these differences is crucial for selecting the right HC-05 module for your specific DIY electronics project.
Why Use AT Commands? Unlocking Advanced Configuration
AT commands are a set of text-based instructions used to configure and control the HC-05 Bluetooth module. These commands allow you to modify various parameters of the module, such as its name, PIN, baud rate, and operating mode. By using AT commands, you can customize the HC-05 to suit your specific application requirements, enabling functionalities beyond basic data transmission.
Without AT commands, the HC-05 would be limited to its default settings, which may not be optimal for all projects. For example, you might need to change the Bluetooth name to make it easily identifiable, or adjust the baud rate to match the communication speed of your microcontroller. AT commands provide the flexibility to fine-tune these settings, ensuring seamless integration and optimal performance. Furthermore, using AT commands is essential for setting up advanced features like master/slave roles and secure pairing, greatly expanding the module's capabilities.
Target Audience: Who Will Benefit From This Guide?
This comprehensive guide is designed for a broad audience of electronics enthusiasts, makers, and students who are looking to integrate Bluetooth Classic connectivity into their projects using the HC-05 module. Whether you're a beginner just starting with microcontrollers or an experienced hobbyist looking to explore advanced Bluetooth functionalities, this tutorial will provide valuable insights and practical guidance.
Specifically, this guide will benefit those who are:
- Beginners in DIY electronics: The step-by-step instructions and clear explanations will help newcomers understand the basics of Bluetooth communication and how to configure the HC-05 module.
- Arduino enthusiasts: The examples provided will demonstrate how to interface the HC-05 with Arduino boards, enabling wireless control and data transfer in Arduino projects.
- Students learning embedded systems: This guide will serve as a practical learning resource for understanding Bluetooth technology and its applications in embedded systems.
- Makers working on IoT projects: The HC-05 module can be used to create wireless connections between devices in IoT projects, and this guide will provide the knowledge needed to configure and use the module effectively.
Preparing the HC-05 for AT Command Mode

Hardware Requirements: Essential Components
To successfully use AT commands with the HC-05 Bluetooth module, you'll need a few essential hardware components. These components ensure proper communication and power supply for the module, allowing you to enter AT command mode and configure its settings.
Here's a list of the necessary hardware:
- HC-05 Bluetooth Module: This is the core component for enabling Bluetooth communication. Ensure you have either the bare module or the breakout board version.
- Microcontroller (e.g., Arduino Uno): A microcontroller is needed to send AT commands to the HC-05. An Arduino Uno is a popular choice due to its ease of use and wide availability.
- USB Cable (for Arduino): To program the Arduino and establish a serial connection with your computer.
- Breadboard: A breadboard provides a convenient way to connect the HC-05 and Arduino without soldering.
- Jumper Wires: These are used to connect the HC-05 to the Arduino and provide power.
- 5V Power Supply (if needed): While the Arduino can supply power, a separate 5V power supply might be necessary for stable operation, especially when the HC-05 is transmitting data.
- Logic Level Converter (Optional): If you are using a 3.3V HC-05 module with a 5V microcontroller, a logic level converter is recommended to prevent damage to the HC-05.
Connecting the HC-05 to a Microcontroller for AT Commands (Example: Arduino)
Connecting the HC-05 to a microcontroller, such as an Arduino Uno, is a crucial step in order to send AT commands and configure the module. The connection involves wiring the HC-05's power, ground, transmit (TX), and receive (RX) pins to the corresponding pins on the Arduino.
Here's a step-by-step guide on how to connect the HC-05 to an Arduino Uno for AT command mode:
- Power Connections:
- Connect the VCC pin of the HC-05 to the 5V pin on the Arduino.
- Connect the GND pin of the HC-05 to the GND pin on the Arduino.
- Serial Communication Connections:
- Connect the TX pin of the HC-05 to a digital pin on the Arduino (e.g., pin 10) through a voltage divider or logic level converter if the HC-05 is a 3.3V module. The voltage divider can be made with a 1kΩ and 2kΩ resistor.
- Connect the RX pin of the HC-05 to a digital pin on the Arduino (e.g., pin 11).
- Enable Pin Connection (Key/EN):
- Connect the Enable (EN or KEY) pin of the HC-05 to the 3.3V pin of the Arduino through a 1kΩ resistor. This is required to reliably enter AT command mode.
- SoftwareSerial Library:
- Use the SoftwareSerial library in the Arduino IDE to create a software serial port on the chosen digital pins (e.g., 10 and 11). This allows you to communicate with the HC-05 without using the hardware serial pins (0 and 1), which are used for uploading code.
This setup allows the Arduino to send AT commands to the HC-05 and receive responses, enabling you to configure the module's settings.
Entering AT Command Mode: A Step-by-Step Guide
To configure the HC-05 using AT commands, you first need to put the module into AT command mode. This mode allows the module to receive and process AT commands sent from a microcontroller or a serial terminal.
Here's a detailed step-by-step guide to enter AT command mode:
- Power Off the HC-05: Ensure that the HC-05 module is not powered on. Disconnect the VCC wire from the Arduino or power supply.
- Connect the Enable (EN or KEY) Pin: Connect the EN pin to the 3.3V pin on the Arduino. This pin is crucial for enabling AT command mode.
- Power On the HC-05: While keeping the EN pin connected to 3.3V, reconnect the VCC wire to power on the HC-05.
- Verify AT Mode: Once powered on, the HC-05's LED indicator should blink slowly (typically around 2 times per second). A slow blink indicates that the module is in AT command mode. If the LED is blinking rapidly, the module is in data mode, and you need to repeat the steps above.
- Open Serial Monitor: Open the Serial Monitor in the Arduino IDE. Set the baud rate to 38400 (or another baud rate supported by your HC-05 module) and select "Both NL & CR" (Newline and Carriage Return) in the line ending option.
- Send AT Command: Type "AT" (without quotes) in the Serial Monitor and send it. If the HC-05 is correctly in AT command mode, it should respond with "OK."
Essential AT Commands: A Detailed Overview
AT Command Syntax: Understanding the Structure
AT commands follow a specific syntax that needs to be understood to effectively configure the HC-05 Bluetooth module. The syntax consists of a prefix ("AT"), a command name, optional parameters, and a terminator. Adhering to this structure is crucial for the HC-05 to correctly interpret and execute the commands.
Here's a breakdown of the AT command syntax:
- Prefix: All AT commands begin with the prefix "AT". This tells the HC-05 module that it is receiving a command.
- Command Name: This specifies the action to be performed. Examples include "NAME" for setting the Bluetooth name, "PIN" for setting the PIN code, and "UART" for configuring the UART communication parameters.
- Parameters (Optional): Some commands require parameters to specify the desired value or setting. For example, the "AT+NAME" command requires the new Bluetooth name as a parameter. Parameters are typically enclosed in quotation marks.
- Terminator: AT commands must be terminated with a carriage return and a newline character (\\r\\n). The Arduino Serial Monitor can be configured to automatically add these characters when sending commands.
For example, the command to set the Bluetooth name to "MyHC05" would be: AT+NAME="MyHC05"\r\n. Understanding this syntax is essential for constructing valid AT commands and successfully configuring the HC-05 module.
Testing Communication: The AT Command
The most basic and essential AT command is simply "AT". This command serves as a communication test to ensure that the HC-05 module is properly connected and responsive. Sending the "AT" command and receiving an "OK" response confirms that the module is in AT command mode and can communicate with the microcontroller or serial terminal.
To test the communication:
- Ensure the HC-05 is in AT command mode. (Refer to the previous section on entering AT command mode.)
- Open the Serial Monitor in the Arduino IDE (or your preferred serial terminal).
- Set the baud rate to 38400 (or the appropriate baud rate for your module).
- Type "AT" (without quotes) in the Serial Monitor.
- Ensure that the "Both NL & CR" option is selected in the line ending settings of the Serial Monitor.
- Send the command.
If the HC-05 is functioning correctly, it will respond with "OK" in the Serial Monitor. If you do not receive this response, check your wiring, power supply, and baud rate settings. A missing "OK" response indicates a problem with the connection or the module's configuration.
Checking Firmware Version: AT+VERSION
The AT+VERSION command is used to retrieve the firmware version of the HC-05 Bluetooth module. This can be useful for troubleshooting, ensuring compatibility with certain features, or simply verifying the module's identity. The firmware version provides information about the software running on the module, which can be important for identifying potential issues or determining if an update is available.
To check the firmware version:
- Ensure the HC-05 is in AT command mode.
- Open the Serial Monitor in the Arduino IDE (or your preferred serial terminal).
- Set the baud rate to 38400 (or the appropriate baud rate for your module).
- Type
AT+VERSION(without quotes) in the Serial Monitor. - Ensure that the "Both NL & CR" option is selected in the line ending settings of the Serial Monitor.
- Send the command.
The HC-05 will respond with a string containing the firmware version information. For example, the response might look like: +VERSION:2.0-20100601. This information can be helpful when seeking support or troubleshooting issues related to the HC-05 module.
Resetting the Module: AT+RESET
The AT+RESET command is used to reset the HC-05 Bluetooth module, returning it to its default state. This can be useful for clearing any previous configurations or resolving issues caused by incorrect settings. Resetting the module can be a quick way to start fresh and ensure a clean configuration.
To reset the HC-05:
- Ensure the HC-05 is in AT command mode.
- Open the Serial Monitor in the Arduino IDE (or your preferred serial terminal).
- Set the baud rate to 38400 (or the appropriate baud rate for your module).
- Type
AT+RESET(without quotes) in the Serial Monitor. - Ensure that the "Both NL & CR" option is selected in the line ending settings of the Serial Monitor.
- Send the command.
After sending the AT+RESET command, the HC-05 module will restart. You will typically see a brief interruption in the serial communication as the module resets. Once the module has restarted, it will be in its default configuration. This can be a helpful step when troubleshooting or when you want to start with a clean slate.
Frequently Asked Questions
What is the HC05 Bluetooth module, and why would I need to use AT commands?
The HC05 is a popular and low-cost Bluetooth module used for wireless communication. AT commands are necessary to configure its settings like baud rate, name, and password for specific project requirements. This allows for customized Bluetooth functionality.
Where can I find a comprehensive list of all available HC05 AT commands?
A complete list is often found in the HC05 datasheet or on DIY Electronics Hub. The Ultimate Guide to HC05 AT Commands offers a curated list with explanations and examples for common configurations.
How do I enter AT command mode on my HC05 module?
Typically, you need to disconnect power, hold down the key button, and then re-apply power. Some modules require specific voltage levels on the enable pin instead. Consult your module's documentation.
What is the most common mistake people make when using HC05 AT commands?
A frequent issue is using the incorrect baud rate for AT command communication. The default baud rate is often 38400 bps, but this can vary. Another issue is improper wiring for the enable pin.
Can I use AT commands to change the Bluetooth name or password of my HC05 module?
Yes, AT commands allow you to modify the module's name using AT+NAME and the password using AT+PSWD. These configurations are crucial for security and identification within your Bluetooth projects.
Final Reflection: Unleashing Wireless Potential
The power of the HC05 Bluetooth module, often underestimated, lies dormant until unlocked by the precise application of AT commands. This guide serves as a key, empowering makers and engineers to tap into the full potential of this versatile device, bridging the gap between simple connectivity and sophisticated wireless applications. The ability to configure and control the HC05 with precision translates directly into more robust, reliable, and innovative projects, making this knowledge increasingly relevant in our interconnected world.
The impact of accessible knowledge like this extends far beyond individual projects. It fosters a culture of experimentation and innovation, democratizing access to technology and empowering individuals to create solutions tailored to their specific needs. The ability to manipulate and customize hardware through software, as demonstrated by the HC05 and its AT commands, is a cornerstone of the maker movement. The future belongs to those who learn more skills and combine them in creative ways.
- Robert Greene. This sentiment perfectly encapsulates the spirit of exploration and mastery that this guide aims to inspire.
Now, consider the possibilities. Armed with this knowledge of HC05 AT commands, how will you shape the future of connectivity? Will you build a smart home device, a remote-controlled robot, or a sensor network that revolutionizes data collection? The power is in your hands. Embrace the challenge, experiment fearlessly, and unlock the wireless potential that awaits you.
Thank you for delving into the world of HC05 AT commands! We hope you've gained valuable insights into unlocking the full potential of your Bluetooth module. Now it's time to put that knowledge into action!
- Start experimenting with different AT commands right away! Don't be afraid to break things – that's how you learn.
- Share your most useful HC05 command discoveries or your personal projects on social media using #DIYElectronicsHub.
- Consider adapting an old electronics project that has some limited range to use a HC05 to become Bluetooth enabled.
What creative project will you bring to life with your newfound HC05 mastery? Share your ideas in the comments below!
