With the rapid development of Internet of Things technology, the trend of integrating traditional Internet with new wireless sensor networks is becoming more and more obvious. The embedded service gateway is both a coordinator gateway of the wireless sensor network and a remote WEB server. It realizes the communication between two networks with different protocols. It is also a key device for connecting wireless sensor networks to the Internet and realizing the concept of Internet of Things. The Internet of Things service gateway will play a very important role in the future Internet of Things era. It will become a link between the Internet of Things perception layer network and the traditional communication network. The Internet of Things gateway can realize the protocol conversion between the perception network and the basic network and different types of perception networks, and can realize both wide area interconnection and local area interconnection. It also has the characteristics of wide perception network access, communication protocol conversion and powerful system management [1]. The service gateway designed with embedded system can effectively reduce costs and take advantage of the popularization of home intelligence.
1 System overall structure design
The overall structure of the system is shown in Figure 1. The remote mobile smart terminal or computer accesses the wireless sensor network through the Internet, and the embedded WEB server provides interactive page access. If the amount of accessed data is large or the data needs to be counted, analyzed, and processed, then a web server and a database server need to be established [2]. The smart home under the framework of the Internet of Things is a complex system that requires the cooperation of multiple people, such as the design of the Internet database server and the establishment of the perception layer network. This article focuses on the design of the service gateway, which is an integrated terminal consisting of three parts: embedded WEB, short-range terminal, and WSN coordinator. It is a bridge between two heterogeneous networks and plays an important role in connection [3].
Figure 1 System overall framework
2 System Hardware Design
The hardware of the smart home system in this design consists of three parts: service gateway, terminal node and routing node.
(1) Service Gateway
The hardware block diagram of the service gateway is shown in Figure 2. It consists of an ARM main controller, a Zigbee module, an Ethernet PHY, and a TFT- LCD touch screen .
It consists of 5 parts: touch screen, and minimum system module.
Figure 2 Service Gateway Hardware Box
The main controller uses the STM32F107 interconnected microcontroller based on the ARM (Cotex-M3) core. It has 64K SRAM,
256K FLASH, Ethernet MAC and other abundant memory and peripheral resources. Zigbee module is controlled by CC 2430 of TI company . It is the coordinator of WSN in the service gateway and realizes data communication with the main controller through USART. The Ethernet module adopts the physical layer chip DM9161A of Ethernet and is connected to the main controller through RMII. Its 50M clock is provided by MCO of ARM. The LCD touch screen is connected to ARM through I/O interface to realize human-computer dialogue.
(2) Terminal nodes and routing nodes
The sensor node is the most basic unit of the sensor network, which mainly consists of a radio frequency communication module and a sensor data acquisition module.
The hardware of the node is the same as that of the routing node, and the difference mainly lies in the software.
The hardware diagram of the terminal node is shown in Figure 3. According to the characteristics of CC 2430, it is a device that integrates Zigbee protocol stack, RF module and
The SOPC that integrates the MCU and enhanced 51 core can meet the task of processing the data collected by the digital or analog sensor modules and transmitting them in the WSN.
Figure 3: Terminal node hardware frame
3 System Software Design
The system software is divided into service gateway software running on ARM and WSN gateway software running on CC2430 module. Considering the complexity of the overall design of service gateway software and the hierarchical modular design concept, the system uses the embedded operating system uCOS-II as the management of system resources and tasks the system functions. The overall design block diagram of service gateway software is shown in Figure 4.
Figure 4 Overall design framework of service gateway
3.1 Service Gateway Software Hierarchy
The service gateway software hierarchy is divided into: underlying driver layer, system layer, and application layer.
(1) Bottom-layer driver
The underlying driver layer includes FWLib and BSP. FWLib is the driver support software launched by ST to support its ARM.
Provide system initialization functions, support for interrupts and operating systems, memory allocation, and drivers for all on-chip peripherals to facilitate software development. In addition, users should also develop a board support package (BSP) for the application. In this system, the content of the BSP is mainly the hardware drivers related to the application development board.
(2) System layer
The system layer includes the operating system and the middleware software LwIP. The operating system manages the hardware and software resources.
The operating system should be the center. In the process of operating system porting, the main task is to rewrite the parts related to the processor and compiler, provide support for application tasks upward, and connect the driver downward to implement hardware operations [4]. LwIP is a TCP/IP protocol stack for embedded systems. This program includes its basic functions: TCP, IP, UDP, IC MP. The operating system simulation layer of LwIP provides convenience for porting to the operating system because it includes the mechanism of communication between tasks: semaphores and message mailboxes.
(3) Application layer
This design divides all applications into 7 application tasks based on the principles of modularity and functional independence, which are:
Root tasks, key tasks and LCD display tasks related to input and output , TCP sending tasks and TCP timeout retransmission tasks related to embedded WEB, serial port data sending tasks and Zigbee control command tasks related to WSN coordinator.
3.2 Software Design Process
The software design process is divided into the service gateway root task software design process and the WSN gateway software design process.
(1) Service Gateway Root Task Software Design Process
In an operating system environment, each task is a relatively independent functional module that loops infinitely. Usually, there is a root task, which should
This is set as the core functional business of the system. As shown in Figure 5, the root task program flow chart, first the board-level initialization is the abstraction and encapsulation of the hardware, providing a more friendly interface for the application. Then create the remaining 6 application tasks, the creation format is similar to the creation of the start task. Finally, the program enters the WEB service main loop program. In order to allow other low-priority tasks to execute, the task suspension function must be called.
Figure 5 Root task flow
(2)WSN Gateway Software Design Process
WSN gateway is also called WSN coordinator. It is the overall control center of the entire sensor network and the convergence point of data collection.
The sensor nodes are distributed within its coverage area [5]. The software flow chart of the sensor network gateway is shown in Figure 6. The program starts to establish a Zigbee network. At this time, there are no other nodes in the network. Then the wireless monitoring program is entered to find out whether there is a signal requesting to join the network. If there is a new node signal application, it is added to the network according to the signal type and a network number is assigned. If it is not a new node, the validity of the data transmitted by the node is determined. If it is valid, it is received and sent to the ARM gateway, otherwise it is discarded.
Gateway software process
4 Conclusion
This paper systematically discusses the IoT service gateway, a key technology based on IoT applications [6-7], and combines it with home automation for application design. In terms of hardware, a low-cost gateway hardware based on an ARM processor is designed and implemented according to the embedded board-level hardware design process. In terms of software design, a top-down and layered design method is adopted. Combined with the gateway hardware, an application development platform is built using the embedded operating system uCOS-II and the protocol stack LwIP, providing a good software environment for the development of application software.
Previous article:Implementation method of incoming call number display based on ARM
Next article:Design of embedded system based on ARM processor
Recommended ReadingLatest update time:2024-11-16 11:48
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
- [Project Source Code] Reasons and methods for turning off the IP built-in driver in the NIOS development environment
- TMS320VC5509A cannot connect to the emulator problem search and summary
- Sharing experience - the legendary RF self-oscillation appears again
- DIY mini desktop clock using RTT Studio (Part 1) | Create a HelloWorld project based on the STM32 chip
- Share two children's poems, guess how old the author is
- Let’s talk about digital filtering algorithms. Reply to get points!
- GaN power amplifiers revolutionize radar design
- This is an equalizer. I bought it but never used it. I want to share it with you.
- Join the thread and have a chat: If I give you a motor board, what would you want to do?
- 【China Academy of Electronics Science】Recruitment of embedded/algorithm engineers