Design of wireless temperature measurement system based on C8051F020 and Atmegal6

Publisher:开国古泉Latest update time:2011-08-26 Keywords:C8051F020  Atmegal6 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This paper develops a wireless temperature measurement system. The system uses K-type thermocouples as temperature sensing elements, with a wide temperature measurement range, and is suitable for high-temperature fields such as wave soldering and reflow soldering. In addition, the system has an independent temperature compensation circuit, which solves the problem of slow temperature acquisition speed of some integrated temperature compensation chips and improves the sensitivity of temperature measurement. Since the system is wirelessly transceived and uses CCl000 as a wireless communication chip, the host computer can receive data and monitor in real time at a certain distance. In addition, the system also has the function of real-time data recording, and can save the data when there is an obstacle in wireless communication, and then read it out by the host computer software after the temperature acquisition is completed.

1 System Hardware Design

This system uses the SOC chip C8051F020 as the main control chip. This single-chip microcomputer uses a 25MIPS 8051 CPU pipeline instruction structure, with 64 KB Flash program memory on the chip, 256 KB+4 KB on-chip RAM and two external RAM expansion interfaces, 5 16-bit timers and JTAG non-intrusive in-system debugging. As a system on a chip, C8051F020 has rich and powerful peripherals. Its AD converter has 12 bits, which can effectively improve the input acquisition accuracy of thermocouples. Welcome to reprint, this article comes from Electronics Fans Network ( http://www.elecfans.com )

In addition, the purpose of using Atmegal6 is to improve the acquisition speed of the system, thereby improving the sensitivity of temperature measurement. Short-distance wireless communication is completed through CCl000. The FLASH chip can store temperature data for reading when wireless communication fails. After conversion by CP2102, C8051F020 can communicate with the host computer through the USB port. The hardware structure block diagram of this system is shown in Figure 1.


1.1 System control module centered on C8051F020

This module includes C805lF020 control module, FLASH storage module, and CP2102 communication module. When the system is in the sending state, C805lF020 is used to collect the input analog signal of the thermocouple, and convert the collected signal into a digital signal through a 12-bit AD converter. Then C805lF020 looks up the data in a table, converts it into temperature data, processes and packages the data. Finally, the data is written into the FLASH chip and sent to Atmegal6 through the serial port.

When the system is in the waiting state, it will communicate with the host computer through the IJSB interface. CP2102 can complete the conversion between the serial port and the USB interface. If the system receives a command from the host computer to read data, C805lF020 will read the data from the FLASH chip, then send it out through the serial port, and then enter the host computer through the USB interface through CP2102.

1.2 Wireless transmission module centered on CCl000

The wireless transmission module includes CCl000, Atmegal6 and antenna. CCl000 is an ideal ultra-high frequency single-chip transceiver communication chip manufactured under 0.35μm CMOS process based on Chipcon's SmartRF technology. The operating frequency band of CCl000 is 315, 433, 868 and 915 MHz. And it is easy to program it to work in the range of 300~1000 MHz. AVR microcontroller Atmegal6 can be used to complete the initialization of CCl000 and communicate with CCl000, and also maintain communication with the main control chip C805lF020. When the system is in the sending state, Atmegal6 receives the data packet sent by C8051F020 and sends it out through CC1000.

1.3 Temperature acquisition module based on thermocouple

This module includes a voltage temperature sensor TMP35 and a K-type thermocouple. The working principle of the thermocouple is to generate a potential difference based on the temperature difference between the hot end and the cold end. Since the temperature of the cold end is often not 0°C during actual measurement, the thermocouple must be temperature compensated. The thermocouple temperature compensation formula is as follows:

E(t, 0) = E(t, t0) + E(t0, 0)

Among them, E(t0,0) is the actual measured electromotive force, t represents the hot end temperature, t0 represents the cold end temperature, and 0 represents 0°C. In the field temperature measurement, since the cold end temperature of the thermocouple is generally not 0°C, but varies within a certain range, the measured thermoelectric potential is E(t, t0). If you want to measure the thermoelectric potential E(t, 0) corresponding to the actual measured temperature, you must compensate for the compensation potential E(t0, 0) required for the cold end not being 0°C. Moreover, the characteristics of the compensation potential changing with the cold end temperature must be consistent with the thermoelectric characteristics of the thermocouple, so as to obtain the best compensation effect.

Figure 2 shows a schematic diagram of a temperature compensation circuit. In the figure, the temperature sensor TMP35 performs the temperature compensation work very well. The voltage output by TMP35 is first divided by resistors and then amplified by an amplifier, which is E(t0, O) corresponding to the K-type thermocouple.

Schematic diagram of temperature compensation circuit www.elecfans.com

2 System Software Design

The software design of the transmitter board mainly includes the main control module program based on C8051F020 and the wireless transmitter module program centered on Atmegal6. The main control program module mainly completes temperature acquisition, data processing, sending data to the wireless transmitter module, saving test temperature data, and communicating with the host computer. The wireless transmitter program module is mainly responsible for initializing CC1000, receiving data packets from C805lF020 in the waiting state, and sending them through CC1000.

2.1 Main control module program design

The main function of the main control module program is to sample the input analog signal of the thermocouple, and then look up the table to convert the table data into temperature data and package it. When the sending flag is allowed, it is written into FLASH for storage and sent to Atmegal6 through the serial port. The system software module flow chart is shown in Figure 3.

System software module flow chart www.elecfans.com

After power-on reset, the system should first initialize the functional modules of C8051F020, including serial port 0, serial port 1, AD converter, counters TO, T1, T2 and interrupt program. The system samples the input signal once every 50 ms through a 12-bit AD converter, and converts the sampled signal into temperature data by looking up the table. Then add the frame header, frame footer and check bit to the data. Finally, several frames of data are packed into a data packet.

When the send flag is enabled, C805lF020 writes the data packet into the FLASH chip AT45DB041D every 50 ms and sends the data packet to Atmegal6 through the serial port.

2.2 Wireless Transmitter Module Program Design

The main function of the wireless transmission program is to initialize CCl000 through Atmegal6, receive data from C805lF020, and send it out by CCl000. The flow of the wireless transmission program is shown in Figure 3 (b).

When designing the program of the wireless transmitter module, the port initialization, TO and T1 initialization, serial port initialization and interrupt program should be completed through Atmegal6 first, and CC1000 initialization programming should be performed. Then, Atmegal6 enters the loop waiting. When it is confirmed that the data is received, it is confirmed that the data is valid, and then CC1000 is woken up and the data packet is sent out.

3 System Performance Analysis

The characteristic of this temperature measurement system is that it uses dual CPUs and independent temperature compensation circuits, which effectively improves the speed of temperature acquisition and thus improves the sensitivity of measuring temperature changes. Actual tests show that the measurement accuracy of this system is 0.5% and the temperature acquisition speed is 50 ms.

The independent temperature compensation circuit used in this system uses the voltage temperature sensor TMP35 as the temperature compensation element. After the input electromotive force of the thermocouple is temperature compensated, it is further amplified by the precision rail-to-rail operational amplifier OP747 and then input to the AD converter of C8051F020. This can avoid the speed limitation problem caused by the use of some integrated thermocouple temperature compensation chips.

This system uses C8051F020 as a new generation of SOC chip, which has rich and powerful peripherals. It has 2 AD converters, of which ADO has 12-bit accuracy, so it can effectively ensure the accurate collection of temperature signals.

The dual CPU structure C805lF020 and Atmega16 can ensure the system acquisition time of 50 ms. Because wireless transmission and FLASH writing often take up most of the time, the dual CPU can separate the two, which effectively ensures the speed and stability of the system.

The FLASH chip AT45DB041D can write data into FLASH in real time during temperature acquisition, so that data can be effectively saved when wireless transmission is blocked. The data saved by the test system can be read by the host computer through the USB interface.

4 Conclusion

Compared with the current mainstream wireless temperature measurement systems at home and abroad, this system has achieved a higher level of temperature measurement accuracy. In terms of temperature acquisition speed, due to the use of an independent temperature compensation circuit and a dual CPU system structure, the sensitivity of temperature measurement and system stability are effectively improved. In addition, due to the use of FLASH chips, real-time data can be saved, which also improves the reliability and practicality of the system.

Keywords:C8051F020  Atmegal6 Reference address:Design of wireless temperature measurement system based on C8051F020 and Atmegal6

Previous article:LED digital tube display circuit based on AT89C2051 serial port
Next article:The principle of XXTEA encryption algorithm and its implementation in C language

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

Temperature and humidity control system based on Bang-Bang control
  In some warehousing management, manufacturing, meteorological observation, scientific research and daily life, the requirements for temperature and humidity are common. For example, the "Interim Provisions on Technical Management of Archives Warehouses" clearly states that the temperature of archive warehouses (incl
[Microcontroller]
Temperature and humidity control system based on Bang-Bang control
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号