Design of wireless voting base station based on Zigbee technology

Publisher:技术掌门Latest update time:2018-04-02 Source: eefocusKeywords:Zigbee Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    This paper mainly introduces the design of a wireless voting base station based on Zigbee technology, with ARM7 chip AT91SAM7X256 as the core and μC/OS-II as the operating system. The base station is used to connect the Zigbee network and Ethernet. It realizes the functions of remote monitoring of wireless voting machines and simultaneous voting in multiple conference rooms. It mainly analyzes the software design of the base station, introduces how the base station establishes a wireless voting machine network, collects voting results of voting machines, and accepts remote monitoring access. And the structure of its hardware platform is described accordingly.

    

1 Introduction


    Voting machines are widely used in elections, meetings, teaching, and entertainment programs. The current wireless voting system uses a single wireless network to enable wireless terminal devices to communicate with the host computer. Due to the limited transmission distance and poor penetration of obstacles of wireless networks, remote monitoring and simultaneous voting in multiple conference rooms cannot be achieved. This paper uses the low power consumption of Zigbee technology and the free use of frequency bands and the long transmission distance and fast transmission rate of Ethernet to combine the two and design a wireless voting machine base station. The wireless voting machine remote monitoring and simultaneous voting in multiple conference rooms are realized.


    2 System Overview


    The entire wireless voting system consists of a monitoring center, a base station, and a voting machine, as shown in Figure 1. The base station serves as a hub for communication between the remote monitoring center and the wireless voting machine equipment, and also serves as a coordinator in the wireless voting machine network to maintain and manage the entire wireless network. The base station collects the voting status of each voting machine and accepts instructions and scheduled visits from the remote monitoring center.

Figure 1 Overall structure of wireless voting system

Figure 1 Overall structure of wireless voting system


    3 Hardware Design

    

    The hardware structure of the base station is shown in Figure 2, which consists of an ARM7 processor AT91SAM7X256, a wireless module, an Ethernet module, a storage module, a power module, and a display module.

Figure 2 Overall hardware structure

Figure 2 Overall hardware structure

    AT91SAM7X256 is the main control chip of the entire base station, produced by Atmel. It integrates an ARM7TDMI processor, 256KB Flash and 64KB SRAM on the chip, as well as peripheral devices such as USART, SPI, CAN  controller, Ethernet port, etc.

    The wireless module uses CC 2520 chip. CC2520 is the second generation transceiver chip based on Zigbee/IEEE802.15.4 protocol launched by TI. Rich hardware supports frame processing, data caching, data encryption, CCA and other operations. CC2520 communicates with AT91SAM7X256 through SPI interface. AT91SAM7X256 selects and enables CC2520 through /CSN pin and VREG_EN pin respectively, and GPIO4 pin provides AT91SAM7X256 with start signal of receiving data frame and end signal of sending data frame.

    The Ethernet module uses the DM9161 chip, which is a low-power, high-performance physical layer transceiver launched by Dav IC om that can realize all 10M/100M Ethernet physical functions.

    4 Software Design

Figure 3 Overall software structure

