The Bluetooth module HM-10, manufactured by Keyestudio (part ID: KS0174), is a versatile and low-cost module designed for wireless communication between devices. Utilizing Bluetooth 4.0 technology, it is particularly suitable for embedded systems and Internet of Things (IoT) projects, enabling seamless data transfer and communication over Bluetooth. Common applications include home automation, sensor data collection, and remote device control.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V to 6V DC) |
2 | GND | Ground connection |
3 | TXD | Transmit data (connect to RXD of host device) |
4 | RXD | Receive data (connect to TXD of host device) |
5 | STATE | Indicates the module status |
6 | BRK | Breakout pin, not commonly used |
#include <SoftwareSerial.h>
SoftwareSerial HM10(10, 11); // RX = 10, TX = 11
void setup() {
Serial.begin(9600);
HM10.begin(9600); // Default baud rate of the HM-10 module
Serial.println("HM-10 Bluetooth module is ready");
// Make sure the baud rate matches the setting on the HM-10 module.
}
void loop() {
// Forward any data received from the HM-10 to the Serial Monitor
if (HM10.available()) {
Serial.write(HM10.read());
}
// Forward any data received from the Serial Monitor to the HM-10
if (Serial.available()) {
HM10.write(Serial.read());
}
}
Q: Can the HM-10 module communicate with Bluetooth 2.0 or 3.0 devices? A: No, the HM-10 is a BLE module and is not backward compatible with earlier Bluetooth versions.
Q: How do I change the baud rate of the HM-10 module?
A: You can change the baud rate using AT commands. For example, sending AT+BAUD4
will set the baud rate to 9600.
Q: What is the default PIN code for pairing?
A: The default PIN code is typically 000000
or 123456
. Check the module's datasheet for the exact PIN.
Remember to consult the HM-10 datasheet provided by Keyestudio for more detailed information and advanced configurations.