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 / Need help in zigbee communication for the project.

Need help in zigbee communication for the project.

|

Microcontroller › 8051 › Need help in zigbee communication for the project.

  • This topic has 0 replies, 1 voice, and was last updated 14 years ago by manohar.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • December 23, 2011 at 10:37 am #1460
    manohar
    Participant

               I need to send voltage values through zigbee.I connected ADC to microcontroller and also getting  digital values in LCD. I need to send that digital values using zigbee.

       

               For this code i don’t know where i have to put below code in the actual  program.

     

    {
        while(!TI);
     

        SBUF=m;     ///    m is the voltage values  1,2,3,4,5 is sending to sbuf

         TI=0;
                   //data1=1;
        delay(1);
       

    }  

     

     

    Below is the original program

     

     

    // Program to Interface Humidity sensor with 8051 Microcontroller
    #include<reg51.h>

    sfr lcd_data_pin=0x80;//p0 port
    sbit rs=P3^0;
    sbit rw=P3^1;
    sbit en=P3^2;

    sbit wr= P3^3;
    sbit rd= P3^4;
    sbit intr= P3^5;

    sfr input_port=0x90; //p1 port
    char m;

     
    void delay(unsigned char count)
    {
    unsigned char i;
    unsigned int j;
    for(i=0;i<count;i++)
    for(j=0;j<1275;j++);
    }
     
    void lcd_command(unsigned char item)
    {
    lcd_data_pin=item;
    en=1;
    rs=0;
    rw=0;
    delay(1);
    en=0;
    }
     
    void lcd_data(unsigned char item)
    {
    lcd_data_pin=item;
    en=1;
    rs=1;
    rw=0;
    delay(1);
    en=0;
    }
     
    void lcd_data_string(unsigned char *str)  // Function to send string on LCD
    {
      int i=0;
      while(str!=’’)
    {
        lcd_data(str
    );
        i++;
        delay(1);                               
    }
    return;
    }
     
    void lcd_ini()
    {
    lcd_command(0x38);  // for using 8-bit 2 row LCD
    delay(50);
    lcd_command(0x0F);        // for display on cursor blinking
    delay(50);
    lcd_command(0x0C);
    delay(50);
    lcd_command(0x80);
    delay(50);
    }
     

    void display()
    {
    unsigned char x,binbyte,d1,d2,d3;
    float y;
    binbyte=input_port;

    x=binbyte/10;  
    d3=x/10;

    d2=x%10;

    delay(20);
    d1=binbyte%10;

    delay(20);

    y=((d3*100)+(d2*10)+d1);
    m=((y/255.0)*5.0);/////////////////////////this m values i need to send through zigbee.
     lcd_data(m+48.0);
     delay(50);
     lcd_command(0x01);

     
            }
      
    void adc()
    {
       

    rd=1;
    wr=0;
    delay(10);
    wr=1;
    while(intr==1);
    rd=0;
    display();
    delay(10);
    intr=1;
    }

     
    void main()

    {
    //float m;
    SCON=0x52; // set TI flag to indicate that UART is free
    ES=0; // disable serial interrupt due we have no its ISR
    TMOD=0x20;
    TH1=0xFD;
    TR1=1;
     lcd_ini();
    lcd_data_string(“%Rel.Humidity:”);
       
       
       
       while(1)
       {
           adc();

       }
    }

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

RSS Recent Posts

  • Sine wave distortion January 17, 2026
  • Micro mouse January 17, 2026
  • flexible copper cable January 16, 2026
  • Flip Flop for My Mirrors January 16, 2026
  • potenciometer attachment / screwdriver January 16, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 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