Development of a handheld calibrator based on ZigBee and S3C2440

Publisher:脑洞飞翔Latest update time:2012-09-12 Source: 21IC Keywords:ZigBee  S3C2440  calibrator Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction

The automatic weather station consists of meteorological sensors such as air pressure, temperature, humidity, wind direction and speed, rainfall, radiation, etc., as well as data acquisition, processing, and management systems. The automatic weather station has long-term stability issues, and meteorological sensors need to be calibrated regularly to ensure accurate observation data.

Meteorological observation data cannot be interrupted, so it cannot be disassembled and sent to the calibration room for inspection like ordinary measuring instruments. A better method is to use a standard instrument to compare and calibrate directly at the observation site. Therefore, a handheld calibrator is designed, which uses a wireless sensor network to read the observation data of the automatic weather station and the indication of the standard instrument, and calibrate it.

1 System Design and Implementation Principles

This design uses wireless sensor networks, Windows CE operating system, and ARM processor to develop a handheld calibrator for calibrating meteorological element sensors. During calibration, the data of the sensor under test is sent to the coordinator through the wireless sensor network using ZigBee technology, and the coordinator transmits the data to the handheld calibrator. The calibrator calculates the error. If the existing error is greater than the preset error of the corresponding element, it will automatically generate a calibration command and send the calibration value to the sensor until the error is eliminated. The working principle of the entire system is shown in Figure 1 [1].

Figure 1 System working principle

Figure 1 System working principle

2 System Hardware Design

The hardware functional block diagram of the calibrator is shown in Figure 2. The hardware mainly consists of a data acquisition module based on CC2530 and a hardware platform module with an ARM9 core.

Figure 2 Hardware block diagram of the handheld calibrator

Figure 2 Hardware block diagram of the handheld calibrator

The data acquisition module is mainly composed of CC2530 chip, sensors and peripheral components. It also has the functions of operating system transplantation and data calibration on the hardware platform [2].

2.1 Data acquisition module design

The data acquisition module utilizes the ZigBee wireless sensor network, which is mainly composed of the ZigBee network coordinator node and the ZigBee sensor terminal node. This system uses TI's CC2530 as the wireless sensor network node [3]. CC2530 is a true system-on-chip solution for 2.4GHz IEEE 802.15.4, ZigBee and RF4CE applications. It can build powerful network nodes with very low total material cost.

CC2530 has extremely high receiving sensitivity and anti-interference performance, and only needs a few peripheral components to realize the signal receiving and sending functions[4].

2.2 Hardware Platform Design

This system uses the 32-bit ARM920T RISC processor Samsung S3C2440A, with a main frequency of 400MHz. It uses a 3.5-inch touch true color LCD screen with a resolution of 320×240. The SDRAM uses H57V2562GTR, which has 32 MB of storage space, and the NANDFLASH uses Samsung's K9F2G08ROA. The network coordinator node uses CC2530, which has a low cost and only needs a few peripheral components to work. The connection diagram of S3C2440, CC2530, NAND FLASH, and SDRAM is shown in Figure 3. The hardware system is simple in structure, small in size, fast in computing speed, and can be installed with operating systems such as Windows CE and Linux [5].

Figure 3 System connection diagram

Figure 3 System connection diagram

3 Software Design

The calibrator enters the corresponding calibration interface according to the meteorological elements to be calibrated and automatically receives and processes data. If the detection error is greater than the preset error, after confirming the calibration password, it automatically generates a calibration command and sends it wirelessly to the corresponding meteorological sensor.

The system is installed with Windows CE 5.0 operating system. Windows CE is the foundation of Microsoft's embedded and mobile computing platform. It is an open, upgradeable 32-bit embedded operating system with good reliability, high real-time performance, small kernel size, scalability, and powerful communication capabilities. It is widely used in the development of embedded intelligent devices [6]. The calibrator system software consists of two parts: one is serial port communication, which is mainly used for real-time data transmission between the coordinator and the handheld calibrator, and the other is user interface software design and function implementation. Both are written in embedded C# language and use VS 2005's form interface for visual software development. Figure 4 is the system software flow chart.

3.1 Porting of embedded operating system Windows CE.NET

After the hardware system is completed, the operating system needs to be ported to the hardware platform and the application needs to be developed. Platform Builder is an integrated development environment (IDE) provided for building customized embedded platforms based on the WindowsCE.NET operating system. It provides design, creation, compilation, testing and debugging functions, as well as platform development wizards and BSP development wizards, basic configuration, emulators, Windows CE Test Kit, etc. The specific steps of porting are as follows:

