Design of wireless gateway based on ZigBee and Ethernet

Publisher:Mingyue1314Latest update time:2013-02-21 Source: 21IC Keywords:ZigBee Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction

ZigBee is an emerging short-distance, low-power, low-transmission-rate wireless sensor network communication technology. Based on IEEE802.15.4, sensor nodes communicate with each other and transmit the collected data to another network node or coordinator node in a relay manner. This technology uses the free IMS 2.4GHz, 915M and 868MHz frequency bands, with a transmission rate of 20K to 250Kbps and a two-way communication function. It is suitable for occasions with small communication data volume, relatively low transmission rate, small distribution range, and low cost and power consumption.

With the widespread application of computer distributed processing, Internet and other technologies, the demand for computer networking has expanded rapidly. How to remotely manage sensor networks through existing network infrastructure has gradually become a research topic for sensor networks and computer networks.

The design of a wireless gateway based on ZigBee and Ethernet is to build a data transmission channel between wireless sensor networks and the Internet.

In this design, the data transmission system converts ZigBee data packets into Ethernet TCP/IP protocol data packets, realizes bidirectional data transmission between the two protocols, builds a transparent transmission channel between the two, completes the intercommunication between ZigBee technology and Ethernet, and thus realizes on-site monitoring and remote control.

2 System Overview

The data transmission network system combining ZigBee and Ethernet includes two parts: ZigBee network and Ethernet. The ZigBee network transmits the collected data to the ZigBee junction in a multi-hop manner through the network node. The junction sends the data to the gateway. The gateway parses the ZigBee data packet, extracts the valid information data from the data packet, performs protocol conversion and re-encapsulates the data packet into a TCP/IP data packet, and sends the data to the control center through Ethernet transmission, completing the data transmission of the entire network. Figure 1 shows the data transmission network architecture combining ZigBee network and Ethernet.

http://image.c114.net/20121008/42/8067438771862099598.jpg

Figure 1 Data transmission network architecture combining ZigBee and Ethernet

The gateway is a protocol converter built on the transport layer, connecting two independent networks, ZigBee and Ethernet, to achieve ZigBee and Ethernet protocol conversion, and compress and package the data. Before forwarding, it is converted into another data packet format by the MCU (microprocessor), without the need for an external protocol conversion device, to complete the protocol conversion and data transmission between the two. From the structure diagram, the gateway structure combining ZigBee and Ethernet can be abstracted, as shown in Figure 2.

http://image.c114.net/20121008/60/6392722328944689144.jpg

Figure 2 Gateway structure combining ZigBee and Ethernet.

3 Chip selection

3.1 ZigBee chip selection

The wireless transceiver chip CC2430 from Chengdu Chipcon Company is selected as the transmission solution for the ZigBee network in this design.

CC2430 is a true system-on-chip chip, which integrates a high-performance 2.4GHz direct sequence spread spectrum (DSSS) RF transceiver core and an industrial-grade enhanced 8051 core [3]. There is no need to select another processor, which simplifies the design.

3.2 Selection of Ethernet chip

The network card chip RTL8019 from Taiwan RETLTEK Company is selected. The chip ISA bus is highly integrated, with low price, simple interface, no need for adapter chip, strong compatibility and other characteristics.

4 Overall design

4.1 Hardware design

This design uses the 8051 core on the CC2430 chip as the MCU of the entire system to control the Ethernet chip RTL8019 to realize ZigBee and Ethernet protocol conversion and data transmission. The hardware block diagram is shown in Figure 3:

http://image.c114.net/20121008/63/488937987769749679.jpg

Figure 3 Hardware structure block diagram.

Since CC2430 only provides SPI bus and UART interfaces, the hardware interface does not use another adapter chip but uses software simulation to solve the bus interface problem of address data, thereby simplifying the hardware design of the system. The hardware interface uses an 8-bit data bus mode, and the data reading mode of RTL8019 on the ISA bus is selected by jumper mode, so that RTL8019 works in 8-bit data bus mode. [page]

4.2 Protocol conversion design

http://image.c114.net/20121008/37/1978965243620987933.jpg

Figure 4 Gateway protocol conversion block diagram.

In the TCP/IP protocol suite, Ethernet data transmission uses hardware addresses (MAC) for identification. ARP (Address Resolution Protocol) completes the conversion between IP addresses and the hardware addresses used by the data link layer [4]. Therefore, in order to ensure the communication of ZigBee gateways in Ethernet, the function of ARP protocol must be implemented first. Nodes in the ZigBee network have their own unique MAC addresses. Referring to the implementation mechanism under TCP/IP, the adaptation layer and ARP in the ZigBee protocol are implemented to achieve the mapping of IP addresses to ZigBee node addresses. The protocol conversion block diagram is shown in Figure 4, which describes the data conversion process from ZigBee to Ethernet: the ZigBee node in the wireless network receives the instruction to package the data packet, and after a simple judgment, sends it to the local ARP. The network MAC address of the node is resolved through ARP to determine the Ethernet address to be sent to; then it is sent to the gateway application, and after analysis, it is sent to the corresponding Ethernet UDP or TCP processing function for corresponding processing, and then sent to the Ethernet port MAC address. In this way, the protocol conversion process of data from ZigBee to Ethernet is completed.

