Design of remote control wireless gateway based on Android and ZigBee

Publisher:ikfnpoLatest update time:2014-01-18 Source: 21icKeywords:Android Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Introduction
    ZigBee technology is a short-range wireless communication technology based on the IEEE802.15.4 standard protocol. It has the characteristics of low power consumption, low cost, large capacity, high security, and strong anti-interference performance. It is widely used in industrial monitoring, sensor networks, home control, security systems and other fields. How to connect the ZigBee network with Ethernet and WiFi networks to realize real-time monitoring of small areas by portable devices (such as mobile phones, tablets, etc.)? This paper proposes a ZigBee wireless gateway design based on the Android system.

1 System Overview
   
The purpose of the intelligent monitoring system design is to enable users to remotely control terminal devices or monitor the environment through mobile phones or PCs. The gateway is the core of the system, which is mainly responsible for the management and processing of uplink information of each wireless terminal node, and downlink control of the operation of each wireless terminal node, and has the function of completing protocol conversion between different networks. The design of the gateway in this paper mainly completes the conversion function between ZigBee protocol and TCP/IP protocol, uses WiFi network to connect handheld devices to Ethernet, which is used to control home appliances, lights, etc., and completes the mutual communication between mobile phone and Ethernet information and ZigBee information. The location of the gateway in the intelligent monitoring system is shown in Figure 1.

a.jpg


    The gateway design adopts a modular solution, which consists of hardware layer, system layer and application layer, as shown in Figure 2. The hardware layer describes the hardware composition of the gateway; the system layer is the Android operating system transplanted by the gateway with SAM9M10 as the core processor; the application layer includes the gateway application, application protocol layer and application address adaptation layer.

b.jpg



2 System Hardware Design
   
The system hardware design adopts modular design concept. The main modules include SAM9M10 core processing module, ZigBee module, Ethernet module, LCD module, WiFi module, power module, etc.
     The SAM9M10 core processing module includes a 400 MHz microprocessor based on ARM926, supports 133 MHz double data rate DRAM (DDR2), and integrates high-speed (480 Mbps) USB host and device ports, on-chip transceiver, Ethernet MAC, two interfaces for MMC 4.3 and SDIO/SD Card 2.0, as well as CMOS camera, audio interface and LCD controller supporting resistive touch screen. The SAM9M10 core processing module is responsible for ZigBee data transmission and reception, Ethernet data transmission and reception, LCD data output, data storage, etc. The
    main chip of the ZigBee module adopts TI's second-generation system-on-chip CC2530. Compared with previous products, CC2530 has more excellent RF performance, programmable 256 KB flash memory, smaller package size and IR generation circuit. The ZigBee module is responsible for network communication with other wireless nodes in the ZigBee network. It uses USART or SPI to communicate with the main controller. This article chooses the SPI method.
    The Ethernet module uses the DM9161 chip from DAVICOM. DM9161 is a single-chip fast Ethernet PHY. DM9161 is connected to the MAC layer through a variable voltage MII or RMII standard digital interface. It supports HPAuto-MDIX and is a common physical layer transceiver.
    The WiFi module consists of an AP (Access Point) and a wireless network card. Its main features are: fast speed, high reliability, wide coverage in open areas, easy integration with existing wired Ethernet, and lower networking costs.
    The touch screen LCD module uses the AT102TN03 module from Taiwan Innolux Corporation. The display size is 10.2 inches, the display ratio is 16:9, the resolution is 800×480, it uses LED backlight, and the operating voltage is 5 V.
    The power module is powered by an external 5 V power supply, which is converted to 3.3 V by NS's chip LP38692, 1.0 V by LP2983AIM5-1.0, and 1.8 V by Anisem's chip AS1301EHT-ad. The system hardware structure is shown in Figure 3.

c.jpg



3 System Software Design
   
The wireless gateway software design is mainly introduced from three aspects: Android operating system transplantation, wireless gateway system protocol model and gateway application program. [page]

3.1 Android porting on SAM9M10
   
