Based on Zigbee technology, wireless voting machine remote monitoring and voting functions are realized

Publisher:EnchantedDreamsLatest update time:2020-08-19 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Based on Zigbee technology, wireless voting machine remote monitoring and voting functions are realized

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.

Based on Zigbee technology, wireless voting machine remote monitoring and voting functions are realized

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 peripherals such as USART, SPI, CAN controller, Ethernet port, etc.


The wireless module uses CC2520 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 Davicom that can realize all 10M/100M Ethernet physical functions.


4 Software Design

Based on Zigbee technology, wireless voting machine remote monitoring and voting functions are realized

Figure 3 Overall software structure.


The overall software structure 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-block 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 . EMAC's data packet reading and data packet transmission are completed by EMACReadPacke() 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.

Based on Zigbee technology, wireless voting machine remote monitoring and voting functions are realized

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.

Based on Zigbee technology, wireless voting machine remote monitoring and voting functions are realized

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.

[1] [1]
Reference address:Based on Zigbee technology, wireless voting machine remote monitoring and voting functions are realized

Previous article:Design of remote control system for ARM controller and home intelligence using ZigBee technology
Next article:Design of intelligent trip device data acquisition system based on ARM microcontroller

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号