fbpx

Interface Zigbee With ARM7

Description

Zigbee devices can transmit data over long distances by passing data through a mesh network of intermediate devices to reach more distant ones. Zigbee is typically used in low data rate applications that require long battery life and secure networking.

  • The Zigbee is the name of a wireless protocol maintained by the IEEE 802.15 standard.
  • This is a protocol specified for Wireless Personal Area Network (PAN) using low powered wireless transceivers.
  • They have an approximate range of 10 to 100 meters.
  • They can communicate with other devices using the simplest serial communication protocol.
  • Zigbee uses only two Zigbee modules in which one of them transmits the data and another one receives data.
  • The Zigbee module made communication using serial communication protocol with the interfacing devices they can be connected to a microcontroller using a minimum of four pins.
  • They are
    1.Power supply.
    2. Ground.
    3. UART Data Out.
    4. UART Data.
  • Zigbee networks are secured by 128-bit symmetric encryption keys.

Application

  • Wireless light switch
  • Electrical meter
  • Traffic management system
  • And other consumer and industrial equipment

Hardware Required

  • Zigbee Module.
  • LPC21XX MicroController.

Zigbee Pinout

  • Vin= +5V.
  • Dout= Rx of Microcontroller.
  • Din= Tx of Microcontroller.
  • Gnd= Ground.

Circuit

Transmitter

Receiver

Code

Transmit

 #include <LPC21xx.H>
 void uart_transmit1(unsigned char *a);
 void delay();
 
 int main()
 {
 VPBDIV=0X02;
 PINSEL0=0X00000005;
 U0LCR=0X83;
 U0DLL=0XC3;
 U0DLM=0X00;
 U0LCR=0X03;
 uart_transmit1("HELLO");
 delay();
 uart_transmit1("WORLD");
 delay();
 uart_transmit1("ZIGBEE");
 delay();
 }
 
 void uart_transmit1(unsigned char *a)
 {
 int i=0;
 while(a[i]!='\0')
 {
 U0THR=a[i];
 while(!(U0LSR & 0X20));
 i++;
 }
 }
  void delay()
 {
 int i,j;
 for(i=0;i<1000;i++);
 for(j=0;j<40;j++);
 } 

Receive

 #include <LPC21xx.H>
 void uart_transmit(unsigned char a);
 void uart_transmit1(unsigned char *a);
 void uart_receive();
 unsigned char rdata[];
 void delay();
 int r;
 char k;
 int main()
 {
 VPBDIV=0X02;
 PINSEL0=0X00000005;
 U0LCR=0X83;
 U0DLL=0XC3;
 U0DLM=0X00;
 U0LCR=0X03;
 uart_receive();
 delay();
 uart_transmit1(rdata);
 delay();
 }
 void uart_receive()
 {
 while(!(U0LSR & (0X01)));
 r=U0RBR;
 rdata[k++]=r;
 }
 void uart_transmit1(unsigned char *a)
 {
 int i=0;
 while(a[i]!='\0')
 {
 U0THR=a[i];
 while(!(U0LSR & 0X20));
 i++;
 }
 }
 void delay()
 {
 int i,j;
 for(i=0;i<1000;i++);
 for(j=0;j<40;j++);
 } 

Leave a Reply

Your email address will not be published. Required fields are marked *