Atmel's SAM9M10ARM9 device based on the 32-bit ARM926 processor provides a complete board support package (BSP) for the SAM9M10-G45-EK board running the Android operating system. Atmel's Android port is based on version 2.1, supports camera interface, hardware video decoding, software decoding, web browsing, and can use Ethernet cable or WiFi SDIO dongle provided by H&D Wireless. Through the BSP of the SAM9M10-G45-EK board, Android can be easily ported to SAM9M10 and booted from Nand Flash.
    The porting work mainly consists of two parts: Linux driver and Android system hardware abstraction layer.
    The driver in Linux works in kernel space, and the Android system hardware abstraction layer works in user space. With the combination of these two parts, the huge Android system can run on a specific hardware platform. After having a specific hardware system, it is usually necessary to implement its driver in Linux, and these drivers are usually standard Linux drivers. The main implementation is the Hardware Abstract Layer in the Android system. The Hardware Abstract Layer calls the driver in Linux and provides an interface for other parts of the Android system (usually the Android local framework layer) to call. The main work of the transplant is shown in Figure 4.

d.jpg


3.2 Wireless Gateway System Protocol Model
3.2.1 ZigBee Protocol Stack
    The ZigBee protocol stack uses TI's ZStack, with the specific version number ZStaek-CC2530-2.5.0. It supports ZigBee 2007 (including ZigBee and ZigBee PRO) protocols. In this gateway software design, the ZigBee PRO protocol is used. ZigBee PRO inherits all the advantages of ZigBee technology and enhances the scalability, ease of use and security of wireless networks. The ZigBee protocol stack architecture is shown in Figure 5.

e.jpg


3.2.2 TCP/IP protocol stack
   
From the perspective of the protocol layering model, TCP/IP consists of four layers: link layer, network layer, transport layer, and application layer. Each layer calls the network provided by the layer below it to meet its own needs. In fact, the TCP/IP protocol can be connected to any network through the link layer, such as the IEEE S02 local area network. The TCP/IP protocol stack framework is shown in Figure 6.

f.jpg[page]

3.2.3 Gateway System Protocol Model
   
An application address adaptation layer and an application protocol layer are added on top of the ZigBee protocol stack and TCP/IP protocol stack of the gateway system layer. The role of the application address adaptation layer is to map the ZigBee address (MAC value or short address), Ethernet address (IP address) and application layer address, that is, to adapt different types of network addresses to the application address, so that the nodes belong to the same network at the application layer; the application protocol layer is based on the application address adaptation layer, by formulating a unified application protocol, standardizing the format of data exchange between nodes, thereby realizing the digital information exchange function between the ZigBee network and the IP network, that is, realizing the function of the ZigBee gateway.
    The ZigBee node in the wireless network receives the instruction to package the data, and then sends it to the local ARP after simple encapsulation. The network MAC address of the node is resolved through ARP to determine the Ethernet address to be sent; then it is sent to the gateway application, and after analysis, it is sent to the corresponding Ethernet UDP or TCP for processing, and then sent to the Ethernet port MAC address. In this way, the data conversion process from the ZigBee network to the Ethernet protocol is completed. The gateway system protocol model is shown in Figure 7.

g.jpg


3.3 Gateway Application
   
Gateway application mainly refers to the information data transmitted based on the specification of the gateway application protocol layer, which is organized and run in the form of Android tasks. In the data communication between Ethernet and ZigBee network, information is sent and received in the form of data packets. The data packet sending process is shown in Figure 8.
    In the wireless WiFi network, the PC connected to the wireless AP through Ethernet is the server, and the wireless gateway, as the Android client, establishes a network connection with the PC server through the TCP/IP protocol. Through Socket communication, data forwarding, transmission and reception can be completed on the basis of realizing the network connection between the server and the client.
    Therefore, the wireless gateway application should realize the following functions:
    ① Establish the Socket and network connection between the client (wireless gateway) and the server (PC) to provide the necessary conditions for data exchange between them.
    ② Read the data received from the ZigBee network by the wireless ZigBee module into the buffer, and then write it into the USB wireless network card. The USB wireless network card will package the data into the WiFi protocol format and send it to the wireless WiFi network.
    The implementation process of the Android client application is shown in Figure 9.

h.jpg