Figure 4 is a flowchart of the system software

Figure 4 System flow chart[page]

(1) Tailor the operating system, configure each component and modify related configuration files; (2) Develop the driver on the target device and create a customized CE operating system image file; (3) Download the target file to the target device for debugging; (4) After customizing the operating system kernel, export the platform SDK for developing upper-level application software in Visual Studio 2005 [7].

3.2 Development Environment Construction

For Windows CE 5.0 operating system, Visual Studio 2005 based on .NET 2.0 framework is selected for development. This article accesses .NET Compact FrameWork class library to perform graphical window programming, and selects the intelligent device Windows CE 5.0 device application template for development in the development environment.

3.3 Interface Design

In the system interface design, it is mainly divided into the main interface and the calibration interface of each meteorological element. The main interface is mainly used for the selection of meteorological elements. It uses the Menuitem control to create menus. It also provides functions such as editing and tools. In the calibration interface, several controls such as SerialPort, ComboBox, TextBox and Button are mainly used. The Serial-Port control is used to set the serial port and send and receive data; the ComboBox control is used to select nodes and calibration points; the TextBox control is used to store data; and the Button control is used to perform some command operations[8].

3.4 Calibration function design

Enter the calibration page of each meteorological element, first select the node and calibration point, then set the serial port number and baud rate, and open the serial port to automatically receive data. In the serial port application, the text box in the sending area is TxSend, and the text box in the receiving area is named Txrec. Add a SerialPort control in the project, named Port, and the send button is named Send. The following is part of the receiving and sending code [9].

The processing function of the DataReceived event in the Port control is:

Void port_DataReceived (object send,SerialDataReceivedEventArgs){int bytesToRead=port.BytesToRead;byte[]arr=new byte[bytesToRead];port.Read(arr,0,bytesToRead);string str=Encoding,Default,GetString(arr,0 ,bytes-ToRead);txrec.Text+=str;}

The processing function corresponding to the send button click event is:

Void Send_Click(object send,EventArgs e){Byte[]arr=Encoding.Default.GetBytes(txSend.txt);Port.Write(arr,0,arr.Length);}

The coordinator receives the data sent by the meteorological sensor nodes in the sensor network and sends it to the ARM processor through the serial port. The data adopts the data communication format of nine-byte hexadecimal numbers, as shown in Figure 5.

The first byte is the data identifier; the second byte indicates the type of meteorological element, 01 is air pressure, 02 is temperature, 03 is humidity, etc.; the next four consecutive bytes are the sensor data, followed by two check bits; the last byte is the terminator.

Figure 5 Coordinator serial port transmission format

Figure 5 Coordinator serial port transmission format

When the coordinator sends a frame of data, the system parses the received data and converts it into a floating point number and displays it in the receiving sensor data area. If the identifier is "D", it indicates the data sent by the sensor. If it is "S", it indicates the data sent by the standard. The sensor data is compared and analyzed with the data of the standard. If the error is greater than the specified threshold, the error data is sent to the sensor through a calibration command. The operating interface of the temperature calibration is shown in Figure 6. The purpose of using the second serial port is to ensure that when the standard is not connected to the wireless sensor network interface, data communication is directly achieved through the serial port. The average value of 5 consecutive temperature detections is used for calibration to ensure calibration accuracy [10].

Figure 6: Real-time operation interface of the software during temperature calibration

Figure 6: Real-time operation interface of the software during temperature calibration

3.5 Software Deployment and Migration

After the program is written, perform debugging, target device, transmission protocol and other related settings in the VS 2005 development environment, then connect VS 2005 to the hardware device platform for a handshake, and use the ActiveSync tool provided by Microsoft to deploy the program to the handheld calibrator, and it can run in real time on the target device.

In order to fix the above compiled application into the device so that it can run automatically every time it is turned on, the following steps are taken:

(1) Copy the application Regulation.exe to the FILES directory under the PlatformBuilder 5.0 installation directory.

(2) Create a shortcut file named Regulation.lnk and put it in the FILES directory.

(3) Open the Platform.bib file and add the following content:

Regulation.exe$(_FLATRELEASEDIR)Regulation.exeNK U;Regulation.lnk $(_FLATRELEASEDIR)Regulation.lnkNK U In this way, these two files will be added to the kernel when SYSGEN is executed, and finally they will exist in the system's Windows directory.

