Interfacing of Blue Tooth With 8051
Interfacing of Blue Tooth With 8051
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.
6/4/2022 2
8051
6/4/2022 3
HC-05 BLUETOOTH PINS
❑ 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.
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.
✓ 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.
•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
6/4/2022 15
6/4/2022 16
THANK YOU