Atmospheric temperature acquisition and recording system designed using AT89C2051 microcontroller for system coordination and control

Publisher:GoldenSerenityLatest update time:2023-09-14 Source: elecfansKeywords:AT89C2051 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, labor-intensive, and very inconvenient. This article proposes a very compact atmospheric temperature measurement and recording device, which can automatically measure the temperature in the range of - 55 ℃ ~ + 125 ℃ at regular intervals 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 performs temperature measurement, and the temperature data is stored in DS2433. AT89C2051 microcontroller is responsible for the coordination and control of the entire system.


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


AT89C2051 is a powerful microcontroller, but it only has 20 pins and 15 bidirectional input/output (I/O) ports, of which P1 is a complete 8-bit bidirectional I/O port, two external interrupt ports, and two A 16-bit programmable timing counter, two full bidirectional serial communication ports, and an analog comparison 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's 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 before it can continue to run.

Atmospheric temperature acquisition and recording system designed using AT89C2051 microcontroller for system coordination and control

Figure 1 System structure diagram.

DS18B20 is an integrated digital thermometer with a temperature measurement range of - 55°C ~ + 125°C. It can achieve four different resolutions of 0. 5°C, 0. 25°C, 0. 125°C, and 0. 0625°C through programming. Its biggest feature is that digital communication with the microcontroller can be achieved through a data line.


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


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 measuring temperature range is between - 55 ℃ and + 125 ℃.

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

(6) There are upper and lower temperature limit alarm settings inside.


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


Due to the unique characteristics of 1-Wire communication, that is, they have an internal 64-bit registration code to provide a guaranteed unique identification for each device, ensuring absolute traceability of each device, when there are multiple 1-Wire When 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 and DS18B20 can be connected to the same data line and distinguished by their internal identification codes, which greatly saves data connection lines.


The biggest advantage of the entire 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 and 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 wild environment for temperature measurement. After the measurement is completed, just retrieve the memory and read the records through the computer interface.

3 Device selection

3. 1 Miniaturization

Compared with the AT89C52 microcontroller, the AT89C2051 has greatly reduced its size because the P0 and P2 ports have been removed. DS1306 is a clock chip with serial working mode, which saves a large number of I/O interfaces compared with parallel mode.

The output of the temperature sensor DS18B20 is a digital quantity, which can be processed by the microcontroller without A/D conversion.

3.2 Scalability

The 1-Wire single bus is a proprietary technology of Max im's wholly-owned subsidiary Dallas. Different from most current standard serial data communication methods, such as SPI/I2C/MICROW IRE, it uses a single signal line to transmit The clock also transmits 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 to measure multiple targets and record more data.

4 communication function

MAX232 is a chip launched by Texas Instruments (TI) that is compatible with the RS232 standard. Since the computer serial port RS232 level is - 10V ~ 10V, and the signal voltage of the general microcontroller application system is TTL level 0V ~ 5V, MAX232 is used for level conversion. This device contains 2 drivers and 2 receivers and a voltage generator circuit providing TIA/E IA-232-F levels.


The device complies with the T IA /E IA - 232-F standard and each receiver converts the T IA /E IA - 232-F levels to 5-V TTL /CMOS levels. Each transmitter converts TTL/CMOS levels to TIA/EIA-232-F levels.

MAX232 provides the RS232 communication interface between the microcontroller and the PC. The host computer software can be written in Visual Basic 6.0 high-level language. VB6.0 provides a serial port communication control. Using 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 changes on a certain day are given in two ways: list and graph. From this, you can grasp the temperature change pattern of this day.

Atmospheric temperature acquisition and recording system designed using AT89C2051 microcontroller for system coordination and control

Figure 2 Temperature data processing interface diagram.

6 Conclusion

Judging from the measurement range, accuracy and measurement examples, the system can be used to measure and record a variety of environmental temperatures, including atmospheric temperature.


Keywords:AT89C2051 Reference address:Atmospheric temperature acquisition and recording system designed using AT89C2051 microcontroller for system coordination and control

Previous article:Analysis of two low-power power-saving working modes of AT89S51 microcontroller
Next article:Detailed description of bit operations and their applications in C51 language of microcontroller

Latest Microcontroller 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号