Application of single chip microcomputer in temperature measurement and control of tobacco flue-cured room

Publisher:MindfulBeingLatest update time:2012-02-08 Source: 现代电子技术 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

At present, the production mode of tobacco leaves has changed from the traditional scattered type to the intensive type and farm type, and the curing room has also developed from the traditional earthen kang to the large curing room. The "three-stage curing process" for the initial curing of tobacco leaves has been widely promoted in tobacco-producing areas, and most kang rooms have been equipped with hot air circulation devices. However, the dry and temperature measurements are still the traditional glass tube thermometers (fire meters), and the control of the air door or fire door is still manually passively controlled. This measurement method and control method have become a bottleneck problem restricting the improvement of tobacco leaf curing quality. Taking the wet bulb temperature (referred to as temperature) process requirements as an example, this article introduces a temperature control device with a single-chip microcomputer as the core, which basically realizes the automatic control of temperature during the flue-cured tobacco.

1 Temperature control process requirements.

(1) Technical requirements Effective measurement and control range: 20-80℃; Measurement accuracy: ±0.5℃; Control accuracy: ±1.0℃; Resolution: 0.1℃;
(2) Shift settings In order to adapt to the requirements of flue-cured tobacco technology and the specific conditions of tobacco leaves, the wet-bulb temperature is divided into nine shifts for selection. The temperature curve corresponding to each shift is shown in Figure 1.


(3) Actuator The damper is driven by an electric actuator, and its running time is 80s, i.e. 1.1°/s; power supply: 220V, 50Hz.
(4) Automatic control When the wet-bulb temperature exceeds the set value by 0.5℃, the air inlet door automatically opens for 5s; when the wet-bulb temperature is within the range of ±0.5℃, the air inlet door remains in the state. When the wet-bulb temperature is lower than the set value by 0.5℃, the air inlet door automatically closes for 5s.
(5) Alarm When the temperature is higher or lower than the set value by 1℃, the buzzer alarms.

2 System design

According to the above specific requirements, this system uses a single-chip microcomputer as a control unit and a thermal resistor as a sensor to complete the design of the device. Its working principle is as follows:

2.1 Hardware Design

2.1.1 Microprocessor Selection

This system uses AT89C51 as the CPU. AT89C51 is a low-power, high-performance 8b CMOS microcontroller with 4 kB flash programmable/erasable read-only memory on-chip. It is compatible with the MCS-51 microcontroller product series and is manufactured using high-density, non-volatile storage technology. The memory can be written/erased 1000 times. The pins of AT89C51 are the same as those of 8031. Therefore, it can meet the requirements without expansion.

2.1.2 Sensor Selection

According to the measurement accuracy and control accuracy requirements of this system, this device selects the thermal resistance sensor Cu50 as the temperature measuring element. Cu50 has a high temperature measurement range and a moderate price, which meets the technical requirements of the system.

2.1.3 Measurement Circuit

The measurement and control of temperature mainly depends on the temperature measurement accuracy. Therefore, in order to ensure the measurement accuracy, two measures are taken in the measurement circuit:

(1) The low drift and high precision OP07 is selected as the operational amplifier circuit.
(2) The measurement circuit is powered by a constant current source.

2.1.4 A/D Converter

The A/D converter uses the commonly used ADC0809 to meet the technical requirements. The chip has a resolution of 8 bits, a total unadjusted error of ±1LSB, an output level compatible with TTL levels, a single power supply of +5V, and an analog input range of 0 to 5V.

2.1.5 Output channel design

There are 3 output channels: 1 alarm circuit, 2 actuator drive circuits to control the forward and reverse rotation of the damper. In order to improve the anti-interference ability of the system, the drive circuit uses AC solid-state relays.

2.1.6 Human-machine channel design

(1) The temperature setting circuit uses a BCD code dial to set the temperature gear, and uses the lower 4 bits of the P1 port as the numerical input, which is easy to operate.
(2) The humidity display circuit uses a digital tube to display the humidity value. In order to no longer expand the parallel interface, the shift register function of the serial port is used to expand the 3b digital tube static display interface circuit. P1.7 is used as an output control. When P1.7=1, the serial port is allowed to output data to the shift register, otherwise, the display content remains unchanged.
(3) The alarm circuit uses a buzzer to alarm. [page]

The various units are combined to obtain a complete hardware system as shown in Figure 2.


2.2 Overall software design

2.2.1 Program structure design

The main program structure adopts a loop mode, and uses the timer T0 interrupt handler to control the start or stop of the electric actuator. The main program performs system initialization, including the initialization of the timer, I/O and interrupt system.

The following operations are performed in the loop: dial setting value detection, temperature detection, scale conversion, digital filtering, temperature display and control, and these operations are completed by the corresponding subroutine modules. The main program flow chart is shown in Figure 3.


2.2.2 Program module design

Several subroutines are used in the program. The following describes the design of the temperature detection and T0 interrupt processing control subroutines.

(1) Temperature detection program
The function of this program is to perform 7 consecutive A/D conversions, save the conversion results in the unit starting from 3BH, and then perform digital filtering to obtain the median value stored in the unit 33H. A/D conversion adopts the query method.
(2) T0 interrupt processing control subroutine
The high and low wet bulb temperature is controlled by the angle of the damper opening. Therefore, the function of this program is to compare the actual value of the detected temperature with the lower and upper limit of the set value to control the angle of the damper opening and the rate of temperature rise and fall. The upper limit setting value (stored in 3AH) and the lower limit setting value (stored in 38H) are ±0.5℃ of the gear setting temperature (stored in 39H). The operating status of the damper is detected and judged every 5 minutes. Each time the damper moves for 5s, it opens or closes 5.5°. Figure 4 is the flow chart of the T0 interrupt program.



3 Conclusion

According to the principle introduced in this article, a temperature control device has been made. At the same time, a manual/automatic conversion function has been added to the hardware, and anti-interference measures have been added to the software, making the device more reliable and stable, which has been proven by the Baofeng County Branch of Pingdingshan Tobacco Company.

Reference address:Application of single chip microcomputer in temperature measurement and control of tobacco flue-cured room

Previous article:The self-adaptive implementation method of serial communication baud rate of single chip microcomputer
Next article: CRC check code program implementation in single chip microcomputer and its redundant code table calculation

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号