Figure 3 Overall software structure.

    The overall software structure diagram is shown in Figure 3. This base station uses the μC/OS-II operating system, and completes the porting of the LwIP protocol stack based on the TCP/IP protocol and the msstatePAN protocol stack based on the Zigbee protocol on this operating system, as well as the Ethernet network card driver, wireless transceiver chip driver, and application program writing work [3,4]. The driver and application program will be described in detail below.

    4.1 Ethernet network card driver

    The EMAC_INIT() function completes the initialization of EMAC, including the configuration of EMAC operation mode, MII interface and PHY, and the setting of send and receive buffer descriptors [5]. MII interface is an Ethernet industry standard defined by IEEE-802.3, which is used to connect FastEthernet MAC-b LOC k with various types of PHY [6]. It includes a data interface and a management interface between MAC and PHY. After the PHY is powered on, the DM9161 is first reset by software. After the software reset is completed, the EMAC and PHY are initialized and enabled. The EMAC and PHY interfaces are then enabled, and the auto-negotiation process is implemented. During the auto-negotiation process, the EMAC and PHY communicate via the MDIO interface, so that the two are configured to the same speed and duplex mode. Finally, the EMAC address is set and the initialization of the receive and send buffer identifiers is completed, so that each descriptor points to the correct buffer address and the descriptor head address is written into the queue pointer register. The data packet reading and data packet transmission of EMAC are completed by EMACReadPAC ke() and EMACSendPacket() functions respectively . In order to ensure the correct data packet reading position, the GetInputPacketLen() function must be called before reading the data packet to obtain the length of the data packet.

    4.2 Zigbee transceiver chip CC2520 driver

    It consists of an initialization module, a data transmission module and a data reception module. The initialization module is used to initialize and configure CC2520, including starting CC2520, setting the network channel number, transmission power, automatic CRC check, and configuring the GPIO4 pin to receive the SFD frame start signal.

    The transmitting module completes the task of sending data. The following program is the data sending process.

    First clear the send buffer, then write the data packet to be sent into the send buffer and enter the send state, then determine whether the data has been sent according to the GPIO4 pin signal. If not, continue to wait. If the data has been sent, clear the SFD flag, and finally put CC2520 into the idle state.

    The receiving module completes the task of receiving data. When the SFD signal of the GPIO4 pin of CC2520 is detected, an interrupt is generated and the receiving interrupt service routine is entered. The receiving interrupt service routine is similar to the sending routine and will not be listed here one by one.


    4.3 Application Layer

    Main implementation: 1. Establishment of Ethernet and Zigbee network. 2. Accepting access and various instructions from the remote monitoring center. 3. Maintaining and managing the entire Zigbee network. 4. Receive voting data frames from each voting device in the Zigbee network. The program flow chart is shown in Figure 4.

 

    First, establish an Ethernet network. After completing the connection with the host computer, the host computer sends a basic information frame to the base station to establish a wireless voting device network. The base station establishes a Zigbee network based on the frequency band, PAN number, transmission power and other parameters specified in the basic information frame. Each wireless voting device applies to join the network. After successfully joining, it will obtain a 16-bit dynamic network short address assigned by the base station (coordinator in the Zigbee network). At the same time, it prompts the user that the voting device communication is normal. Otherwise, it prompts that the communication failed.

    Within the set time limit, the base station counts the number of voting devices that successfully join the network and sends the statistical results to the host computer. All voting devices that apply to join the network are blocked until the base station receives the command from the host computer to update the network. If the total number of voting devices participating in this stage received by the host computer is greater than the set minimum number of people, the host computer sends a voting information frame to the base station. If the total number of voting devices participating in this stage is less than the set minimum number of people, the host computer sends a time limit instruction to the base station to extend the waiting time for the voting devices to join the network. If the time limit is exceeded again and the specified number of people is still not reached, it will prompt that the voting in this stage is invalid. The voting information frame includes the voting format and voting type of this stage. After receiving the voting information frame, the base station broadcasts it to the entire Zigbee network, and the voting begins. Each voting device in the Zigbee network will prompt the user to perform the corresponding voting operation based on the received voting information frame. After the user completes the voting operation, the voting device sends the voting data frame to the base station, which stores the voting data frame in the Zigbee_BUF data buffer and sends a reply frame to the voting device to indicate the successful transmission to the user. Then the network short address of the voting device is reclaimed to make it leave the network to prevent the user from voting twice.

Figure 4 Application.