(4) Open Platform.dat and add the following content:

Directory("windows desktop"):-File("calibrator.lnk","windowsRegulation.lnk")This will create a shortcut named "calibrator" on the desktop.

(5) Finally, execute the menu Builder → Sysgen to generate NK.bin and NK.nb0. Burn or download them to the ARM system and start it. You will see the "Calibrator" shortcut on the desktop.

4 Conclusion

Through the circuit design and software programming of the system, the design of the handheld calibrator was completed. The handheld calibrator can conveniently perform real-time calibration of meteorological elements such as temperature, humidity, and air pressure at the site of the wireless sensor network automatic weather station. It is easy to use and low cost. Through improvement and perfection, the system can be applied to the calibration of the actual Internet of Things automatic weather station.

Keywords:ZigBee  S3C2440  calibrator Reference address:Development of a handheld calibrator based on ZigBee and S3C2440

Previous article:Introduction to Audio Analyzer Measurement Issues
Next article:Analysis of the Differences between EMC Receivers and Spectrum Analyzers

Recommended ReadingLatest update time:2024-11-16 23:53

Memory Management of S3C2440
I didn't know that each bank of S3C2440 needs to set the bit width before using it, and I didn't know why. Today I understand. Before using the bank, how many bits should be set for each peripheral connected to the bank? It is set by the BWSCON register, and the default is 8 bits. Since bank0 is the boot area, there is
[Microcontroller]
S3C2440 code relocation analysis
1. NAND boot Here, the NAND size is 256M. When booting from NAND, address 0 is the on-chip SRAM, and NOR is invisible. Since NAND does not support XIP, the hardware automatically copies the first 4K content of NAND to the 4K SRAM on the chip during booting. If the bin file is smaller than 4K, it can be run directly on
[Microcontroller]
S3C2440 bare metal --- Nor Flash principle and hardware operation
1. The difference between nandflash and norflash Our nandflash has only 8 data lines, which transmit both commands and data. However, our norflash has the same interface as memory, with address lines and data lines. Norflash can be read like memory, but cannot be written like memory. If norflash can also be written li
[Microcontroller]
S3C2440 bare metal --- Nor Flash principle and hardware operation
S3C2440 RTC real-time clock driver analysis and use (30)
RTC driver analysis summary: driversrtcrtc-s3c.c   s3c_rtc_init platform_driver_register s3c_rtc_probe rtc_device_register("s3c", &pdev- dev, &s3c_rtcops, THIS_MODULE) rtc_dev_prepare cdev_init(&rtc- char_dev, &rtc_dev_fops);   rtc_dev_add_device   cdev_add The rtc driver in linux is located under drivers/rt
[Microcontroller]
S3C2440 RTC real-time clock driver analysis and use (30)
Analysis and Design of WinCE Bootloader Based on S3C2440
The development of Bootloader is an indispensable part of embedded system development. A good Bootloader can not only bring great convenience to the subsequent development of the project, but also provide a lot of convenience for users to use the product after the project development is completed. However, since the
[Microcontroller]
Analysis and Design of WinCE Bootloader Based on S3C2440
Design of SMT plant temperature and humidity monitoring system based on ZigBee wireless sensor network
    Surface Mount Technology (SMT) is a circuit assembly technology that installs chip-type assembly components on the surface of printed circuit boards and assembles them by soldering and other methods such as reflow soldering. It is currently the most popular technology and process in the electronic assembly industry
[Microcontroller]
Design of SMT plant temperature and humidity monitoring system based on ZigBee wireless sensor network
S3C2440 Interrupt Register
S3C2440 interrupt register:  1. Interrupts are divided into two categories: internal interrupts and external interrupts.  2. External interrupts. 24 external interrupts occupy GPF0-GPF7 (EINT0-EINT7), GPG0-GPG15 (EINT8-EINT23). If you use these pins as interrupt inputs, you must configure the pins as interrupts and do
[Microcontroller]
Design of support structure safety monitoring system based on ZigBee and GPRS
As a common method in road and bridge construction, the support method has been widely used due to its mature and convenient construction technology, low cost and long service life. As the carrier of road and bridge structure construction, the support structure not only bears the load of reinforced concrete and variou
[Microcontroller]
Design of support structure safety monitoring system based on ZigBee and GPRS
Latest Test Measurement Articles
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号