KEMBAR78
Bluetooth - Interfacing With RPI | PDF | Bluetooth | Raspberry Pi
0% found this document useful (0 votes)
13 views7 pages

Bluetooth - Interfacing With RPI

The document outlines a program on Bluetooth interfacing with Raspberry Pi, detailing the process of pairing devices and controlling an LED via an Android app. It includes instructions for using the 'bluetoothctl' utility, circuit diagrams, and steps to develop an application using MIT AppInventor. References for further learning are also provided.

Uploaded by

3832amangarg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views7 pages

Bluetooth - Interfacing With RPI

The document outlines a program on Bluetooth interfacing with Raspberry Pi, detailing the process of pairing devices and controlling an LED via an Android app. It includes instructions for using the 'bluetoothctl' utility, circuit diagrams, and steps to develop an application using MIT AppInventor. References for further learning are also provided.

Uploaded by

3832amangarg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

CENTER FOR SKILL AND ENTREPRENEURSHIP

DEVELOPMENT
(CSED)
INDUSTRIAL INTERNET OF THINGS

PROGRAM CODE: IIOT-3

PROGRAM NAME: SMART INDUSTRIAL CONNECTIVITY FOR IIOT

TOPIC: BLUETOOTH
INTERFACING WITH RPI
TABLE OF CONTENTS
Bluetooth Interfacing with Raspberry Pi .................................................................................... 3

Pairing Devices with Raspberry Pi over Bluetooth: ..................................................................... 3

Circuit Diagram: ................................................................................................................... 5

Controlling LED with Android App .......................................................................................... 6

References ........................................................................................................................... 7

Page 2 of 7
BLUETOOTH INTERFACING WITH RASPBERRY PI
Raspberry Pi is very popular for IoT projects because of its seamless ability of wireless
communication over internet. Raspberry Pi 3 has inbuilt Wi-Fi and Bluetooth, and Bluetooth is a
very popular wireless communication Protocol. So today we are going to Control Raspberry Pi
GPIO Pin through an Android app using Bluetooth.

PAIRING DEVICES WITH RASPBERRY PI OVER BLUETOOTH:


Pairing Bluetooth Devices, like mobile phone, with Raspberry Pi is very easy. Here we have paired
our Android Smart phone with Raspberry Pi. We have previously installed BlueZ in Pi,
which provides a command line utility called “bluetoothctl” to manage our Bluetooth devices.
But before that, connect your USB Bluetooth dongle with Raspberry Pi and check that whether it is
detected or not, by using below command:
lsusb

Now open the bluetoothctl utility by below command:


sudo bluetoothctl
You can check all the commands of bluetoothctl utility by typing ‘help’. For now we need to enter
below commands in given order:
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# discoverable on
[bluetooth]# pairable on
[bluetooth]# scan on
After the last command “scan on”, you will see your Bluetooth device (Mobile phone) in the list.
Make sure that your mobile has Bluetooth turned on and visible by nearby devices. Then copy the
MAC address of you device and pair it by using given command:
pair <address of your phone>
Then you will be prompted for Passcode or Pin in your Terminal console then type passcode there
and press enter. Then type the same passcode in your mobile phone when prompted and you are

Page 3 of 7
now successfully paired with Raspberry Pi. We have also explained this whole process in our
Video given at the end.

As told earlier, you can also use Desktop interface to pair the Mobile phone. After
installing Blueman, you will see a Bluetooth icon in right side of your Raspberry Pi desktop as
shown below, using which you can easily do the pairing.

Page 4 of 7
CIRCUIT DIAGRAM:
Circuit diagram is very simple, we just connected a LED to PIN 40 (GPIO 21) of Raspberry Pi with
a resistor of 220 Ohm:

Page 5 of 7
CONTROLLING LED WITH ANDROID APP
Now after paring the Mobile Phone, we need to install a Android App for communicating with
Raspberry Pi using a Bluetooth Serial Adapter and follow this step to run and test the program
1. Develop Application using MIT AppInventor

2. Pair your device with HC 05/06 Bluetooth module1) Turn ON HC


05/06 Bluetooth module2) Scan for available device3) Pair to HC 05/06 by entering
default password 1234 OR 0000

3. Install LED application on your android device

4. Open the Application

5. Press paired devices

6. Select your Bluetooth module from the List (HC 05)

7. After connecting successfully

8. Press ON button to turn ON LED and OFF button to turn OFF the LED

9. Disconnect button to disconnect from Bluetooth module

Page 6 of 7
REFERENCES
1. https://learn.sparkfun.com/tutorials/bluetooth-basics/all
2. https://create.arduino.cc/projecthub/mayooghgirish/arduino-bluetooth-basic-tutorial-
d8b737
3. http://mgprojecthub.com/arduino-bluetooth-basic-tutorial

Page 7 of 7

You might also like