Mobile phone communication with Microcontroller

In stock
SKU
Mobile phone communication with Microcontroller
Quick Overview
This project is mainly based on mobile phone communication with Microcontroller using Bluetooth Interface and Controlling the Device from mobile using Bluetooth.
Call For Price

Secured and trusted checkout with

Abstract

This project is mainly based on mobile phone communication with Bluetooth and Controlling the Device from mobile using BluetoothBluetooth  is a wireless technology is becoming a popular standard in the communication arena, and it is one of the fastest growing fields in the wireless technologies. It is convenient, easy to use and has the bandwidth to meet most of today’s demands for mobile and personal communications. Bluetooth technology handles the wireless part of the communication channel; it transmits and receives data wirelessly between these devices. It delivers the received data and receives the data to be transmitted to and from a host system through a host controller interface (HCI). The most popular host controller interface today is either a UART or a USB .Here, I will only focus on the UART interface, it can be easily show how a Bluetooth module can be integrated on to a host system through a UART connection and provide the designer an optimal solution for Bluetooth enabled systems. Here, I will show two examples of hardware interface between Bluetooth wireless technology and UART. One example shows an interface between a Bluetooth and a PC via UART, and the other example shows an interface between a Bluetooth and a Microcontroller via Mobile.

Concept

This project is mainly based on mobile phone communication with the Microcontroller through Bluetooth, here we are using the Android based mobile, and to communicate with the controller we need the supporting software installed in the mobile phone. Bluetooth SPP software must be installed in it. Connect the Bluetooth  with microcontroller using the serial port communication. Then dump the following code in flash memory of controller, open the Bluetooth SPP software it asks for pairing with the Bluetooth and after pairing the mobile with Bluetooth then start entering the message whenever the message ‘3’ is entered and sent the relay will be switched ON and if we send ‘4’ Relay is switched OFF. Using the Relay we can switch ON /OFF the electrical device.

Demonstration Video

Block Diagram




block-diagram-mobilephone-comuni

Hardware requirements

  • 8051 Microcontroller
  • Power Supply (9V Adaptor, 5V Adaptor)
  • Bluetooth module
  • Relay interface (user can interface any electrical device according to their Application)
  • Mobile phone with Android OS

Software requirements

  • Programming Language: Embedded C
  • KEIL U Vision IDE
  • Flash magic
  • Bluetooth Spp software

Connect the Bluetooth device to the Microcontroller

To connect the Bluetooth device, you will need to find the Rx and TX pins on your microcontroller. Make sure that you cross the wires by connecting the Rx pin from your Bluetooth device to the TX pin on the microcontroller, and the TX pin from your Bluetooth device to the Rx pin on the microcontroller. Install the Bluetooth SPP software in Android based Mobile and pair the device and start the communication between Mobile and Microcontroller Bluetooth SPP provides Bluetooth connectivity for all android apps

Lets us see the communication between Bluetooth Module pairs with Microcontroller & Mobile with Microcontroller as discussed below

Settings for Communication between mobile and microcontroller

Android Application Based Mobile

mobile


Install Bluetooth spp application software in Mobile


Bluetooth Setting with 8051




bluetooth-module-setting

Settings for Communication between Bluetooth pairs with microcontroller

To communicate the Bluetooth with the PC we need to set the following settings in the HyperTerminal

  • 9600 Baud Rate
  • No parity
  • 8 data bits
  • Hardware flow control
  • 1 Stop bit

Connect the Bluetooth  module 1 with the PC and connect the Bluetooth  module 2 with microcontroller dump the Hex file to controller and start pairing the Bluetooth device after the device is paired the communication happens. User can see the output on HyperTerminal

Hyper terminal

  • From the Start menu select programs\Accessories\Communications\HyperTerminal or perform a search in My Computer for “HyperTerminal”

hyper-terminal
  • Type in a connection identifier name say “Test1” and click OK. The only restriction here is it cannot be a
       - Device name e.g. “COM1”
       - You will then be presented with the following dialogue box
connect-to
  • Here it is possible to choose the COM port to test using the drop down box. In this example we will use the onboard port COM1. Click OK.
  • The next dialogue box will ask for the Port Communication Settings
port-communication-settings

Bluetooth setting with PC




bluetooth-module-setting-with-pc

Bluetooth module setting with 8051

bluetooth-module-setting

Mobile phone communication Output Image

                                             Mobile phone communication with Microcontroller

Mobile phone communication with Microcontroller
Mobile phone communication with Microcontroller

SOURCE CODE 

#include
sbit Fan=P1^0;
sbit Light=P1^1;
sbit TV=P1^2;
 char str;
 char Charin=0;
void delay(int time)
{
 unsigned int i,j;
 for(i=0;i<time;i++)
 for(j=0;j<1275;j++);
}
void Serialwrite(char byte)
{
  SBUF=byte;
  while(!TI);
  TI=0;
}
void Serialprintln(char *p)
{
  while(*p)
  {
    Serialwrite(*p);
    p++;
  }
  Serialwrite(0x0d);
}
void Serialbegin()
{
   TMOD=0x20;
   SCON=0x50;
   TH1=0xfd;
   TR1=1;
}
void main()
{
  P1=0x00;
  Serialbegin();
  Serialprintln("Sys ready...");
  delay(50);
  while(1)
  {
    while(!RI);
    Charin=SBUF;
    str=Charin;
    RI=0;
      if(str=='A')
      {
        Fan=1;
        Serialprintln("     Fan ON");
        delay(50);
      }
      else if(str=='a')
      {
        Fan=0;
        Serialprintln("    Fan OFF");
        delay(50);
      }
       else if(str=='B')
      {
        Light=1;
        Serialprintln("   Light ON");
        delay(50);
      }
       else if(str=='b')
      {
        Light=0;
        Serialprintln("Light OFF");
        delay(50);
      }
       else if(str=='C')
      {
        TV=1;
        Serialprintln("      TV ON");
        delay(50);
      }
       else if(str=='c')
      {
        TV=0;
        Serialprintln("     TV OFF");
        delay(50);
      }
      str=0;
  }
}

Mobile communication with Microcontroller using Bluetooth using the serial port communication is an advantageous project; through this project you can control hardware from mobile. People can control their electrical devices via mobile. We think this product have high potential for marketing in the future.

0
Rating:
0% of 100
Write Your Own Review
You're reviewing:Mobile phone communication with Microcontroller