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.
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.
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:
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
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.
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
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.
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.
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
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Digilent Vivado library
- Computer Control Systems (Second Edition) (Liu Jianchang)
- Detailed explanation and engineering practice of unmanned monitoring technology (Xie Jianbin, Li Peiqin, Yan Wei, Liu Tong, Lin Chenglong, Hong Quanyi, Zhou Hongfei, Cui Yibing)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- What should I do if CCS5.5 is not installed properly?
- The relationship between LoraWAN, LPWAN and Lora
- [Perf-V Review] + Driver for dot matrix blocks under Hummingbird soft core
- Single lithium battery boost 12V1.5A, 18W
- DS90UB954+ DS90UB913 debugging problem help
- CAP function frequency measurement
- Why is the output filter capacitor of the WM8918 audio decoding DAC so large?
- DLP projection face changing mask
- Become a Xilinx FPGA Design Expert (Basics)
- A brief history of channel coding