Make your Raspberry Pi 4 more convenient with wireless typing!

Learn how to connect a Bluetooth keyboard to your Raspberry Pi 4 for hands-free computing. Follow these simple steps and say goodbye to wires forever! …


Updated October 15, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


Learn how to connect a Bluetooth keyboard to your Raspberry Pi 4 for hands-free computing. Follow these simple steps and say goodbye to wires forever!

Are you tired of using wired keyboards with your Raspberry Pi 4? Want to type without having to worry about tangled cords or finding a USB port? Look no further - connecting a Bluetooth keyboard to your Raspberry Pi 4 is easier than you think! In this guide, we will walk you through the process step-by-step.

Step 1: Prepare Your Hardware

To get started, you will need the following:

  1. A Raspberry Pi 4 with the latest version of Raspbian installed (or any other Linux-based OS).
  2. A Bluetooth keyboard compatible with Linux. Most modern keyboards should work fine, but check your device’s specifications if you have any doubts.
  3. A USB Bluetooth dongle or built-in Bluetooth support on your Pi 4 (Model B).

Step 2: Enable Bluetooth on the Raspberry Pi

First, make sure that your Raspberry Pi has Bluetooth enabled. You can check this by running the following command in the terminal:

sudo systemctl status bluetooth

If the output shows that the Bluetooth service is not active, run the following commands to enable it:

sudo systemctl enable bluetooth
sudo systemctl start bluetooth

Step 3: Pair Your Keyboard with Raspberry Pi

Now, it’s time to pair your keyboard with the Raspberry Pi. Make sure your Bluetooth keyboard is turned on and ready to pair. Run the following command in the terminal:

bluetoothctl

This will open a new prompt with bluetoothctl. Inside this prompt, run the following commands one by one:

  1. power on - This turns on your Raspberry Pi’s Bluetooth adapter.
  2. agent on - Enables pairing mode.
  3. default-agent - Selects the default pairing agent.
  4. scan on - Scans for nearby devices that can be paired. Look for your keyboard in the list of available devices.
  5. Once you find your keyboard, note its MAC address (it should look something like XX:XX:XX:XX:XX:XX). Then, run the following command, replacing XX:XX:XX:XX:XX:XX with your keyboard’s MAC address:
pair XX:XX:XX:XX:XX:XX
  1. You will be prompted to enter a PIN or passkey for your keyboard. Most keyboards use the default PIN of 00000, so you can just press Enter when asked. If your keyboard requires a different PIN, enter it now.
  2. Wait for the pairing process to complete and confirm that your keyboard is paired successfully by running:
paired-devices
  1. To exit bluetoothctl, type quit.

Step 4: Connect Your Keyboard

Now that your keyboard is paired, you just need to connect it. Run the following command in the terminal:

bluetoothctl

Then, enter the following commands one by one:

  1. power on - Turns on Bluetooth if it’s not already active.
  2. connect XX:XX:XX:XX:XX:XX - Replace XX:XX:XX:XX:XX with your keyboard’s MAC address to connect.
  3. To verify that the connection was successful, run:
info XX:XX:XX:XX:XX:XX
  1. If everything is working correctly, you should see a “Connected: yes” message in the output. Type quit to exit bluetoothctl.

That’s it! You have successfully connected your Bluetooth keyboard to your Raspberry Pi 4. Now you can sit back, relax, and enjoy wireless typing on your Linux-powered device.