EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Bluetooth Module interfaing with 8051 microcontroller

Bluetooth Module interfaing with 8051 microcontroller

|

Microcontroller › 8051 › Bluetooth Module interfaing with 8051 microcontroller

  • This topic has 2 replies, 3 voices, and was last updated 10 years, 8 months ago by AJISH ALFRED.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 27, 2014 at 6:47 am #3229
    Deepak Singla
    Participant

    How to interface Bluetooth Module with 8051 microcontroller

    August 30, 2014 at 12:48 am #12091
    Nishant
    Participant
    // Program to count the number of clap
    #include<reg51.h>
    #define port P1
    #define dataport P2 //Data Port for LCD
    #define sec 1000
    sbit rs = port^0;
    sbit rw = port^1;
    sbit e = port^2;
    sbit sensor_input=P0^0;
    unsigned char str3[10]={' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};


    void delay(unsigned int msec) // Time delay function
    {
    int i,j ;
    for(i=0;i<msec;i++)
    for(j=0;j<1275;j++);
    }

    void lcd_cmd(unsigned char item) // Function to send command
    {
    dataport = item;
    rs= 0;
    rw=0;
    e=1;
    delay(1);
    e=0;
    return;
    }

    void lcd_data(unsigned char item) // Function to send data
    {
    dataport = item;
    rs= 1;
    rw=0;
    e=1;
    delay(1);
    e=0;
    return;
    }

    void lcd_data_string(unsigned char *str) // Function to send string
    {
    int i=0;
    while(str!='')
    {
    i++;
    }
    while(i>=0)
    {
    lcd_data(str
    );
    i--;
    delay(10);
    }
    return;
    }

    void convert(int num) // Function to extract digits and send to LCD
    {
    int i=0;
    while(num>0)
    {
    str3
    =(num%10)+48;
    num=num/10;
    i++;
    }
    str3
    ='';
    }

    void main()
    {
    int count=0;
    sensor_input=1;
    sensor_input=0;
    lcd_cmd(0x38);
    lcd_cmd(0x0e);
    lcd_cmd(0x01);
    while(1)
    {
    sensor_input=0;
    while(sensor_input==0);
    if(sensor_input==1)
    {
    lcd_cmd(0x01);
    count++;
    convert(count);
    lcd_cmd(0x82);
    lcd_data_string(str3);
    }
    }
    }

    August 30, 2014 at 11:46 am #12096
    AJISH ALFRED
    Participant

    Hi Nishant,

    I wonder how a piece of code could be an answer for the query from Deepak, try to give better help for the members.

     

    Hi Deepak,

    Please dont post the same query again and again. The module can be interfaced with 8051 through its serial port.

    https://www.pantechsolutions.net/project-kits/interfacing-bluetooth-with-8051-primer

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • LED circuit for 1/6 scale diorama May 14, 2025
  • Electronic board faulty?!? May 13, 2025
  • Can I use this charger in every country? May 13, 2025
  • using a RTC in SF basic May 13, 2025
  • An Update On Tarrifs May 13, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise