Atmospheric temperature acquisition and recording system based on 51 single chip microcomputer

Publisher:tony520Latest update time:2011-11-12 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

The measurement of atmospheric temperature is of great significance. Generally, various thermometers are used for manual measurement and the measurement results are recorded regularly. This method is time-consuming and labor-intensive and very inconvenient. This paper proposes a very compact atmospheric temperature measurement and recording device, which can automatically measure the temperature in the range of -55℃~+125℃ and record the measurement results at the same time, with an accuracy of up to 0.0625℃.

2 System Principle

The system structure is shown in Figure 1. The system is mainly composed of AT89C2051 microcontroller and peripheral circuits. The basic idea is that the serial clock chip DS1306 provides the time reference, the temperature sensor DS18B20 measures the temperature, and the temperature data is stored in DS2433. The AT89C2051 microcontroller is responsible for the coordination and control of the entire system.

AT89C2051 is a low voltage, high performance CMOS 8-bit single-chip microcomputer, with 2k bytes of repeatedly erasable read-only Flash program memory and 128 bytes of random access data memory (RAM). The device is produced using ATMEL's high-density, non-volatile storage technology, compatible with the standard MCS-51 instruction system, built-in general 8-bit central processor and Flash storage unit, the powerful AT89C2051 single-chip microcomputer can provide cost-effective applications.

AT89C2051 is a powerful single-chip microcomputer, but it has only 20 pins, 15 bidirectional input/output (I/O) ports, of which P1 is a complete 8-bit bidirectional I/O port, two external interrupt ports, two 16-bit programmable timer counters, two full bidirectional serial communication ports, and an analog comparator amplifier. At the same time, the clock frequency of AT89C2051 can be zero, that is, it has a sleep power saving function that can be set by software. The system wake-up methods include RAM, timer/counter, serial port and external interrupt port. After the system wakes up, it will enter the continuous working state. In power saving mode, the on-chip RAM will be frozen, the clock will stop oscillating, and all functions will stop working until the system is reset by hardware.


System structure diagram
System structure diagram
Figure 1 System structure diagram.

DS18B20 is an integrated digital thermometer with a temperature measurement range of -55℃ ~ +125℃. It can achieve four different resolutions of 0.5℃, 0.25℃, 0.125℃, and 0.0625℃ through programming. Its biggest feature is that it can realize digital communication with the microcontroller through a data line.

The measured temperature data length is 2 bytes. The DS18B20 digital thermometer is a 1-wire, that is, a single bus device produced by DALLAS, which has the characteristics of simple circuit and small size. Therefore, it is very convenient to use it to form a temperature measurement system with simple circuits. Many such digital thermometers can be hung on one communication line.

Features of DS18B20:

(1) Only one port is required to achieve communication.

(2) Each device in DS18B20 has a unique serial number.

(3) In practical applications, temperature measurement can be achieved without any external components.

(4) The measurement temperature range is between -55℃ and +125℃.

(5) The resolution of the digital thermometer can be selected from 9 bits to 12 bits.

(6) There are internal upper and lower temperature limit alarm settings. [page]

DS2433 is a 1-Wire memory with a capacity of 4k-Bit and can store 256 temperature data. It uses EEPROM technology, so the stored data will not be lost even if the power is off. DS2433 has a factory-calibrated registration code, which includes: 48-bit unique serial code, 8-bit CRC check code and 8-bit family code (23h), and also has 4096-bit user-programmable EEPROM. The power required to read and write DS2433 is completely taken from the 1-Wire communication line. The memory is divided into 16 pages, each with 256 bits. The scratchpad is an additional page and can be used as a buffer when writing to the memory. The data is first written to a scratchpad, where it is verified. The copy scratchpad command is then used to transfer the data to the memory. This process ensures the integrity of the data when modifying the memory content. The PR-35 and SO IC packages provide a compact structure that allows the device to be installed and connected on a printed circuit board using standard mounting equipment.

Due to the unique characteristics of 1-Wire communication, that is, they all have a 64-bit registration code inside to provide a unique identification for each device, ensuring the absolute traceability of each device. When multiple 1-Wire devices are connected to the bus in parallel to form a local network, the registration code can be used as the node address of the device. Data is transmitted serially according to the 1-Wire protocol, requiring only one data line and one ground line. Therefore, DS2433 can be connected to the same data line as DS18B20, and they can be distinguished by their internal identification codes, which greatly saves data connection lines.

The biggest advantage of the whole system is that the devices used are very small, which has two advantages:

(1) The system is small in size and can be placed in a small space to measure the temperature of the space.

(2) The system has low power consumption and can be powered by batteries, so it can be placed in the field environment for temperature measurement. After the measurement, you only need to retrieve the memory and read the record through the computer interface.

3 Device Selection

3.1 Miniaturization

Compared with the AT89C52 microcontroller, the AT89C2051 has been greatly reduced in size because it has removed the P0 and P2 ports. The DS1306 is a serial clock chip, which saves a lot of I/O interfaces compared to the parallel mode.

The temperature sensor DS18B20 outputs digital quantities, which can be processed by the microcontroller without A/D conversion.

3.2 Scalability

The 1-Wire single bus is a proprietary technology of Dallas, a wholly-owned subsidiary of Maxim. Unlike most current standard serial data communication methods, such as SPI/I2C/MICROW IRE, it uses a single signal line to transmit both clock and data, and the data transmission is bidirectional. It has the characteristics of saving I/O port line resources, simple structure, low cost, and easy bus expansion and maintenance.

Therefore, according to actual needs, multiple temperature sensors and memories can be connected to the 1-Wire bus, which can measure multiple targets and record more data.

4 Communication Function

MAX232 is a chip compatible with RS232 standard launched by Texas Instruments (TI). Since the RS232 level of computer serial port is -10V ~ 10V, and the signal voltage of general single-chip microcomputer application system is TTL level 0V ~ 5V, MAX232 is used for level conversion. The device contains 2 drivers, 2 receivers and a voltage generator circuit to provide TIA/EIA-232-F level. The device complies with TIA/EIA-232-F standard. Each receiver converts TIA/EIA-232-F level into 5-V TTL/CMOS level. Each transmitter converts TTL/CMOS level into TIA/EIA-232-F level. MAX232 provides RS232 communication interface between single-chip microcomputer and PC. The host computer software can be written in Visual Basic 6.0 high-level language. VB6.0 provides a serial communication control. With this control, the PC can easily communicate with the microcontroller through the serial port. 5 Application Examples Figure 2 shows the software operation interface and data processing. The temperature change of a certain day is given by two methods: a list and a curve chart. In this way, the temperature change pattern of that day can be mastered. Temperature data processing interface diagram Figure 2 Temperature data processing interface diagram. 6 Conclusion From the perspective of measurement range, accuracy and measurement examples, this system can be used to measure and record a variety of ambient temperatures including atmospheric temperature. Future work plans: (1) Data storage: A single DS2433 can only store 256 temperature data. It can be replaced with a memory with a larger storage capacity or multiple DS2433s can be connected in parallel to record more data at one time and extend the measurement cycle; (2) Data reading: The current method of removing the memory for reading is still a bit cumbersome. A handheld wireless (such as RF, infrared, Bluetooth, etc.) receiving device can be designed to obtain the data from the memory. If measurements are being taken in the wild, data can be transmitted using mobile communication networks (such as the emerging 3G technology), saving researchers the hassle of traveling.








Temperature data processing interface diagram









Reference address:Atmospheric temperature acquisition and recording system based on 51 single chip microcomputer

Previous article:Design and implementation of Doppler blood flow meter system controlled by 51 single chip microcomputer
Next article:High-speed control scheme for large-screen LED display based on 51 single-chip microcomputer

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号