In this article, we will show you how to use a Bluetooth module with Raspberry Pi Pico. The Pico is a powerful yet small board that is perfect for projects. The Bluetooth module we will be using is the HC-05, which is a low-cost and easy-to-use module that is perfect for projects like this.
What is the HC05 Bluetooth Module?
The HC05 Bluetooth Module is a small, inexpensive module that can be used to add Bluetooth connectivity to a project. It can be used to connect to a wide variety of Bluetooth devices. . It can be used for a variety of applications including data transfer, remote control, and wireless networking.
- Bluetooth protocol: Bluetooth Specification v2.0+EDR
- Frequency: 2.4GHz ISM band
- Emission power: ≤4dBm, Class 2
- Sensitivity: ≤-84dBm at 0.1% BER
- Speed: Asynchronous: 2.1Mbps(Max) / 160 kbps, Synchronous: 1Mbps/1Mbps
- Security: Authentication and encryption
- Profiles: Bluetooth serial port
- Range: <100m
- Supported baud rate: 9600,19200,38400,57600,115200,230400,460800.
HC-05 Default Settings
- Default Bluetooth Name: “HC-05”
- Default Password: 1234 or 0000
- Default Communication: Slave
- Default Mode: Data Mode
- Data Mode Baud Rate: 9600, 8, N, 1
- Command Mode Baud Rate: 38400, 8, N, 1
- Default firmware: LINVOR
HC05 Bluetooth Module Pinout
How does the HC05 Bluetooth Module work with the Raspberry Pi Pico?
The HC05 Bluetooth Module is a small, inexpensive module that is used to add Bluetooth functionality to the Raspberry Pi Pico. The HC-05 Bluetooth module communicates with the Raspberry pi Pico over the UART interface and can be configured to use either the hardware UART. The module can be powered from the Pico’s 3.3V power supply, or from an external power source.
What is UART?
UART, or universal asynchronous receiver transmitter, is a type of asynchronous serial communication protocol. UART allows two devices to communicate with each other without the need for a common clock signal.
The UART is a very important factor in any serial communications system, as it is responsible for converting data between serial and parallel forms. Without a UART, data transfer would be very slow and ineffective.
Schematic Diagram – Bluetooth Module With Raspberry Pi Pico
Copy the following code and paste it into the Thonny Editor. Check Also Getting Started With Raspberry Pi Pico With Thonny IDE
This is an example code for checking connections.
from machine import Pin,UART
uart = UART(0,9600)
command = uart.readline()
from machine import Pin, UART
uart = UART(0, 9600)
led = Pin(13, Pin.OUT)
if uart.any() > 0:
data = uart.read()
if "on" in data:
print('LED on \n')
uart.write('LED on \n')
elif "off" in data:
print('LED off \n')
uart.write('LED off \n')
Install Bluetooth Terminal Application
We suggest using the Android app “Serial Bluetooth Terminal” available in the Play Store. You need to download the Serial Bluetooth Terminal App. When you will open the app you can see the next layout. At the base of the app, you can see that we have some buttons marked“M1”, “M2” and so on. We must set up the “M1” as the “On” button and the “M2” as the “Off” button.
The HC-05 Bluetooth Module can be easily interfaced with the Raspberry Pi Pico.
Go to your smartphone and open the “Serial Bluetooth Terminal” app. Make sure you’ve allowed your smartphone’s Bluetooth. To connect to the Pico for the first time, you need to pair a new device.
Then, you can write the“On” and “Off” messages to control the LED.