ESD - DAY 10-Portal
ESD - DAY 10-Portal
10
● Exercise
Write down all the thoughts you are associated with daily.
Analyze what to stop and what to nurture.
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
Bluetooth Control Home automation
Home automation system is designed which can be controlled by any Android smartphone.
The automation system connects with the smartphone through Bluetooth. The smart
phone sends control signals to switch home appliances ON or OFF by an android app
through Bluetooth interface.
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
Hardware Required
Software required
●Keil
●Nuvoton ISP-ICP Utility
●Hyper terminal
●Android Bluetooth control(PLAY STORE)
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
What is Bluetooth
● Bluetooth wireless technology is an open specification for a low-cost, low-power,
short-range radio technology for wireless communication of voice and data.
Bluetooth is a short-range wireless technology standard that is used for exchanging data
between fixed and mobile devices over short distances using UHF radio waves in the ISM
bands, from 2.402 GHz to 2.48 GHz, and building personal area networks.
Advantages of Bluetooth
● Advantages
○ Bluetooth: interoperable
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
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
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
Tech Specifications
● Serial Bluetooth module for arduino other microcontrollers
● Operating Voltage: 4V to 6V (Typically +5V)
● Operating Current: 30mA
● Range: <100m
● Works with Serial communication (USART) and TTL compatible
● Follows IEEE 802.15.1 standardized protocol
● Uses Frequency-Hopping Spread spectrum (FHSS)
● Can operate in Master, Slave or Master/Slave mode
● Can be easily interfaced with Laptop or Mobile phones with Bluetooth
● Supported baud rate: 9600,19200,38400,57600,115200,230400,460800.
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
What is an Relay
A relay is an electrically operated switch. It consists of a set of input terminals for a single
or multiple control signals, and a set of operating contact terminals.
The traditional form of a relay uses an electromagnet to close or open the contacts, but other operating
principles have been invented, such as in solid-state relays which use semiconductor properties for
control without relying on moving parts.
Block Diagram
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
Serial Data
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
Circuit Diagram
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
Header file and Port Configuration
#include <reg51.h>
void UART_Init();
void UART_TxChar(char);
char UART_RxChar();
void UART_SendString(char *);
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
UART Initialization
void UART_Init()
{
TMOD = 0x20;
TH1 = 0xFD;
SCON = 0x50;
TR1 = 1;
}
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
UART Transmit and Receive
void UART_TxChar(char Data)
{
SBUF = Data;
while (TI==0);
TI = 0;
}
char UART_RxChar()
{
char dat;
while (RI==0);
RI = 0;
dat = SBUF;
return(dat);
}
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
Transmit String
void UART_SendString(char *str)
{
int i;
for(i=0;str[i]!=0;i++)
{
UART_TxChar(str[i]);
}
}
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
void main()
{
char Data_in;
UART_Init(); /* initialize UART Tx=P3^0 and Rx=P3^1 */
P2 = 0; /* clear port initially */
Lamp = 1; /* initially Lamp turn OFF */
Fan = 1; /* initially Fan turn OFF */
while(1)
{
Data_in = UART_RxChar(); /* receive char serially */
UART_TxChar(Data_in);
if(Data_in == ‘1')
{
Lamp = 1; /* turn ON LED */
UART_SendString("Lamp_ON"); /* send status of LED*/
}
else if(Data_in == ‘2')
{
Lamp=0; /* turn OFF Lamp */
UART_SendString("Lamp_OFF"); /* send status of Lamp*/
}
else if(Data_in == ‘3’)
{
Fan = 1; /* turn ON Fan */
UART_SendString("Fan_ON"); /* send status of Fan*/
}
else if(Data_in == ‘4')
{
Fan=0; /* turn OFF LED */
UART_SendString("Fan_OFF"); /* send status of LED*/
}
else
{
UART_SendString("Select proper option"); /* send msg to select proper option */
}
}
}
Thank You