4 Implementation of lighting control function
    ZigBee divides applications into different domains, each with its own Profile. ZigBee Profile provides standard interfaces and device definitions for this application domain, so that ZigBee devices produced by different manufacturers for the same application field can communicate with each other. The Profile used by ZigBee in smart homes and home automation is the ZigBee Home Automation Public Application Profile. Through the introduction of this Profile and ZCL (ZigBee Cluster Library), the control of ZigBee lighting appliances is realized. For example, the gateway only needs to call the zelGeneral-SenclOnOff_CmdToggle() function to control the on/off of the lights. The hierarchical block diagram of the interface between the application, Profile, ZCL and other layers is shown in Figure 10.

i.jpg



Conclusion
   
This paper studies the wireless gateway based on Android system and ZigBee technology. The gateway is small in size and low in power consumption. It integrates ZigBee network, Ethernet and WiFi network into one, and builds a bridge between ZigBee short-range wireless communication and Ethernet remote control. It realizes the digital information interaction between wireless sensor network and wireless Internet, which can be widely used in
the Internet .

Keywords:Android Reference address:Design of remote control wireless gateway based on Android and ZigBee

Previous article:Development of automatic tobacco leaf baking experimental system
Next article:Design of DDS Signal Source in Quartz Crystal Test System

Recommended ReadingLatest update time:2024-11-16 22:27

Google lists 9 Android 12 flagship phones: hardware performance levels meet the highest requirements
      Google introduced a "performance level" concept in Android 12, which allows developers to query the hardware information of the device and divide the device into different performance levels. For devices with lower performance levels, developers can choose to turn off some functions or reduce some animations so
[Mobile phone portable]
Google lists 9 Android 12 flagship phones: hardware performance levels meet the highest requirements
Google announces partnership with Samsung to launch unified Quick Share nearby sharing app for Android
According to news on January 10, Google launched a large number of new features at CES today and announced that it would cooperate with Samsung to develop a new Quick Share, designed to replace the Google Nearby Share nearby sharing system launched in 2020. According to Google, the new version of Quick Share combine
[Mobile phone portable]
Google announces partnership with Samsung to launch unified Quick Share nearby sharing app for Android
Lenovo launches ThinkCentre M70a all-in-one PC: the PC closest to Android
According to news on October 9, Lenovo will manufacture an all-in-one computer equipped with Android system. Lenovo is currently working with Android operating system expert Esper to create the ThinkCentre M70a all-in-one computer. It is reported that ThinkCentre M70a is equipped with a 21.5-inch touch screen. The cur
[Home Electronics]
Intelligent Community Security System Based on ZigBee and GPRS
       This paper designs     a smart community security system that integrates property management, security and residential intelligent systems to achieve fast and efficient value-added services and management, and provide a safe and comfortable living environment.   From a functional perspective, due to the exp
[Security Electronics]
Intelligent Community Security System Based on ZigBee and GPRS
The first UWB-enabled Android phone is launched
NXP Semiconductors (NXP) announced that its secure ultra-wideband (UWB) precise positioning solution, embedded SIM (eSIM) and near-field communication (NFC) and secure element (eSE) units have been deployed in Samsung’s latest mobile phone, the Galaxy Note20 Ulta. NXP and Samsung are two founding members of the FiR
[Mobile phone portable]
The first UWB-enabled Android phone is launched
A landscape LED system design based on ZigBee sensors
1 System Structure The landscape lighting system is mainly composed of three parts: lighting units, scene controllers and monitoring hosts, as shown in Figure 1. The staff of the landscape lighting system detects, manages and controls the working status of each lighting unit in the entire landscape system t
[Power Management]
A landscape LED system design based on ZigBee sensors
Qualcomm is developing a handheld similar to the Switch: equipped with Android 12 and detachable handle
       According to reports from Android Police and XDA, Qualcomm is developing an Android-based handheld game console similar in design to the Nintendo Switch. The device will use Qualcomm chips and, if it is finally launched, could be available next year .   Android Police said it has seen pictures of the device, wh
[Mobile phone portable]
Design of smart home system based on ZigBee
Smart home is based on the house as a platform, using integrated wiring technology, network communication technology, security technology, automatic control technology, audio and video technology to integrate facilities related to home life, build an efficient management system for residential facilities and family
[Analog Electronics]
Design of smart home system based on 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号