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

Publisher:Serendipity99Latest update time:2011-01-23 Keywords:MCU 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 used to form a temperature measurement system with simple circuits. Many such digital thermometers can be hung on one 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, no external components are required to achieve temperature measurement.

(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 temperature upper and lower limit alarm settings. DS2433 is a 1-W ire memory with a capacity of 4k-Bit and can store 256 temperature data. It uses EEPROM technology, and the stored data will not be lost even if the power is off. The DS2433 has a factory-marked registration code that includes: a 48-bit unique serial number, an 8-bit CRC checksum, and an 8-bit family code (23h), and also has a 4096-bit user-programmable EEPROM. The power required to read and write the 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 that 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 data integrity when modifying the memory contents. The PR-35 and SO IC packages provide a compact structure that allows the device to be mounted 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 microcontroller 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 /E IA - 232- F level. The device complies with TIA /E IA - 232- F standard. Each receiver converts TIA /E IA - 232- F level into 5-V TTL /CMOS level. Each transmitter converts TTL /CMOS level into TIA /E IA - 232- F level.



MAX232 provides an 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 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. This can help us understand the temperature change pattern of the day.
Temperature data processing interface diagram
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 to read 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 the measurement is carried out in the field environment, the mobile communication network (such as the emerging 3G technology) can be used to transmit the data, which saves the researchers from the hard work.
Keywords:MCU Reference address:Atmospheric temperature acquisition and recording system based on AT89C2051 single chip microcomputer

Previous article:Functional verification of TURBO51 embedded microprocessor
Next article:Design of vehicle-mounted digital video compression recording system based on LPC2210 and SZ1510

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

Formerly known as HuaDa Semiconductor's MCU Division, Xiaohua Semiconductor received RMB 40 million in financing
Recently, China Electronics Smart Fund completed its investment in Xiaohua Semiconductor Co., Ltd. (referred to as "Xiaohua Semiconductor") with an investment amount of 40 million yuan. Xiaohua Semiconductor is located in Shanghai Free Trade Zone. It was formerly known as the MCU Division of Huada Semicon
[Mobile phone portable]
LCD1602+MCU+Puzhong+Jiangsu University of Science and Technology Automation Association
1 Realization phenomenon LCD1602 Working Principle To display a character or string on LCD1602, you only need to write the character constant or string constant to be displayed in the C51 program. After compiling, the C51 program will automatically generate its standard ASCII code, and then send the
[Microcontroller]
LCD1602+MCU+Puzhong+Jiangsu University of Science and Technology Automation Association
Why does the MCS-51 microcontroller need to interrupt the system expansion? How does the timer serve as an external interrupt source?
Why does the MCS-51 microcontroller need to use interrupt system expansion? Answer: Although MCS-51 has provided two external interrupt request input terminals INT0 and INT1, when there is still a large demand for external interrupt request sources, interrupt system expansion is required. When the timer is used as
[Microcontroller]
MCU 51 small experiment---marquee
The following program has been run on my experimental box. AT89C52 function: According to the level of P2.X port, if the input is 1, X lights will cycle on P0P1 port. ;The input is a switch button                           ORG 0000H JMP8:                MOV P2,#0FFH ;Set the port to 1, that is, set it as input mode
[Microcontroller]
Design of Single-Chip Microcomputer System for Automobile Driving Simulator
introduction A car driving simulator is a simulation system that can accurately simulate the driving operation of a car and obtain the feeling of driving a real car. The current car driving simulator integrates a variety of advanced technologies such as sensors, computer three-dimensional real-time animation, c
[Microcontroller]
Design of Single-Chip Microcomputer System for Automobile Driving Simulator
Lithium battery fast charging circuit based on single chip microcomputer
  Common rechargeable batteries include nickel-metal hydride batteries, nickel-cadmium batteries, lithium batteries and polymer batteries. Among them, lithium batteries are widely used due to their high energy density, stable discharge characteristics, no memory effect and long service life. At present, most mobile ph
[Power Management]
Lithium battery fast charging circuit based on single chip microcomputer
Design of home temperature monitoring system controlled by single chip microcomputer
introduction Temperature is a very important physical quantity in the IoT home system, and its measurement and control are of great significance. With the improvement of monitoring of various IoT homes, the temperature control of various devices has higher requirements. In order to meet people's needs for tempe
[Industrial Control]
Design of home temperature monitoring system controlled by single chip microcomputer
Comparison and analysis of MCU-based and ASIC-based LED thyristor dimming solutions
As a new and most potential light source, LED lighting is gaining more and more attention for its advantages of energy saving and environmental protection. With the policy encouragement of the national and local governments, China's LED lighting industry has entered an accelerated development stage, and the applicatio
[Power Management]
Comparison and analysis of MCU-based and ASIC-based LED thyristor dimming solutions
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号