ADIY LABS

Interfacing ADIY UNO SMD with HLK B50 Bluetooth Module : Step-by-Step Guide

Interfacing ADIY UNO SMD with HLK B50 Bluetooth Module

Step-by-Step: Interfacing ADIY UNO SMD with HLK B50 Bluetooth Module

Introduction

In this tutorial, we will guide you through the process of interfacing the ADIY UNO SMD with the HLK B50 Bluetooth Module. This step-by-step guide will help you establish seamless Bluetooth communication between the two devices, making it ideal for wireless applications like IoT projects, home automation, and remote device control.

Prerequisites

Before we begin, ensure you have the following components:

  • ADIY UNO SMD (Arduino-compatible board) – Link to buy
  • HLK B50 Bluetooth Module – Link to buy
  • Jumper wires – Link to buy
  • USB cable for Arduino 
  • Computer with Arduino IDE installed

Understanding HLK B50 Bluetooth Module

The HLK B50 is a Bluetooth module designed for wireless communication. It supports both serial communication and AT commands, making it easy to integrate with microcontrollers like the ADIY UNO SMD.

HLK B50 Pinout

  1. VCC – 3.3V Power Supply
  2. GND – Ground
  3. TXD – Transmit Data
  4. RXD – Receive Data
  5. STATE – Connection Status Indicator
  6. EN – Enable Pin

Step 1: Wiring the HLK B50 to ADIY UNO SMD

Connect the HLK B50 module to the ADIY UNO SMD using the following wiring scheme:

HLK B50 PinADIY UNO SMD Pin
VCC3.3V
GNDGND
TXDRX (D2)
RXDTX (D3)
EN3.3V

Note: The ADIY UNO SMD operates at 5V logic, while the HLK B50 works at 3.3V. Use a logic level shifter or a resistor divider to avoid damaging the Bluetooth module.

Step 2: Installing the Required Libraries

To communicate with the HLK B50, install the Software Serial library in the Arduino IDE:

  1. Open Arduino IDE
  2. Go to SketchInclude LibraryManage Libraries
  3. Search for Software Serial and install it if not already installed.

Step 3: Uploading the Arduino Code

Copy and upload the following code to the ADIY UNO SMD:

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(2, 3); // RX, TX

void setup() {
  Serial.begin(9600);
  BTSerial.begin(9600);
  Serial.println("Bluetooth Module Ready");
}

void loop() {
  if (BTSerial.available()) {
    char c = BTSerial.read();
    Serial.write(c);
  }
  if (Serial.available()) {
    char c = Serial.read();
    BTSerial.write(c);
  }
}

Explanation of the Code:

  • SoftwareSerial BTSerial(2, 3); → Defines software serial communication on digital pins D2 (RX) and D3 (TX).
  • BTSerial.begin(9600); → Initializes the Bluetooth module at 9600 baud rate.
  • Serial communication between the PC and the Bluetooth module is handled in the loop.

Step 4: Testing the Bluetooth Connection

  1. Open the Serial Monitor in Arduino IDE (Baud Rate: 9600).
  2. Pair the HLK B50 with a smartphone using a Bluetooth terminal app (like “Bluetooth Terminal HC-05”).
  3. Send messages from the app; they should appear in the Serial Monitor.
  4. Type in the Serial Monitor to send messages back to the smartphone.

Troubleshooting Tips

  • Module not responding? Check if the module is powered properly (3.3V).
  • Garbled text in Serial Monitor? Ensure the baud rate is correctly set to 9600.
  • Cannot pair the device? Make sure the HLK B50 is in pairing mode.

Conclusion

By following this guide, you have successfully interfaced the ADIY UNO SMD with the HLK B50 Bluetooth Module. You can now integrate Bluetooth communication into your projects for wireless data transfer, home automation, and IoT applications.

This blog is to help developers and hobbyists easily find and implement Bluetooth communication with ADIY UNO SMD. Happy coding!

Leave a Reply

Your email address will not be published. Required fields are marked *