4.3 Data transmission

The data packet sending process is shown in Figure 5: call the initialization function, initialize CC2430 and RTL8019, set the communication frequency and local address, call the radioSend (sendBuffer, sizeof, remoteAddrDO_NOT_ACK) function, determine the length of the data to be sent, locate the destination address of the data to be sent, and determine whether it exceeds the maximum payload length allowed, otherwise the data is divided into several packets for sending; then call the sppSend (&txData) function, which is used to send the data packet pointed to by the data pointer. First, set the DMA mode, disable RF interrupts to add the format of the data packet to be sent (SPP_RX_STRUCT), load the packet length, destination address, source address, flag bit and payload, open the acceptance confirmation link, and then send the data. If the setting requires confirmation, it will automatically switch to the receiving state; if the maximum reception time of the set confirmation frame has not been accepted, the retransmission flag will be set; if the retransmission has not been accepted, the report of sending failure will be returned.

http://image.c114.net/20121008/97/12245796280724420777.jpg

Figure 5 Data packet sending flow chart. [page]

5 Hardware Circuit

The hardware circuit mainly includes two parts: CC2430 and RTL8019.

5.1 CC2430 Hardware

http://image.c114.net/20121008/94/11626031028504855746.jpg

Circuit Figure 6 CC2430 Hardware Circuit Diagram

. The CC2430 part is the wireless transceiver part of the ZigBee network, and uses a 32MHZ crystal oscillator to provide timing for the system. The circuit uses an unbalanced antenna, and connecting an unbalanced transformer can make the antenna reception performance better. The

unbalanced transformer is composed of capacitor C12 and inductor L2, which meets the requirement of RF input and output matching resistance of 50 ohms.

The I/O ports provided by CC2430 are used as 8-bit data bus, address bus and control bus respectively. The specific allocation is as follows: P0 port is used as 8-bit data port; the lower 5 bits of P1 port are used as address port; P2.0 and P2.3 are used as read and write selection signals respectively; P2.4 port is used as interrupt request signal line.

5.2 RTL8019 Hardware Circuit

RTL8019 is responsible for converting ZigBee data packets into TCP/IP data packets. A 20M crystal oscillator is used in the circuit to provide working timing. The local DMA interface connects the network card chip to the network cable and completes the data exchange between the controller and the network cable.

Working mode: The JP pin 65 of RTL8019 determines the working mode of the network card chip. Connecting a high level is the jumper working mode.

I/O port: The 81, 82, 84, and 85 pins of RTL8019 determine the I/O port address. All of them are left floating in the design, and the selected address is 0300H.

http://image.c114.net/20121008/62/14004220860020581738.jpg

Figure 7 RTL8019 hardware circuit diagram.

Network interface: Determined by the 74 and 77 pins of RTL8019, use automatic detection, the 64 pin is low level, and use the BNC interface.

Interrupt: Pins 78, 79, and 80 of RTL8019 determine the interrupt mode of the chip. In the design, all of them are left floating, and the selected interrupt is INT0.

6 Conclusion

The gateway has low power consumption, small size, and simple design, which can meet the requirements of small data volume. It builds a bridge between ZigBee short-range wireless communication and Ethernet long-distance data transmission, provides an Ethernet network platform for ZigBee sensor networks, and makes ZigBee more widely used in wireless sensor networks.
Keywords:ZigBee Reference address:Design of wireless gateway based on ZigBee and Ethernet

Previous article:Distributed temperature and humidity intelligent monitoring system based on Ethernet
Next article:Design of Public Transportation Information Platform System Based on ZigBee

Recommended ReadingLatest update time:2024-11-16 17:51

Wireless security system based on GSM and Zigbee technology
  introduction   At present, urban security systems are receiving more and more attention, and customers have higher and higher requirements on the functions and performance of security systems.   This paper proposes a wireless security system based on GSM and Zigbee technology. The characteristics of this system
[Microcontroller]
Wireless security system based on GSM and Zigbee technology
Design of water-saving irrigation system based on ZigBee technology
"Water conservation is everyone's responsibility", water resources are becoming a precious and scarce resource. Therefore, promoting water-saving irrigation has become an inevitable choice for countries around the world to alleviate the water crisis and achieve agricultural modernization. This paper proposes a desig
[Analog Electronics]
Design of water-saving irrigation system based on ZigBee technology
Wireless control system of street lamp based on PLC, GPRS and ZigBee
With the development of China's economic construction, the development and utilization of energy have become increasingly tense. Since March, many places in China have experienced "power shortages" in the off-season, and low efficiency in electricity utilization is one of the important reasons for the "power shortag
[Power Management]
Wireless control system of street lamp based on PLC, GPRS and ZigBee
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号