[go: up one dir, main page]

0% found this document useful (0 votes)
92 views18 pages

Interfacing of Blue Tooth With 8051

The document discusses interfacing a Bluetooth module with an 8051 microcontroller. It describes how the HC-05 Bluetooth module uses UART communication and has pins that interface with the Rx and Tx pins on the 8051. The Bluetooth module can work as a master or slave device. An example application is provided to control an LED using a smartphone by interfacing the HC-05 module with an 8051 microcontroller and transmitting data via the UART serial communication.
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)
92 views18 pages

Interfacing of Blue Tooth With 8051

The document discusses interfacing a Bluetooth module with an 8051 microcontroller. It describes how the HC-05 Bluetooth module uses UART communication and has pins that interface with the Rx and Tx pins on the 8051. The Bluetooth module can work as a master or slave device. An example application is provided to control an LED using a smartphone by interfacing the HC-05 module with an 8051 microcontroller and transmitting data via the UART serial communication.
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/ 18

Interfacing of Bluetooth

with 8051

Geetha A P

Harish R

Brindha M
Bluetooth
❑ Bluetooth wireless technology is
becoming a popular standard in the
communication. it is one of the fastest
growing fields in the wireless
technologies.

❑ A Bluetooth module widely used with


Microcontroller to enable Bluetooth
communication. This module can be
interfaced using the UART in 8051
microcontroller where the data are
transmitted in the form of packets.

6/4/2022 2
8051

6/4/2022 3
HC-05 BLUETOOTH PINS

HC-05 is a Bluetooth device used for wireless communication.

❑ It works on serial communication (UART).

❑ It is a 6 pin module.

6/4/2022 4
Default Bluetooth Name: “HC-05”
Default Password: 1234 or 0000
Default Communication: Slave
Default Mode: Data Mode

6/4/2022 5
key
<-31,32 led Bluetooth module is work as master or slave.

❑ Master Bluetooth module can send or receive


data from other Bluetooth modules.

❑ But slave Bluetooth can only listen to


master Bluetooth module.

6/4/2022 6
✓ To enable Bluetooth communication, the HC-05 module is interfaced with the 8051 microcontroller via the built-
in UART circuitry present in the microcontroller.

✓ And the data is transmitted in the form of packets.

✓ The 8051 microcontrollers have inbuilt pins P3.0 (RXD) and P3.1 (TXD) for receiving and transmitting the data
from/to the HC-05 Bluetooth module respectively.

✓ The pins TX and RX pin of the HC 05 form the path for data transmission and reception. These TX pin of HC05
must be connected to the RX pin of 8051 and vice versa. Whereas the key pin of the module is used to set the
password for pairing the module with our devices.

6/4/2022 7
UART(universal asynchronous receiver/transmitter)

Serial communication means to transfer data bit by bit serially at a time, whereas in parallel communication, the
number of bits that can be transferred at a time depends upon the number of data lines available for
communication.

Two methods of serial communication are

•Synchronous Communication

•Asynchronous Communication

8051 has built-in UART with RXD (serial data receive pin) and TXD (serial data transmit pin) on PORT3.0 and
PORT3.1 respectively.

6/4/2022 8
☻HC-05 Bluetooth Module is one of the most popular bluetooth module used in
embedded projects.

☻It can be easily interfaced with Arduino Board, Raspberry Pi, Microcontrollers
through serial UART/USB interface.

☻HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module,
designed for transparent wireless serial connection setup.
HC-05 Bluetooth interfacing w ith 8051 to control LED via smartphone

#include <reg51.h>
if(Data_in == '1’)
#include "UART_H_file.h" /* Include UART library */
{ LED = 1;/* Turn ON LED */
sbit LED=P1^0;
UART_SendString("LED_ON"); /* Send status of LED*/
void main() {
}
char Data_in;
else if(Data_in == '2’)
UART_Init(); /* Initialize UART */
{ LED = 0;/* Turn OFF LED */
P1 = 0; /* Clear port initially */
UART_SendString("LED_OFF"); /* Send status of LED*/
LED = 0; /* Initially LED turn OFF */
}
while(1) {
else UART_SendString("Select proper option"); } }
Data_in = UART_RxChar(); /* Receive char serially*/

6/4/2022 10
UART_C_file.h

#ifndef UART_H_file_H
#define UART_H_file_H

#include<reg51.h>

void UART_Init();
void UART_TxChar(char);
char UART_RxChar();
void UART_SendString(char *);

#endif

6/4/2022 11
* UART_C_file.c

char UART_RxChar()
#include"UART_H_file.h" {
char dat;
void UART_Init() while (RI==0);
{ RI = 0;
TMOD = 0x20; dat = SBUF;
TH1 = 0xFD; return(dat);
SCON = 0x50; }
TR1 = 1;
}
void UART_SendString(char *str)
void UART_TxChar(char Data) {
{ int i;
SBUF = Data; for(i=0;str[i]!=0;i++)
while (TI==0); {
TI = 0; UART_TxChar(str[i]);
} }
}
6/4/2022 12
02
Bluetooth based robot by using 8051 controller w ith Keil and Proteus simulation

0xFD; //9600 bps

6/4/2022 15
6/4/2022 16
THANK YOU

ALPINE SKI HOUSE

You might also like