To establish a Bluetooth connection with an Arduino Uno, you’ll need to use a Bluetooth module such as the HC-05 or HC-06, which allows your Arduino to communicate wirelessly with other Bluetooth-enabled devices like smartphones, tablets, or computers. Here are the steps to establish a Bluetooth connection with Arduino Uno using the HC-05 module as an example:
Components Needed:
Arduino Uno
HC-05 Bluetooth module
Jumper wires
A Bluetooth-enabled device (e.g., smartphone, tablet, computer)
Connections:
Arduino – HC-05 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.
Connect the TX (Transmit) pin of the HC-05 to the RX (Receive) pin (pin 0) on the Arduino.
Connect the RX (Receive) pin of the HC-05 to the TX (Transmit) pin (pin 1) on the Arduino.
Put HC-05 in AT Mode (Optional):
If you need to change the default settings of the HC-05 module (e.g., baud rate, name), you may need to put it into AT command mode. Refer to the HC-05 datasheet or documentation for instructions on how to do this. Usually, this involves connecting a specific pin (often referred to as “KEY” or “EN”) to either VCC or GND while powering on the module.
Power Supply:
Make sure your Arduino is powered either via USB or an external power source.
Arduino Code:
Here is a simple example Arduino code to get you started with Bluetooth communication. This code receives characters from the Bluetooth module and sends them back. It’s a basic loop-back test.
#include <SoftwareSerial.h>
SoftwareSerial bluetooth(0, 1); // RX, TX
void setup() {
Serial.begin(9600); // Serial monitor for debugging
bluetooth.begin(9600); // Bluetooth module communication
}
void loop() {
// Read data from Bluetooth module and send it to Serial Monitor
if (bluetooth.available()) {
char c = bluetooth.read();
Serial.print(c);
}
// Read data from Serial Monitor and send it to Bluetooth module
if (Serial.available()) {
char c = Serial.read();
bluetooth.print(c);
}
}
Pairing and Testing:
- Power up your Arduino Uno.
- Make sure your HC-05 module is in pairing/discovery mode.
- On your Bluetooth-enabled device (e.g., smartphone), search for available Bluetooth devices.
- You should see your HC-05 module listed. Pair with it.
- Open a serial communication app (e.g., Bluetooth Terminal) on your device and connect to the HC-05 module.
- Type text on your device, and it should be received by the Arduino and sent back.
Remember that this is a basic example, and you can extend it to control hardware or exchange data between the Arduino and your Bluetooth device based on your project requirements. Additionally, make sure you’ve configured the baud rates and other settings correctly based on your specific HC-05 module configuration.