Figure 4 Application.

    The host computer periodically accesses the base station. After receiving the access request, the base station transmits the data buffer content to the host computer. After receiving the information confirmation frame, the host computer returns the information confirmation frame. After receiving the information confirmation frame from the host computer, the base station clears the data buffer content. Within the specified voting time limit, the base station reclaims all network short addresses, so that all voting devices that have joined the network this time are disconnected, and users are stopped from voting.

    After completing the voting process of this stage, when entering the new voting stage, the host computer sends a network update command to the base station. At this time, the base station allows the voting device to join the network again, and a new round of voting begins.

    4.4 Result

    The base station has completed the joint debugging work and successfully realized all the functions introduced in this article. Figure 5 shows the data transmission when the spectrum analyzer monitors the communication between the base station and the wireless voting device.

Figure 5 Remote monitoring center host computer monitoring software

Figure 5: Monitoring software of the host computer of the remote monitoring center.

    5 Conclusion

    The base station designed in this paper realizes the connection between Ethernet and Zigbee network, and provides some ideas for realizing remote monitoring of Zigbee network. The base station has been put into the market and achieved good economic benefits. How to improve the performance of the base station in terms of power consumption and transmission speed and design a base station that can be interconnected with multiple existing protocols is the focus of our future research.


Keywords:Zigbee Reference address:Design of wireless voting base station based on Zigbee technology

Previous article:High-performance, low-power LPC2000 series microcontrollers based on ARM7 meet embedded needs
Next article:Design of electronic fuse for detonator based on STM32 microcontroller

Recommended ReadingLatest update time:2024-11-16 16:18

All in! A complete explanation of Silicon Labs' IoT plan
On July 26, 2021, Silicon Labs officially completed the sale of its infrastructure and automotive businesses to Skyworks for $2.75 billion. It is puzzling why Silicon Labs would choose to sell this business when the automotive market is booming, especially Silicon Labs' well-known isolation technology, which can be wi
[Internet of Things]
All in! A complete explanation of Silicon Labs' IoT plan
Design and implementation of remote monitoring system based on ZigBee and ARM
摘要:针对有线组网方式布线复杂、维护困难的问题,提出了一种基于ZigBee无线组网技术和嵌入式Web服务器,对家庭环境进行远程监控的实现方法。采用溫湿度传感器DHT11实现温湿度的采集,烟雾传感器MQ2监测厨房烟雾浓度是否超标,人体红外感应模块实现家庭安防。并且通过红外技术控制空调和加湿器或热水器的打开或关闭,从而实现对溫度和湿度的调节,对热水器的远程控制。实验结果表明,该系统体积小、功耗低、运行稳定,具有一定的实际意义。 In the hot summer, I turn on the air conditioner after getting home from get off work, but it is still
[Microcontroller]
Design and implementation of remote monitoring system based on ZigBee and ARM
Embedded System Based on Dual-core OMAP5910 and Its Application
      Introduction   With the concept of Internet of Things and the development of related technologies, networked measurement and control has become an inevitable trend in the development of measurement and control systems. However, the PLC (Programable Logic Controller) currently widely used in the field of industri
[Microcontroller]
Embedded System Based on Dual-core OMAP5910 and Its Application
Design of automotive test system based on Zigbee wireless network of C8051F
Automobile testing is an important means to discover various problems in automobile design and development. Based on the test results, an objective evaluation of various automobile performances can be made. As one of the basic projects of the automobile industry, automobile testing has played an important role in th
[Microcontroller]
Design of automotive test system based on Zigbee wireless network of C8051F
2.4G wireless applications in industry and medical fields
With the continuous development of society, the advantages of wireless have gradually emerged. For example, wireless communication has a large coverage area and is almost not restricted by the geographical environment; wireless communication can be set up at any time, links can be added at any time, and installati
[Medical Electronics]
2.4G wireless applications in industry and medical fields
Design of a greenhouse monitoring system gateway based on ZigBee
Introduction     The greenhouse monitoring system is used to monitor indoor temperature, humidity, CO2 concentration and other environmental parameters in real time, so as to make corresponding adjustments so that crops can grow in the best environment. Most of the existing wireless greenhouse monitoring systems monit
[Microcontroller]
Design of a greenhouse monitoring system gateway 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号