基于单片机的温湿度控制系统英文文献
单片机温度控制英文文献及翻译
Temperature Control Using a Microcontroller:An Interdisciplinary Undergraduate Engineering Design ProjectJames S. McDonaldDepartment of Engineering ScienceTrinity UniversitySan Antonio, TX 78212AbstractThis paper describes an interdisciplinary desig n project which was done under the author’s supervision by a group of four senior students in the Department of Engineering Science at Trinity University. The objective of the project was to develop a temperature control system for an air-filled chamber. The system was to allow entry of a desired chamber temperature in a prescribed range and to exhibit overshoot and steady-state temperature error of less than 1 degree Kelvin in the actual chamber temperature step response. The details of the design developed by this group of students, based on a Motorola MC68HC05 family microcontroller, are described. The pedagogical value of the problem is also discussed through a description of some of the key steps in the design process. It is shown that the solution requires broad knowledge drawn from several engineering disciplines including electrical, mechanical, and control systems engineering.1 IntroductionThe design project which is the subject of this paper originated from a real-world application.A prototype of a microscope slide dryer had been developed around an OmegaTM modelCN-390 temperature controller, and the objective was to develop a custom temperature control system to replace the Omega system. The motivation was that a custom controller targeted specifically for the application should be able to achieve the same functionality at a much lower cost, as the Omega system is unnecessarily versatile and equipped to handle a wide variety of applications.The mechanical layout of the slide dryer prototype is shown in Figure 1. The main element of the dryer is a large, insulated, air-filled chamber in which microscope slides, each with a tissue sample encased in paraffin, can be set on caddies. In order that the paraffin maintain the proper consistency, the temperature in the slide chamber must be maintained at a desired (constant) temperature. A second chamber (the electronics enclosure) houses a resistive heater and the temperature controller, and a fan mounted on the end of the dryer blows air across the heater, carrying heat into the slide chamber. This design project was carried out during academic year 1996–97 by four students under the author’s supervision as a Senior Design project in the Department of Engineering Science at Trinity University. The purpose of this paper isto describe the problem and the students’ solution in some detail, and to discuss some of the pedagogical opportunities offered by an interdisciplinary design project of this type. The students’ own report was presented at the 1997 Nat ional Conference on Undergraduate Research [1]. Section 2 gives a more detailed statement of the problem, including performance specifications, and Section 3 describes the students’ design. Section 4 makes up the bulk of the paper, and discusses in some detail several aspects of the design process which offer unique pedagogical opportunities. Finally, Section 5 offers some conclusions.2 Problem StatementThe basic idea of the project is to replace the relevant parts of the functionality of an Omega CN-390 temperature controller using a custom-designed system. The application dictates that temperature settings are usually kept constant for long periods of time, but it’s nonetheless important that step changes be tracked in a ―reasonable‖ manner. Thus the mai n requirements boil down to·allowing a chamber temperature set-point to be entered,·displaying both set-point and actual temperatures, and·tracking step changes in set-point temperature with acceptable rise time, steady-state error, and overshoot.Although not explicitly a part of the specifications in Table 1, it was clear that the customer desired digital displays of set-point and actual temperatures, and that set-point temperature entry should be digital as well (as opposed to, say, through a potentiometer setting).3 System DesignThe requirements for digital temperature displays and setpoint entry alone are enough to dictate that a microcontrollerbased design is likely the most appropriate. Figure 2 shows a block diagram of the students’ design.The microcontroller, a MotorolaMC68HC705B16 (6805 for short), is the heart of the system. It accepts inputs from a simple four-key keypad which allow specification of the set-point temperature, and it displays both set-point and measured chamber temperatures using two-digit seven-segment LED displays controlled by a display driver. All these inputs and outputs are accommodated by parallel ports on the 6805. Chamber temperature is sensed using apre-calibrated thermistor and input via one of the 6805’s an alog-to-digital inputs. Finally, a pulse-width modulation (PWM) output on the 6805 is used to drive a relay which switches line power to the resistive heater off and on.Figure 3 shows a more detailed schematic of the electronics and their interfacing to the 6805. The keypad, a Storm 3K041103, has four keys which are interfaced to pins PA0{ PA3 of Port A, configured as inputs. One key functions as a mode switch. Two modes are supported: set mode and run mode. In set mode two of the other keys are used to specify the set-point temperature: one increments it and one decrements. The fourth key is unused at present. The LED displays are driven by a Harris Semiconductor ICM7212 display driver interfaced to pins PB0{PB6 of Port B, configured as outputs. The temperature-sensing thermistor drives, through a voltage divider, pin AN0 (one of eight analog inputs). Finally, pin PLMA (one of two PWM outputs) drives the heater relay.Software on the 6805 implements the temperature control algorithm, maintains the temperature displays, and alters the set-point in response to keypad inputs. Because it is not complete at this writing, software will not be discussed in detail in this paper. The control algorithm in particular has not been determined, but it is likely to be a simple proportional controller and certainly not more complex than a PID. Some control design issues will be discussed in Section 4, however.4 The Design ProcessAlthough essentially the project is just to build a thermostat, it presents many nice pedagogical opportunities. The knowledge and experience base of a senior engineering undergraduate are just enough to bring him or her to the brink of a solution to various aspects of the problem. Yet, in each case, realworld considerations complicate the situation significantly.Fortunately these complications are not insurmountable, and the result is a very beneficial design experience. The remainder of this section looks at a few aspects of the problem which present the type of learning opportunity just described. Section 4.1 discusses some of the featuresof a simplified mathematical model of the thermal properties of the system and how it can beeasily validated experimentally. Section 4.2 describes how realistic control algorithm designs can be arrived at using introductory concepts in control design. Section 4.3 points out some important deficiencies of such a simplified modeling/control design process and how they can be overcome through simulation. Finally, Section 4.4 gives an overview of some of the microcontroller-related design issues which arise and learning opportunities offered.4.1 MathematicalModelLumped-element thermal systems are described in almost any introductory linear control systems text, and just this sort of model is applicable to the slide dryer problem. Figure 4 shows a second-order lumped-element thermal model of the slide dryer. The state variables are the temperatures Ta of the air in the box and Tb of the box itself. The inputs to the system are the power output q(t) of the heater and the ambient temperature T¥. ma and mb are the masses of the air and the box, respectively, and Ca and Cb their specific heats. μ1 and μ2 are heat transfer coefficients from the air to the box and from the box to the external world, respectively.It’s not hard to show that the (linearized) state equationscorresponding to Figure 4 areTaking Laplace transforms of (1) and (2) and solving for Ta(s), which is the output of interest, gives the following open-loop model of the thermal system:where K is a constant and D(s) is a second-order polynomial.K, tz, and the coefficients ofD(s) are functions of the variousparameters appearing in (1) and (2).Of course the various parameters in (1) and (2) are completely unknown, but it’s not hard to show that, regardless of their values, D(s) has two real zeros. Therefore the main transfer function of interest (which isthe one from Q(s), si nce we’ll assume constant ambient temperature) can be writtenMoreover, it’s not too hard to show that 1=tp1 <1=tz <1=tp2, i.e., that the zero lies between the two poles. Both of these are excellent exercises for the student, and the result is the openloop pole-zero diagram of Figure 5.Obtaining a complete thermal model, then, is reduced to identifying the constant K and the three unknown time constants in (3). Four unknown parameters is quite a few, but simple experiments show that 1=tp1 _ 1=tz;1=tp2 so that tz;tp2 _ 0 are good approximations. Thus the open-loop system is essentially first-order and can therefore be written(where the subscript p1 has been dropped).Simple open-loop step response experiments show that,for a wide range of initial temperatures and heat inputs, K _0:14 _=W and t _ 295 s.14.2 Control System DesignUsing the first-order model of (4) for the open-loop transfer function Gaq(s) and assuming for the moment that linear control of the heater power output q(t) is possible, the block diagram of Figure 6 represents the closed-loop system. Td(s) is the desired, or set-point, temperature,C(s) is the compensator transfer function, and Q(s) is the heater output in watts.Given this simple situation, introductory linear control design tools such as the root locus method can be used to arrive at a C(s) which meets the step response requirements on rise time, steady-state error, and overshoot specified in Table 1. The upshot, of course, is that a proportional controller with sufficient gain can meet all specifications. Overshoot is impossible, and increasing gains decreases both steady-state error and rise time.Unfortunately, sufficient gain to meet the specifications may require larger heat outputs than the heater is capable of producing. This was indeed the case for this system, and the result is that the rise time specification cannot be met. It is quite revealing to the student how useful such an oversimplified model, carefully arrived at, can be in determining overall performance limitations.4.3 Simulation ModelGross performance and its limitations can be determined using the simplified model of Figure 6, but there are a number of other aspects of the closed-loop system whose effects on performance are not so simply modeled. Chief among these are·quantization error in analog-to-digital conversion of the measured temperature and· the use of PWM to control the heater.Both of these are nonlinear and time-varying effects, and the only practical way to study them is through simulation (or experiment, of course).Figure 7 shows a SimulinkTM block diagram of the closed-loop system which incorporates these effects. A/D converter quantization and saturation are modeled using standard Simulink quantizer and saturation blocks. Modeling PWM is more complicated and requires a customS-function to represent it.This simulation model has proven particularly useful in gauging the effects of varying thebasic PWM parameters and hence selecting them appropriately. (I.e., the longer the period, the larger the temperature error PWM introduces. On the other hand, a long period is desirable to avoid excessive relay ―chatter,‖ among other things.) PWM is often difficult for students to grasp, and the simulation model allows an exploration of its operation and effects which is quite revealing.4.4 The MicrocontrollerSimple closed-loop control, keypad reading, and display control are some of the classic applications of microcontrollers, and this project incorporates all three. It is therefore an excellent all-around exercise in microcontroller applications. In addition, because the project isto produce an actual packaged prototype, it won’t do to use a simple evaluation board with theI/O pins jumpered to the target system. Instead, it’s necessary to d evelop a complete embedded application. This entails the choice of an appropriate part from the broad range offered in a typical microcontroller family and learning to use a fairly sophisticated development environment. Finally, a custom printed-circuit board for the microcontroller and peripherals must be designed and fabricated.Microcontroller Selection. In view of existing local expertise, the Motorola line of microcontrollers was chosen for this project. Still, this does not narrow the choice down much. A fairly disciplined study of system requirements is necessary to specify which microcontroller, out of scores of variants, is required for the job. This is difficult for students, as they generally lack the experience and intuition needed as well as the perseverance to wade through manufacturers’ selection guides.Part of the problem is in choosing methods for interfacing the various peripherals (e.g., what kind of display driver should be used?). A study of relevant Motorola application notes [2, 3, 4] proved very helpful in understandingwhat basic approaches are available, and what microcontroller/peripheral combinations should be considered.The MC68HC705B16 was finally chosen on the basis of its availableA/D inputs and PWMoutputs as well as 24 digital I/O lines. In retrospect this is probably overkill, as only oneA/D channel, one PWM channel, and 11 I/O pins are actually required (see Figure 3). The decision was made to err on the safe side because a complete development system specific to the chosen part was necessary, and the project budget did not permit a second such system to be purchased should the firstprove inadequate.Microcontroller Application Development. Breadboarding of the peripheral hardware, development of microcontroller software, and final debugging and testing of a customprinted-circuit board for the microcontroller and peripherals all require a development environment of some kind. The choice of a development environment, like that of themicrocontroller itself, can be bewildering and requires some faculty expertise. Motorola makes three grades of development environment ranging from simple evaluation boards (at around $100) to full-blown real-time in-circuit emulators (at more like $7500). The middle option was chosen for this project: the MMEVS, which consists of _ a platform board (which supports all 6805-family parts), _ an emulator module (specific to B-series parts), and _ a cable and target head adapter (package-specific). Overall, the system costs about $900 and provides, with some limitations, in-circuit emulation capability. It also comes with the simple but sufficient software development environment RAPID [5].Students find learning to use this type of system challenging, but the experience they gain in real-world microcontroller application development greatly exceeds the typical first-course experience using simple evaluation boards.Printed-Circuit Board. The layout of a simple (though definitely not trivial) printed-circuit board is another practical learning opportunity presented by this project. The final board layout, with package outlines, is shown (at 50% of actual size) in Figure 8. The relative simplicity of the circuit makes manual placement and routing practical—in fact, it likely gives better results than automatic in an application like this—and the student is therefore exposed to fundamental issues of printed-circuit layout and basic design rules. The layout software used was the very nice package pcb,2 and the board was fabricated in-house with the aid of our staff electronics technician.5 ConclusionThe aim of this paper has been to describe an interdisciplinary, undergraduate engineering design project: a microcontroller- based temperature control system with digital set-point entry and set-point/actual temperature display. A particular design of such a system has been described, and a number of design issues which arise—from a variety of engineering disciplines—have been discussed. Resolution of these issues generally requires knowledge beyond that acquired in introductory courses, but realistically accessible to advance undergraduate students, especiallywith the advice and supervision of faculty.Desirable features of the problem, from a pedagogical viewpoint, include the use of a microcontroller with simple peripherals, the opportunity to usefully apply introductorylevel modeling of physical systems and design of closed-loop controls, and the need for relatively simple experimentation (for model validation) and simulation (for detailed performance prediction). Also desirable are some of the technologyrelated aspects of the problem including practical use of resistive heaters and temperature sensors (requiring knowledge of PWM and calibration techniques, respectively), microcontroller selection and use of development systems, and printedcircuit design.AcknowledgementsThe author would like to acknowledge the hard work, dedication, and ability shown by the students involved in this project: Mark Langsdorf, Matt Rall, PamRinehart, and David Schuchmann. It is their project, and credit for its success belongs to them.References[1] M. Langsdorf, M. Rall, D. Schuchmann, and P. Rinehart,―Temperature control of a microscope slide dryer,‖ in1997 National Conference on Undergraduate Research,(Austin, TX), April 1997. Poster presentation.[2] Motorola, Inc., Phoenix, AZ, Temperature Measurementand Display Using the MC68HC05B4 and the MC14489,1990. Motorola SemiconductorApplicationNote AN431.[3] Motorola, Inc., Phoenix, AZ, HC05 MCU LED DriveTechniques Using the MC68HC705J1A, 1995. MotorolaSemiconductor Application Note AN1238.[4] Motorola, Inc., Phoenix, AZ, HC05MCU Keypad DecodingTechniques Using the MC68HC705J1A, 1995. MotorolaSemiconductor Application Note AN1239.[5] Motorola, Inc., Phoenix, AZ, RAPID Integrated DevelopmentEnvironment User’s Manual, 1993. (RAPID wasdeveloped by P & E Microcomputer Systems, Inc.).11。
单片机-温度控制系统-外文翻译-外文文献-英文文献-中英翻译
Design of the Temperature Control System Based on AT89C51ABSTRACTThe principle and functions of the temperature control system based on micro controller AT89C51 are studied, and the temperature measurement unit consists of the 1-Wire bus digital temperature sensor DS18B20. The system can be expected to detect the preset temperature, display time and save monitoring data. An alarm will be given by system if the temperature exceeds the upper and lower limit value of the temperature which can be set discretionarily and then automatic control is achieved, thus the temperature is achieved monitoring intelligently within a certain range. Basing on principle of the system, it is easy to make a variety of other non-linear control systems so long as the software design is reasonably changed. The system has been proved to be accurate, reliable and satisfied through field practice.KEYWORDS: AT89C51; micro controller; DS18B20; temperature1 INTRODUCTIONTemperature is a very important parameter in human life. In the modern society, temperature control (TC) is not only used in industrial production, but also widely used in other fields. With the improvement of the life quality, we can find the TC appliance in hotels, factories and home as well. And the trend that TC will better serve the whole society, so it is of great significance to measure and control the temperature. Based on the AT89C51 and temperature sensor DS18B20, this system controls the condition temperature intelligently. The temperature can be set discretionarily within a certain range. The system can show the time on LCD, and save monitoring data; and automatically control the temperature when the condition temperature exceeds the upper and lower limit value. By doing so it is to keep the temperature unchanged. The system is of high anti-jamming, high control precision and flexible design; it also fits the rugged environment. It is mainly used in people's life to improve the quality of the work and life. It is also versatile, so that it can beconvenient to extend the use of the system. So the design is of profound importance. The general design, hardware design and software design of the system are covered.1.1 IntroductionThe 8-bit AT89C51 CHMOS microcontrollers are designed to handle high-speed calculations and fast input/output operations. MCS 51 microcontrollers are typically used for high-speed event control systems. Commercial applications include modems, motor-control systems, printers, photocopiers, air conditioner control systems, disk drives, and medical instruments. The automotive industry use MCS 51 microcontrollers in engine-control systems, airbags, suspension systems, and antilock braking systems (ABS). The AT89C51 is especially well suited to applications that benefit from its processing speed and enhanced on-chip peripheral functions set, such as automotive power-train control, vehicle dynamic suspension, antilock braking, and stability control applications. Because of these critical applications, the market requires a reliable cost-effective controller with a low interrupt latency response, ability to service the high number of time and event driven integrated peripherals needed in real time applications, and a CPU with above average processing power in a single package. The financial and legal risk of having devices that operate unpredictably is very high. Once in the market, particularly in mission critical applications such as an autopilot or anti-lock braking system, mistakes are financially prohibitive. Redesign costs can run as high as a $500K, much more if the fix means 2 back annotating it across a product family that share the same core and/or peripheral design flaw. In addition, field replacements of components is extremely expensive, as the devices are typically sealed in modules with a total value several times that of the component. To mitigate these problems, it is essential that comprehensive testing of the controllers be carried out at both the component level and system level under worst case environmental and voltage conditions. This complete and thorough validation necessitates not only a well-defined process but also a proper environment and tools to facilitate and execute the mission successfully. Intel Chandler Platform Engineering group provides post silicon system validation (SV)of various micro-controllers and processors. The system validation process can be broken into three major parts. The type of the device and its application requirements determine which types of testing are performed on the device.1.2 The AT89C51 provides the following standard features4Kbytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bittimer/counters, a five vector two-level interrupt architecture, a full duple ser-ial port, on-chip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt sys -tem to continue functioning. The Power-down Mode saves the RAM contents but freezes the oscil–lator disabling all other chip functions until the next hardware reset.1.3Pin DescriptionVCC Supply voltage.GND Ground.Port 0:Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull ups. Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pull ups are required during program verification.Port 1:Port 1 is an 8-bit bi-directional I/O port with internal pull ups. The Port 1 output buffers can sink/so -urce four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pullups. Port 1 also receives the low-order address bytes during Flash programming and verification.Port 2:Port 2 is an 8-bit bi-directional I/O port with internal pullups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses (MOVX@DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals durin Flash programming and verification.Port 3:Port 3 is an 8-bit bi-directional I/O port with internal pull ups. The Port 3 output buffers can sink/sou -rce four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull ups.Port 3 also serves the functions of various special features of the AT89C51 as listed below:RST:Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.ALE/PROG:Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped duri-ng each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.PSEN:Program Store Enable is the read strobe to external programmemory. When theAT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.EA/VPP:External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin alsreceives the 12-volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt VPP.XTAL1:Input to the inverting oscillator amplifier and input to the internal clock operating circuit.XTAL2 :Output from the inverting oscillator amplifier. Oscillator CharacteristicsXTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2.There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed. Idle Mode In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. It should be noted that when idle is terminated by a hard ware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory.Power-down ModeIn the power-down mode, the oscillator is stopped, and the instruction that invokes power-down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the power-down mode is terminated. The only exit from power-down is a hardware reset. Reset redefines the SFRS but does not change the on-chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize. The AT89C51 code memory array is programmed byte-by byte in either programming mode. To program any nonblank byte in the on-chip Flash Memory, the entire memory must be erased using the Chip Erase Mode.2 Programming AlgorithmBefore programming the AT89C51, the address, data and control signals should be set up according to the Flash programming mode table and Figure 3 and Figure 4. To program the AT89C51, take the following steps.1. Input the desired memory location on the address lines.2. Input the appropriate data byte on the data lines. 3. Activate the correct combination of control signals. 4. Raise EA/VPP to 12V for the high-voltage programming mode.5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-write cycle is self-timed and typically takes no more than 1.5 ms. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached. Data Polling: The AT89C51 features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the complement of the written datum on PO.7. Once the write cycle has been completed, true data are valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated.2.1Ready/Busy:The progress of byte programming can also be monitored by the RDY/BSY output signal. P3.4 is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is pulled high again when programming is done toindicate READY.Program Verify:If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read back via the address and data lines for verification. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled.2.2 Chip Erase:The entire Flash array is erased electrically by using the proper combination of control signals and by holding ALE/PROG low for 10 ms. The code array is written with all “1”s. The chip erase operation must be executed before the code memory can be re-programmed.2.3 Reading the Signature Bytes:The signature bytes are read by the same procedure as a normal verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values returned areas follows.(030H) = 1EH indicates manufactured by Atmel(031H) = 51H indicates 89C51(032H) = FFH indicates 12V programming(032H) = 05H indicates 5V programming2.4 Programming InterfaceEvery code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is self timed and once initiated, will automatically time itself to completion. A microcomputer interface converts information between two forms. Outside the microcomputer the information handled by an electronic system exists as a physical signal, but within the program, it is represented numerically. The function of any interface can be broken down into a number of operations which modify the data in some way, so that the process of conversion between the external and internal forms is carried out in a number of steps. An analog-to-digital converter(ADC) is used to convert a continuously variable signal to a corresponding digital form which can take any one of a fixed number of possible binary values. If the output of thetransducer does not vary continuously, no ADC is necessary. In this case the signal conditioning section must convert the incoming signal to a form which can be connected directly to the next part of the interface, the input/output section of the microcomputer itself. Output interfaces take a similar form, the obvious difference being that here the flow of information is in the opposite direction; it is passed from the program to the outside world. In this case the program may call an output subroutine which supervises the operation of the interface and performs the scaling numbers which may be needed for digital-to-analog converter(DAC). This subroutine passes information in turn to an output device which produces a corresponding electrical signal, which could be converted into analog form using a DAC. Finally the signal is conditioned(usually amplified) to a form suitable for operating an actuator. The signals used within microcomputer circuits are almost always too small to be connected directly to the outside world” and some kind of interface must be used to translate them to a more appropriate form. The design of section of interface circuits is one of the most important tasks facing the engineer wishing to apply microcomputers. We have seen that in microcomputers information is represented as discrete patterns of bits; this digital form is most useful when the microcomputer is to be connected to equipment which can only be switched on or off, where each bit might represent the state of a switch or actuator. To solve real-world problems, a microcontroller must have more than just a CPU, a program, and a data memory. In addition, it must contain hardware allowing the CPU to access information from the outside world. Once the CPU gathers information and processes the data, it must also be able to effect change on some portion of the outside world. These hardware devices, called peripherals, are the CPU’s window to the outside.The most basic form of peripheral available on microcontrollers is the general purpose I70 port. Each of the I/O pins can be used as either an input or an output. The function of each pin is determined by setting or clearing corresponding bits in a corresponding data direction register during the initialization stage of a program. Each output pin may be driven to either a logic one or a logic zero by using CPU instructions to pinmay be viewed (or read.) by the CPU using program instructions. Some type of serial unit is included on microcontrollers to allow the CPU to communicate bit-serially with external devices. Using a bit serial format instead of bit-parallel format requires fewer I/O pins to perform the communication function, which makes it less expensive, but slower. Serial transmissions are performed either synchronously or asynchronously.3 SYSTEM GENERAL DESIGNThe hardware block diagram of the TC is shown in Fig. 1. The system hardware includes the micro controller, temperature detection circuit, keyboard control circuit, clock circuit, Display, alarm, drive circuit and external RAM. Based on the AT89C51, the DS18B20 will transfer the temperature signal detected to digital signal. And the signal is sent to the micro controller for processing. At last the temperature value is showed on the LCD 12232F. These steps are used to achieve the temperature detection. Using the keyboard interface chip HD7279 to set the temperature value, using the micro controller to keep a certain temperature, and using the LCD to show the preset value for controlling the temperature. In addition, the clock chip DS1302 is used to show time and the external RAM 6264 is used to save the monitoring data. An alarm will be given by buzzer in time if the temperature exceeds the upper and lower limit value of the temperature.3.1 HARDWARE DESIGNA. Micro controllerThe AT89C51 is a low-power, high-performance CMOS 8-bit micro controller with 4K bytes of in-system programmable Flash memory. The device is manufactured using At mel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the At mel AT89C51 is a powerful micro controller which provides a highly-flexible and cost-effective solution to many embedded control applications. Minimum system of the micro controller is shown inFig. 2. In order to save monitoring data, the 6264 is used as an external RAM. It is a static RAM chip, low-power with 8K bytes memory.B. Temperature Detection CircuitThe temperature sensor is the key part in the system. The Dallas DS18B20 is used, which supports the 1-Wire bus interface, and the ON-BOARD Patented is used internally. All the sensor parts and the converting circuit are integrated in integrated circuit like a transistor [1]. Its measure range is -55℃~125 ℃, and the precision between -10℃~85℃is ±0.5℃[2 ,3]. The temperature collected by the DS18B20 is transmitted in the 1-Wire bus way, and this highly raises the system anti-jamming and makes it fit in situ temperature measurement of the rugged environment [4]. There are two power supply ways for the DS18B20. The first is external power supply: the first pin of the DS18B20 is connected to the ground; the second pin serves as signal wire and the third is connected to the power. The second way is parasite power supply [5]. As the parasite power supply will lead to the complexity of the hardware circuit, the difficulty of the software control and the performance degradation of the chip, etc. But the DS18B20(s) can be connected to the I/O port of the micro controller in the external power supply way and it is more popular. Therefore the external power supply is used and the second pin is connected to the pin P1.3 of the AT89S51. Actually, if there are multipoint to be detected, the DS18B20(s) can be connected to the 1-Wire bus. But when the number is over 8, there is a concern to the driving and the more complex software design as well as the length of the 1-Wire bus. Normally it is no more than 50m. To achieve distant control, the system can be designed in to a wireless one to breakthe length limit of the 1-Wire bus [6].C. LCD CircuitThe LCD 12232F is used, which can be used to show characters, temperature value and time, and supply a friendly display interface. The 12232F is a LCD with 8192 128×32 pixels Chinese character database and 128 16×8 pixels ASCII character set graphics. It mainly consists of row drive/column drive and 128×32 full lattice LCD with the function of displaying graphics as well as 7.5×2 Chinese characters. It is in aparallel or serial mode to connect to external CPU [7]. In order to economize the hardware resource, the 12232F should be connected to the AT89S51 in serial mode with only 4 output ports used. The LCD grayscale can be changed by adjusting the variable resistor connected the pin Vlcd of the LCD. CLK is used to transmit serial communication clock. SID is used to transmit serial data. CS is used to enable control the LCD. L+ is used to control the LCD backlight power.D. Clock CircuitThe Dallas DS18B20 is used, which is a high performance, low-power and real-time clock chip with RAM. The DS18B20 serves in the system with calendar clock and is used to monitor the time. The time data is read and processed by the AT89C51 and then displayed by the LCD. Also the time can be adjusted by the keyboard. The DS18B20 crystal oscillator is set at 32768Hz, and the recommended compensation capacitance is 6pF. The oscillator frequency is lower, so it might be possible not to connect the capacitor, and this would not make a big difference to the time precision. The backup power supply can be connected to a 3.6V rechargeable battery.E. Keyboard Control CircuitThe keyboard interface in the system is driven by the HD7279A which has a +5V single power supply and which is connected to the keyboard and display without using any active-device. According to the basic requirements and functions of the system, only 6 buttons are needed. The system's functions are set by the AT89C51 receiving the entered data. In order to save the external resistor, the 1×6 keyboard is used, and the keyboard codes are defined as: 07H, 0FH, 17H, 1FH, 27H, 2FH. The order can be read out by reading the code instruction. HD7279A is connected to the AT89S51 in serial mode and only 4 ports are need. As shown in Fig. 6, DIG0~DIG5 and DP are respectively the column lines and row line ports of the six keys which achieve keyboard monitoring, decoding and key codes identification.F. Alarm CircuitIn order to simplify the circuit and convenient debugging, a 5V automatic buzzer is used in the alarm circuit [8]. And this make the software programming simplified. As shown in Fig. 7, it is controlled bythe PNP transistor 9012 whose base is connected to the pin P2.5 of the AT89C51. When the temperature exceeds the upper and lower limit value, the P2.5 output low level which makes the transistor be on and then an alarm is given by the buzzer.G. Drive CircuitA step motor is used as the drive device to control the temperature. The four-phase and eight-beat pulse distribution mode is used to drive motor and the simple delay program is used to handle the time interval between the pulses to obtain different rotational speed. There are two output states for the step motor. One: when the temperature is over the upper value, the motor rotates reversely (to low the temperature), while when lower than the lower limit value, the motor rotates normally (to raise the temperature); besides not equals the preset value. Two: when the temperature is at somewhere between the two ends and equals the preset value, the motor stops. These steps are used to achieve the temperature control. In addition, the motor speed can also be adjusted by relative buttons. As shown in Fig. 8, the code data is input through ports A11~A8 (be P2.3~P2.0) of the AT89C51 and inverted output by the inverter 74LS04. Finally it is amplified by the power amplifier 2803A to power the motor.3.2 SOFTWARE DESIGNAccording to the general design requirement and hardware circuit principle of the system, as well as the improvement of the program readability, transferability and the convenient debugging, the software design is modularized. The system flow mainly includes the following 8 steps: POST (Power-on self-test), system initiation, temperature detection, alarm handling, temperature control, clock chip DS18B20 operation, LCD and keyboard operation. The main program flow is shown in Fig. 9. Give a little analysis to the above 8 tasks, it is easy to find out that the last five tasks require the real time operation. But to the temperature detection it can be achieved with timer0 timing 1 second, that is to say temperature detection occurs per second. The system initiation includes global variable definition, RAM initiation, special function register initiation and peripheral equipment initiation. Global variable definition mainly finishes the interface definition of external interfacechip connected to the AT89C51, and special definition of some memory units. RAM initiation mainly refers to RAM processing. For example when the system is electrified the time code will be stored in the internal unit address or the scintillation flag will be cleared. The special function register initiation includes loading the initial value of timer and opening the interrupt. For example, when the system is electrified the timer is initialized. The peripheral equipment initiation refers to set the initial value of peripheral equipment. For example, when the system is electrified, the LCD should be initialized, the start-up display should be called, the temperature conversion command should be issued firstly and the clock chip DS18B20 should also be initialized. The alarm handling is mainly the lowering and the raising of temperature to make the temperature remain with the preset range. When the temperature is between the upper and the lower limit value, it goes to temperature control handling, that is to say the temperature need to be raised or lowered according to the preset value. By doing so make the condition temperature equal to the preset value and hence to reach the temperature target.4 CONCLUSIONThe temperature control system has the advantages of friendly human-computer interaction interface, simple hardware, low cost, high temperature control precision (error in the range of ±1 ℃), convenience and versatility, etc. It can be widely used in the occasions with -55℃to 125℃range, and there is a certain practical value.。
单片机_温度控制系统_外文翻译_外文文献_英文文献_中英翻译
Design of the Temperature Control System Based on AT89C51ABSTRACTThe principle and functions of the temperature control system based on micro controller AT89C51 are studied, and the temperature measurement unit consists of the 1—Wire bus digital temperature sensor DS18B20。
The system can be expected to detect the preset temperature, display time and save monitoring data. An alarm will be given by system if the temperature exceeds the upper and lower limit value of the temperature which can be set discretionarily and then automatic control is achieved, thus the temperature is achieved monitoring intelligently within a certain range。
Basing on principle of the system, it is easy to make a variety of other non-linear control systems so long as the software design is reasonably changed。
The system has been proved to be accurate, reliable and satisfied through field practice。
基于单片机的温度与湿度解耦控制系统设计外文文献及中文翻译
Temperature and humidity decoupling control system design based on MCUClimate conditions control emphases of automatic control greenhouses introduced from abroad are different from these in home and the introducing and production cost of them is so high ,so it is difficult to popularize and use cosmically .At present, in greenhouses designed and built in home itself,the degree of environment control and modern management of most of them is so low ,so they cannot satisfy crops' demand for high production and planting all the year; some can only carry out control on partial environment factors without considering mutual affect and coupling of them in the process of control; some still need manual control;so these factors greatly restrict exertion of economic benefit of greenhouses .Changing traditional modes of control; practicing computer monitoring and establishing greenhouse automatic monitoring system accord with the situation of China have important meaning for quickening modern degree of greenhouse production in our country and increasing benefit of greenhouses.Based on summarizing formers' researches, the paper analyzes environmental parameters,the integrative control property of greenhouse systems and the control process which is a nonlinear, delay and complicated system; Based on analyzing modes ofcurrent greenhouse monitoring systems and properties of single-chip microcomputers, a practical automatic monitoring system for greenhouse environment is designed which can realize the monitoring of every parameter in greenhouse environment by synthetically using sensor technology, fuzzy control theory, communication technology and microcomputer technology The system hardware is composed of two parts: a lower-level and a higher-level computer. The higher-level computer is a PC microcomputer which is the headquarter of the system and finishes the unified management and control of a greenhouse by way of COM port RS-232 connecting with the lower-level computer. In monitoring environment, the system can finish monitoring for this nonlinear and delay system and realize crops' demand for greenhouse environment by using fuzzy control theory and technology .The central component of thelower-level computer is 8098 single-chip microcomputer of MCS-96 series, which is used to collect, retreat control and communicate with the higher-level computer.The system software consists of two parts .The higher-level software is developed by VB and composed of seven modules of setting system parameters, demarcating sensors, ascertaining fuzzy control table, connecting and monitoring real-time data, recurring to history data and help, and each module has certain function and each other is independent from others. The lower-level software is developed by 8098 assemble language and composed of six modules of a main program, a sending and interrupting service program, a receiving and interrupting service program, ascertaining a sampling cycle, connecting data and pretreating data. Simulative experiment shows that the whole system is convenient to operate,high efficient, easy to expand, has better adaptability and universal property and establishes certain base for realizing control system design with many factors in greenhouse environment.Key words: Automatic control, Greenhouse, Single-chip microcomputer,Computer monitoring and controlling, Fuzzy control一ForewordAlong with calculator technique of development, the calculator data collect a technique and control the system acquire in the production line automation Extensive of application, it is comprehensive the calculator, data collect, the process control, network communication and sketch manifestation etc. technique, With the information obtain, processing, supervision with excellent turn a production line for purpose, have function strong, application vivid, operation squareThen etc. characteristics, have thus extensive of application foreground Gal. Be close to more than ten in the last yearses, it F the beginning is to the agriculture research, produce to get The area permeate and promoted tradition agriculture production control mode to calculator imitate, auto control mode change.Especially establish Agriculture of rise and glasshouse cultivation technique of expansion, acceleration the calculator is on the agriculture of application step[atl Iasl fttl.Together Hour control theories also along with industry and modern science technique and fly of calculator soondevelopment but experience from"classic control Theories"one"modern control theories"~"big system theories" and"intelligence control theories" one"misty control theories" Of a few stage.Misty control theories along with calculator technique of progress and oneself theories of continuously development, at not line Of, complications of hard establishment precision mathematics model of in the system get extensive of application。
单片机温度控制英文文献及翻译(适用于毕业论文外文翻译+中英文对照)
Temperature Control Using a Microcontroller:An Interdisciplinary Undergraduate Engineering Design ProjectJames S. McDonaldDepartment of Engineering ScienceTrinity UniversitySan Antonio, TX 78212AbstractThis paper describes an interdisciplinary d esign project which was done under the author’s supervision by a group of four senior students in the Department of Engineering Science at Trinity University. The objective of the project was to develop a temperature control system for an air-filled chamber. The system was to allow entry of a desired chamber temperature in a prescribed range and to exhibit overshoot and steady-state temperature error of less than 1 degree Kelvin in the actual chamber temperature step response. The details of the design developed by this group of students, based on a Motorola MC68HC05 family microcontroller, are described. The pedagogical value of the problem is also discussed through a description of some of the key steps in the design process. It is shown that the solution requires broad knowledge drawn from several engineering disciplines including electrical, mechanical, and control systems engineering.1 IntroductionThe design project which is the subject of this paper originated from a real-world application.A prototype of a microscope slide dryer had been developed around an OmegaTM modelCN-390 temperature controller, and the objective was to develop a custom temperature control system to replace the Omega system. The motivation was that a custom controller targeted specifically for the application should be able to achieve the same functionality at a much lower cost, as the Omega system is unnecessarily versatile and equipped to handle a wide variety of applications.The mechanical layout of the slide dryer prototype is shown in Figure 1. The main element of the dryer is a large, insulated, air-filled chamber in which microscope slides, each with a tissue sample encased in paraffin, can be set on caddies. In order that the paraffin maintain the proper consistency, the temperature in the slide chamber must be maintained at a desired (constant) temperature. A second chamber (the electronics enclosure) houses a resistive heater and the temperature controller, and a fan mounted on the end of the dryer blows air across theheater, carrying heat into the slide chamber. This design project was carried out during academic year 1996–97 by four students under the author’s supervision as a Senior Design project in the Department of Engineering Science at Trinity University. The purpose of this paper isto describe the problem and the students’ solution in some detail, and to discuss some of the pedagogical opportunities offered by an interdisciplinary design project of this type. The students’ own report was presented at the 1997 National Conference on Undergraduate Research [1]. Section 2 gives a more detailed statement of the problem, including performance specifications, and Section 3 describes the students’ design. Section 4 makes up the bulk of the paper, and discusses in some detail several aspects of the design process which offer unique pedagogical opportunities. Finally, Section 5 offers some conclusions.2 Problem StatementThe basic idea of the project is to replace the relevant parts of the functionality of an Omega CN-390 temperature controller using a custom-designed system. The application dictates that temperature settings are usually kept constant for long periods of time, but it’s nonetheless important that step changes be tracked in a “reasonable” manner. Thus the main requirements boil down to·allowing a chamber temperature set-point to be entered,·displaying both set-point and actual temperatures, and·tracking step changes in set-point temperature with acceptable rise time, steady-state error, and overshoot.Although not explicitly a part of the specifications in Table 1, it was clear that the customer desired digital displays of set-point and actual temperatures, and that set-point temperature entry should be digital as well (as opposed to, say, through a potentiometer setting).3 System DesignThe requirements for digital temperature displays and setpoint entry alone are enough to dictate that a microcontrollerbased design is likely the most appropriate. Figure 2 shows a block diagram of the students’ desig n.The microcontroller, a MotorolaMC68HC705B16 (6805 for short), is the heart of the system. It accepts inputs from a simple four-key keypad which allow specification of the set-point temperature, and it displays both set-point and measured chamber temperatures using two-digit seven-segment LED displays controlled by a display driver. All these inputs and outputs are accommodated by parallel ports on the 6805. Chamber temperature is sensed using apre-calibrated thermistor and input via one of the 6805’s analog-to-digital inputs. Finally, a pulse-width modulation (PWM) output on the 6805 is used to drive a relay which switches line power to the resistive heater off and on.Figure 3 shows a more detailed schematic of the electronics and their interfacing to the 6805. The keypad, a Storm 3K041103, has four keys which are interfaced to pins PA0{ PA3 of Port A, configured as inputs. One key functions as a mode switch. Two modes are supported: set mode and run mode. In set mode two of the other keys are used to specify the set-point temperature: one increments it and one decrements. The fourth key is unused at present. The LED displays are driven by a Harris Semiconductor ICM7212 display driver interfaced to pins PB0{PB6 of Port B, configured as outputs. The temperature-sensing thermistor drives, through a voltage divider, pin AN0 (one of eight analog inputs). Finally, pin PLMA (one of two PWM outputs) drives the heater relay.Software on the 6805 implements the temperature control algorithm, maintains the temperature displays, and alters the set-point in response to keypad inputs. Because it is not complete at this writing, software will not be discussed in detail in this paper. The control algorithm in particular has not been determined, but it is likely to be a simple proportional controller and certainly not more complex than a PID. Some control design issues will be discussed in Section 4, however.4 The Design ProcessAlthough essentially the project is just to build a thermostat, it presents many nice pedagogical opportunities. The knowledge and experience base of a senior engineering undergraduate are just enough to bring him or her to the brink of a solution to various aspects of the problem. Yet, in each case, realworld considerations complicate the situation significantly.Fortunately these complications are not insurmountable, and the result is a very beneficial design experience. The remainder of this section looks at a few aspects of the problem which present the type of learning opportunity just described. Section 4.1 discusses some of the features of a simplified mathematical model of the thermal properties of the system and how it can beeasily validated experimentally. Section 4.2 describes how realistic control algorithm designs can be arrived at using introductory concepts in control design. Section 4.3 points out some important deficiencies of such a simplified modeling/control design process and how they can be overcome through simulation. Finally, Section 4.4 gives an overview of some of the microcontroller-related design issues which arise and learning opportunities offered.4.1 MathematicalModelLumped-element thermal systems are described in almost any introductory linear control systems text, and just this sort of model is applicable to the slide dryer problem. Figure 4 shows a second-order lumped-element thermal model of the slide dryer. The state variables are the temperatures Ta of the air in the box and Tb of the box itself. The inputs to the system are the power output q(t) of the heater and the ambient temperature T¥. ma and mb are the masses of the air and the box, respectively, and Ca and Cb their specific heats. μ1 and μ2 are heat transfer coefficients from the air to the box and from the box to the external world, respectively.It’s not hard to show that the (linearized) state equationscorresponding to Figure 4 areTaking Laplace transforms of (1) and (2) and solving for Ta(s), which is the output of interest, gives the following open-loop model of the thermal system:where K is a constant and D(s) is a second-order polynomial.K, tz, and the coefficients ofD(s) are functions of the variousparameters appearing in (1) and (2).Of course the various parameters in (1) and (2) are completely unknown, but it’s not hard to show that, regardless of their values, D(s) has two real zeros. Therefore the main transfer function of interest (which isthe one from Q(s), since we’ll assume constant ambient temperature) can be writtenMoreover, it’s not too hard to show that 1=tp1 <1=tz <1=tp2, i.e., that the zero lies between the two poles. Both of these are excellent exercises for the student, and the result is the openloop pole-zero diagram of Figure 5.Obtaining a complete thermal model, then, is reduced to identifying the constant K and the three unknown time constants in (3). Four unknown parameters is quite a few, but simple experiments show that 1=tp1 _ 1=tz;1=tp2 so that tz;tp2 _ 0 are good approximations. Thus the open-loop system is essentially first-order and can therefore be written(where the subscript p1 has been dropped).Simple open-loop step response experiments show that,for a wide range of initial temperatures and heat inputs, K _0:14 _=W and t _ 295 s.14.2 Control System DesignUsing the first-order model of (4) for the open-loop transfer function Gaq(s) and assuming for the moment that linear control of the heater power output q(t) is possible, the block diagram of Figure 6 represents the closed-loop system. Td(s) is the desired, or set-point, temperature,C(s) is the compensator transfer function, and Q(s) is the heater output in watts.Given this simple situation, introductory linear control design tools such as the root locus method can be used to arrive at a C(s) which meets the step response requirements on rise time, steady-state error, and overshoot specified in Table 1. The upshot, of course, is that a proportional controller with sufficient gain can meet all specifications. Overshoot is impossible, and increasing gains decreases both steady-state error and rise time.Unfortunately, sufficient gain to meet the specifications may require larger heat outputs than the heater is capable of producing. This was indeed the case for this system, and the result is that the rise time specification cannot be met. It is quite revealing to the student how useful such an oversimplified model, carefully arrived at, can be in determining overall performance limitations.4.3 Simulation ModelGross performance and its limitations can be determined using the simplified model of Figure 6, but there are a number of other aspects of the closed-loop system whose effects on performance are not so simply modeled. Chief among these are·quantization error in analog-to-digital conversion of the measured temperature and· the use of PWM to control the heater.Both of these are nonlinear and time-varying effects, and the only practical way to study them is through simulation (or experiment, of course).Figure 7 shows a SimulinkTM block diagram of the closed-loop system which incorporates these effects. A/D converter quantization and saturation are modeled using standard Simulink quantizer and saturation blocks. Modeling PWM is more complicated and requires a customS-function to represent it.This simulation model has proven particularly useful in gauging the effects of varying thebasic PWM parameters and hence selecting them appropriately. (I.e., the longer the period, the larger the temperature error PWM introduces. On the other hand, a long period is desirable to avoid excessive relay “chatter,” among other things.) PWM is often difficult for students to grasp, and the simulation model allows an exploration of its operation and effects which is quite revealing.4.4 The MicrocontrollerSimple closed-loop control, keypad reading, and display control are some of the classic applications of microcontrollers, and this project incorporates all three. It is therefore an excellent all-around exercise in microcontroller applications. In addition, because the project isto produce an actual packaged prototype, it won’t do to use a simple evaluation board with theI/O pins jumpered to the target system. Instead, it’s necessary to develop a complete embedded application. This entails the choice of an appropriate part from the broad range offered in a typical microcontroller family and learning to use a fairly sophisticated development environment. Finally, a custom printed-circuit board for the microcontroller and peripherals must be designed and fabricated.Microcontroller Selection. In view of existing local expertise, the Motorola line of microcontrollers was chosen for this project. Still, this does not narrow the choice down much. A fairly disciplined study of system requirements is necessary to specify which microcontroller, out of scores of variants, is required for the job. This is difficult for students, as they generally lack the experience and intuition needed as well as the perseverance to wade through manufacturers’ selection guides.Part of the problem is in choosing methods for interfacing the various peripherals (e.g., what kind of display driver should be used?). A study of relevant Motorola application notes [2, 3, 4] proved very helpful in understandingwhat basic approaches are available, and what microcontroller/peripheral combinations should be considered.The MC68HC705B16 was finally chosen on the basis of its availableA/D inputs and PWMoutputs as well as 24 digital I/O lines. In retrospect this is probably overkill, as only oneA/D channel, one PWM channel, and 11 I/O pins are actually required (see Figure 3). The decision was made to err on the safe side because a complete development system specific to the chosen part was necessary, and the project budget did not permit a second such system to be purchased should the firstprove inadequate.Microcontroller Application Development. Breadboarding of the peripheral hardware, development of microcontroller software, and final debugging and testing of a customprinted-circuit board for the microcontroller and peripherals all require a development environment of some kind. The choice of a development environment, like that of themicrocontroller itself, can be bewildering and requires some faculty expertise. Motorola makes three grades of development environment ranging from simple evaluation boards (at around $100) to full-blown real-time in-circuit emulators (at more like $7500). The middle option was chosen for this project: the MMEVS, which consists of _ a platform board (which supports all 6805-family parts), _ an emulator module (specific to B-series parts), and _ a cable and target head adapter (package-specific). Overall, the system costs about $900 and provides, with some limitations, in-circuit emulation capability. It also comes with the simple but sufficient software development environment RAPID [5].Students find learning to use this type of system challenging, but the experience they gain in real-world microcontroller application development greatly exceeds the typical first-course experience using simple evaluation boards.Printed-Circuit Board. The layout of a simple (though definitely not trivial) printed-circuit board is another practical learning opportunity presented by this project. The final board layout, with package outlines, is shown (at 50% of actual size) in Figure 8. The relative simplicity of the circuit makes manual placement and routing practical—in fact, it likely gives better results than automatic in an application like this—and the student is therefore exposed to fundamental issues of printed-circuit layout and basic design rules. The layout software used was the very nice package pcb,2 and the board was fabricated in-house with the aid of our staff electronics technician.5 ConclusionThe aim of this paper has been to describe an interdisciplinary, undergraduate engineering design project: a microcontroller- based temperature control system with digital set-point entry and set-point/actual temperature display. A particular design of such a system has been described, and a number of design issues which arise—from a variety of engineering disciplines—have been discussed. Resolution of these issues generally requires knowledge beyond that acquired in introductory courses, but realistically accessible to advance undergraduate students, especiallywith the advice and supervision of faculty.Desirable features of the problem, from a pedagogical viewpoint, include the use of a microcontroller with simple peripherals, the opportunity to usefully apply introductorylevel modeling of physical systems and design of closed-loop controls, and the need for relatively simple experimentation (for model validation) and simulation (for detailed performance prediction). Also desirable are some of the technologyrelated aspects of the problem including practical use of resistive heaters and temperature sensors (requiring knowledge of PWM and calibration techniques, respectively), microcontroller selection and use of development systems, and printedcircuit design.AcknowledgementsThe author would like to acknowledge the hard work, dedication, and ability shown by the students involved in this project: Mark Langsdorf, Matt Rall, PamRinehart, and David Schuchmann. It is their project, and credit for its success belongs to them.References[1] M. Langsdorf, M. Rall, D. Schuchmann, and P. Rinehart,“Temperature control of a microscope slide dryer,” in1997 National Conference on Undergraduate Research,(Austin, TX), April 1997. Poster presentation.[2] Motorola, Inc., Phoenix, AZ, Temperature Measurementand Display Using the MC68HC05B4 and the MC14489,1990. Motorola SemiconductorApplicationNote AN431.[3] Motorola, Inc., Phoenix, AZ, HC05 MCU LED DriveTechniques Using the MC68HC705J1A, 1995. MotorolaSemiconductor Application Note AN1238.[4] Motorola, Inc., Phoenix, AZ, HC05MCU Keypad DecodingTechniques Using the MC68HC705J1A, 1995. MotorolaSemiconductor Application Note AN1239.[5] Motorola, Inc., Phoenix, AZ, RAPID Integrated DevelopmentEnvironment User’s Manual, 1993. (RAPID wasdeveloped by P & E Microcomputer Systems, Inc.).单片机温度控制:一个跨学科的本科生工程设计项目JamesS.McDonald工程科学系三一大学德克萨斯州圣安东尼奥市78212摘要本文所描述的是作者领导由四个三一大学高年级学生组成的团队进行的一个跨学科工程项目的设计。
单片机温度控制系统论文中英文资料对照外文翻译文献
单片机温度控制系统论文中英文资料对照外文翻译文献原文题目:Single-chip microcomputer temperature control system DescriptionThe at89s52 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash Programmable and Erasable Read Only Memory (PEROM) and 128 bytes RAM. The device is manufactured using Atmel’s high density nonvolatile memory technology and is compatible with the industry standard MCS-51™ instruction set and pinout. The chip combines a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel at89s52 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications.Features:• Compatible with MCS-51™ Products• 4K Bytes of In-System Reprogrammable Flash Memory• Endurance: 1,000 Write/Erase Cycles• Fully Static Operation: 0 Hz to 24 MHz• Three-Level Program Memory Lock• 128 x 8-Bit Internal RAM• 32 Programmable I/O Lines• Two 16-Bit Timer/Counters• Six Interrupt Sources• Programmable Serial Channel• Low Power Idle and Po wer Down ModesThe at89s52 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the at89s52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM,timer/counters, serial port and interrupt system to continue functioning. The Power Down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.Pin Description:VCC Supply voltage.GND Ground.Port 0Port 0 is an 8-bit open drain bidirectional I/O port. As an output port each pin can sink eight TTL inputs. When is are written to port 0 pins, the pins can be used as high impedance inputs.Port 0 may also be configured to be the multiplexed loworder address/data bus during accesses to external program and data memory. In this mode P0 has internal pullups.Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pullups are required during program verification.Port 1Port 1 is an 8-bit bidirectional I/O port with internal pullups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pullups.Port 1 also receives the low-order address bytes during Flash programming and verification.Port 2Port 2 is an 8-bit bidirectional I/O port with internal pullups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pullups.Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses (MOVX @ DPTR). In this application it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register.Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.Port 3Port 3 is an 8-bit bidirectional I/O port with internal pullups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pullups.Port 3 also serves the functions of various special features of the at89s52 as listed below:Port pin alternate functionsP3.0 rxd (serial input port)P3.1 txd (serial output port)P3.2 ^int0 (external interrupt0)Port 3 also receivessome control signals forFlash programming andverification. RSTReset input. A high on this pin for two machine cycles while the oscillator is runningresets the device.ALE/PROGAddress Latch Enable output pulse for latching the low byte of the address duringaccesses to external memory. This pin is also the program pulse input (PROG) during Flash programming.In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory.If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.PSENProgram Store Enable is the read strobe to external program memory.When the at89s52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.EA/VPPExternal Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset.EA should be strapped to VCC for internal program executions.This pin also receives the 12-volt programming enable voltage(VPP) during Flashprogramming, for parts that require 12-volt VPP.XTAL1Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2Output from the inverting oscillator amplifier.Oscillator CharacteristicsXTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifierwhich can be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed. P3.3 ^int1 (external interrupt1) P3.4 t0 (timer0 external input) P3.5 t1 (timer1 external input) P3.6 ^WR (external data memory write strobe) P3.7^rd (external data memory read strobe)Idle ModeIn idle mode, the CPU puts itself to sleep while all the onchip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset.It should be noted that when idle is terminated by a hard ware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory.Status of External Pins During Idle and Power Down Modesmode Program memory ALE ^psen Port0 Port1Port2Port3idle internal 1 1 data data data DataIdle External 1 1 float Data data Data Power down Internal 0 0 Data Data Data Data Power down External 0 0 float data Data data Power Down ModeIn the power down mode the oscillator is stopped, and the instruction that invokes power down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the power down mode is terminated. The only exit from power down is a hardware reset. Reset redefines the SFRs but does not change the on-chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize.Program Memory Lock BitsOn the chip are three lock bits which can be left unprogrammed (U) or can be programmed (P) to obtain the additional features listed in the table below:Lock Bit Protection ModesWhen lock bit 1 is programmed, the logic level at the EA pin is sampled and latchedduring reset. If the device is powered up without a reset, the latch initializes to a random value, and holds that value until reset is activated. It is necessary that the latched value of EA be in agreement with the current logic level at that pin in order for the device to function properly. Programming the Flash:The at89s52 is normally shipped with the on-chip Flash memory array in the erased state (that is, contents = FFH) and ready to be programmed.The programming interface accepts either a high-voltage (12-volt) or a low-voltage (VCC) program enable signal.The low voltage programming mode provides a convenient way to program the at89s52 inside the user’s system, while the high-voltage programming mode is compatible with conventional third party Flash or EPROM programmers.The at89s52 is shipped with either the high-voltage or low-voltage programming mode enabled. The respective top-side marking and device signature codes are listed in the following table.Vpp=12v Vpp=5vTop-side mark at89s52xxxxyywwat89s52xxxx-5yywwsignature (030H)=1EH(031H)=51H(032H)=FFH (030H)=1EH (031H)=51H (032H)=05HThe at89s52 code memory array is programmed byte-bybyte in either programming mode. To program any nonblank byte in the on-chip Flash Programmable and Erasable Read Only Memory, the entire memory must be erased using the Chip Erase Mode. Programming Algorithm:Before programming the at89s52, the address, data and control signals should be set up according to the Flash programming mode table and Figures 3 and 4. To program the at89s52, take the following steps.1. Input the desired memory location on the address lines.2. Input the appropriate data byte on the data lines.3. Activate the correct combination of control signals.4. Raise EA/VPP to 12V for the high-voltage programming mode.5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. Thebyte-write cycle is self-timed and typically takes no more than 1.5 ms. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached.Data Polling: The at89s52 features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the complement of the written datum on PO.7. Once the write cycle has been completed, true data are valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated.Ready/Busy: The progress of byte programming can also be monitored by theRDY/BSY output signal. P3.4 is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is pulled high again when programming is done to indicate READY.Program Verify: If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read back via the address and data lines for verification. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled.Chip Erase: T he entire Flash Programmable and Erasable Read Only Memory array is erased electrically by using the proper combination of control signals and by holdingALE/PROG low for 10 ms. The code array is written with all “1”s. The chip erase operation must be executed before the code memory can be re-programmed.Reading the Signature Bytes: The signature bytes are read by the same procedure as a normal verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values returned are as follows.(030H) = 1EH indicates manufactured by Atmel(031H) = 51H indicates 89C51(032H) = FFH indicates 12V programming(032H) = 05H indicates 5V programmingProgramming InterfaceEvery code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is selftimed and once initiated, will automatically time itself to completion.译文题目:单片机温度控制系统描述at89s52是美国ATMEL公司生产的低电压,高性能CMOS8位单片机,片内含4Kbytes 的快速可擦写的只读程序存储器(PEROM)和128 bytes 的随机存取数据存储器(RAM),器件采用ATMEL公司的高密度、非易失性存储技术生产,兼容标准MCS-51产品指令系统,片内置通用8位中央处理器(CPU)和flish存储单元,功能强大at89s52单片机可为您提供许多高性价比的应用场合,可灵活应用于各种控制领域。
基于单片机的温湿度控制系统英文文献
英文文献翻译学生姓名刘学毅专业自动化学号*******分院电子工程分院2012年 6 月1. 外文原文A: Fundamentals of Single-chip MicrocomputerTh e s i n gl e-chi p m i cr o co m p ut er i s t h e cul m i n a t i o n of bot h t h e d e v el opm e nt o f t he di gi t a l c om p ut e r a n d t h e i n t e gr a t ed ci r cu i t a rgu a b l y t h e t ow m o st si gn i fi c ant i nv en t i on s of t h e 20t h ce n t u r yT h es e t ow t yp e s o f a r chi t ec t u r e a re f ou nd i n s i n gl e-c hi p m i c r o com pu t e r.S om e e m p l o y t h e s pl i t p r o gr am/d at a m e m or y o f t h e H ar v a rd a r ch i t e c t ur e, ot h e rs fol l o w t h e ph i l os o ph y,wi d el y a d a pt ed f or ge n e r al-pu rp os e co m p ut er s an d m i c r op ro c es s o r s,o f m a ki n g no l o gi c a l d i st i n ct i o n b et w een pr o gr am an d d at a m em o r y a s i n t h e P r i n c et on a r c hi t ec t u r e, s ho w n i n Fi g.3-5A-2.In ge n e r a l t e rm s a s i n gl e-chi p m i c ro co m p ut e r i s ch a r ac t e r i z ed b y t h e i n c o rp or a t i on o f al l t h e u ni t s o f a c om p ut e r i nt o a s i n gl e d e vi c e.Read only memory (ROM)R OM i s us ua l l y f o r t h e p er m an e nt,no n-vo l at i l e s t o ra ge o f a n a p pl i c a t i o ns p r o gr am .M an y m i c ro co m p ut e rs an d m i c ro c on t rol l er s a r e i n t en de d fo r h i gh-v ol u m e a pp l i c at i on s an d he n c e t h e e c o no m i c al m a nu f ac t ur e o f t h e d evi c es r e qui r es t h at t h e c o nt e nt s o f t h e p ro gr a m m e m or y b e c o m m i t t e d p er m a n en t l y d u r i n g t he m a nu f a ct ur e o f chi p s . C l e a rl y, t hi s i m pl i e s a r i go ro us ap p ro a c h t o R OM co d e d ev el op m ent s i n c e c h ange s c a nn ot b e m a d e af t er m a nu f a ct ur e.T hi s d e v el o pm e nt p r o ce s s m a y i n v ol v e em ul at i o n u si n g a so ph i s t i ca t e d d ev el op m ent s ys t em wi t h a h a rd w a r e e m ul at i on ca p ab i l i t y a s w el l a s t h e u s e of p ow e r fu l s o ft w ar e t ool s.S om e m a nu f a ct ur er s p ro vi de ad di t i o n al R O M opt i o ns b y i n cl u di n g i n t h ei r r a n ge d evi c e s wi t h (o r i nt e nd e d fo r u s e wi t h) u s e r p r o gr am m a bl e m e m o r y.T he si m pl es t o f t h es e i s u s u al l y d e vi c e wh i ch c an op e r at e i n a m i c ro pro c e s s or m o d e b y u s i n g so m e o f t h e i np ut/o ut p ut l i n es a s an a dd r ess a nd d at a bu s f o r a c c e ss i n g ex t er n al m em o r y.T hi s t yp e o f d ev i ce c a n b e ha v e f un c t i on al l y a s t h e si n gl e chi p m i cr o c om p ut e r f r om wh i ch i t i s d er i v e d al b e i t w i t h r e st ri c t ed I/O an d a m od i f i ed ex t er n al c i r c ui t. T h e u s e o f t h es e R OM l ess d ev i c es i s c om m on e v en i n pr o du ct i o n ci r cu i t s w h e r e t h e v ol um e d o es n ot j us t i f y t h e d ev e l o pm e n t c os t s o f cu s t om on-ch i p R OM[2];t he r e c a n s t i l l be a si gni fi c an t s avi n g i n I/O an d ot h er c h i p s c om p ar e d t o a c on v en t i o n al m i c ro p ro c es so r ba s ed c i r c ui t. M o r e ex a c t r ep l ac em e nt f o r R O M de vi c es c an b e o bt ai ne d i n t h e f o rm o f v a ri a nt s wi t h 'pi gg y-b a c k' E P R OM(E ra s ab l e p ro gr a m m a bl e R OM)so ck e t s or de v i ce s wi t h EP R OM i n s t e ad of R O M。
单片机温度控制英文文献及翻译
Temperature Control Using a Microcontroller:An Interdisciplinary Undergraduate Engineering Design ProjectJames S. McDonaldDepartment of Engineering ScienceTrinity UniversitySan Antonio, TX 78212AbstractThis paper describes an interdisciplinary desig n project which was done under the author’s supervision by a group of four senior students in the Department of Engineering Science at Trinity University. The objective of the project was to develop a temperature control system for an air-filled chamber. The system was to allow entry of a desired chamber temperature in a prescribed range and to exhibit overshoot and steady-state temperature error of less than 1 degree Kelvin in the actual chamber temperature step response. The details of the design developed by this group of students, based on a Motorola MC68HC05 family microcontroller, are described. The pedagogical value of the problem is also discussed through a description of some of the key steps in the design process. It is shown that the solution requires broad knowledge drawn from several engineering disciplines including electrical, mechanical, and control systems engineering.1 IntroductionThe design project which is the subject of this paper originated from a real-world application.A prototype of a microscope slide dryer had been developed around an OmegaTM modelCN-390 temperature controller, and the objective was to develop a custom temperature control system to replace the Omega system. The motivation was that a custom controller targeted specifically for the application should be able to achieve the same functionality at a much lower cost, as the Omega system is unnecessarily versatile and equipped to handle a wide variety of applications.The mechanical layout of the slide dryer prototype is shown in Figure 1. The main element of the dryer is a large, insulated, air-filled chamber in which microscope slides, each with a tissue sample encased in paraffin, can be set on caddies. In order that the paraffin maintain the proper consistency, the temperature in the slide chamber must be maintained at a desired (constant) temperature. A second chamber (the electronics enclosure) houses a resistive heater and the temperature controller, and a fan mounted on the end of the dryer blows air across the heater, carrying heat into the slide chamber. This design project was carried out during academic year 1996–97 by four students under the author’s supervision as a Senior Design project in the Department of Engineering Science at Trinity University. The purpose of this paper isto describe the problem and the students’ solution in some detail, and to discuss some of the pedagogical opportunities offered by an interdisciplinary design project of this type. The students’ own report was presented at the 1997 Nat ional Conference on Undergraduate Research [1]. Section 2 gives a more detailed statement of the problem, including performance specifications, and Section 3 describes the students’ design. Section 4 makes up the bulk of the paper, and discusses in some detail several aspects of the design process which offer unique pedagogical opportunities. Finally, Section 5 offers some conclusions.2 Problem StatementThe basic idea of the project is to replace the relevant parts of the functionality of an Omega CN-390 temperature controller using a custom-designed system. The application dictates that temperature settings are usually kept constant for long periods of time, but it’s nonetheless important that step changes be tracked in a ―reasonable‖ manner. Thus the mai n requirements boil down to·allowing a chamber temperature set-point to be entered,·displaying both set-point and actual temperatures, and·tracking step changes in set-point temperature with acceptable rise time, steady-state error, and overshoot.Although not explicitly a part of the specifications in Table 1, it was clear that the customer desired digital displays of set-point and actual temperatures, and that set-point temperature entry should be digital as well (as opposed to, say, through a potentiometer setting).3 System DesignThe requirements for digital temperature displays and setpoint entry alone are enough to dictate that a microcontrollerbased design is likely the most appropriate. Figure 2 shows a block diagram of the students’ design.The microcontroller, a MotorolaMC68HC705B16 (6805 for short), is the heart of the system. It accepts inputs from a simple four-key keypad which allow specification of the set-point temperature, and it displays both set-point and measured chamber temperatures using two-digit seven-segment LED displays controlled by a display driver. All these inputs and outputs are accommodated by parallel ports on the 6805. Chamber temperature is sensed using apre-calibrated thermistor and input via one of the 6805’s an alog-to-digital inputs. Finally, a pulse-width modulation (PWM) output on the 6805 is used to drive a relay which switches line power to the resistive heater off and on.Figure 3 shows a more detailed schematic of the electronics and their interfacing to the 6805. The keypad, a Storm 3K041103, has four keys which are interfaced to pins PA0{ PA3 of Port A, configured as inputs. One key functions as a mode switch. Two modes are supported: set mode and run mode. In set mode two of the other keys are used to specify the set-point temperature: one increments it and one decrements. The fourth key is unused at present. The LED displays are driven by a Harris Semiconductor ICM7212 display driver interfaced to pins PB0{PB6 of Port B, configured as outputs. The temperature-sensing thermistor drives, through a voltage divider, pin AN0 (one of eight analog inputs). Finally, pin PLMA (one of two PWM outputs) drives the heater relay.Software on the 6805 implements the temperature control algorithm, maintains the temperature displays, and alters the set-point in response to keypad inputs. Because it is not complete at this writing, software will not be discussed in detail in this paper. The control algorithm in particular has not been determined, but it is likely to be a simple proportional controller and certainly not more complex than a PID. Some control design issues will be discussed in Section 4, however.4 The Design ProcessAlthough essentially the project is just to build a thermostat, it presents many nice pedagogical opportunities. The knowledge and experience base of a senior engineering undergraduate are just enough to bring him or her to the brink of a solution to various aspects of the problem. Yet, in each case, realworld considerations complicate the situation significantly.Fortunately these complications are not insurmountable, and the result is a very beneficial design experience. The remainder of this section looks at a few aspects of the problem which present the type of learning opportunity just described. Section 4.1 discusses some of the featuresof a simplified mathematical model of the thermal properties of the system and how it can beeasily validated experimentally. Section 4.2 describes how realistic control algorithm designs can be arrived at using introductory concepts in control design. Section 4.3 points out some important deficiencies of such a simplified modeling/control design process and how they can be overcome through simulation. Finally, Section 4.4 gives an overview of some of the microcontroller-related design issues which arise and learning opportunities offered.4.1 MathematicalModelLumped-element thermal systems are described in almost any introductory linear control systems text, and just this sort of model is applicable to the slide dryer problem. Figure 4 shows a second-order lumped-element thermal model of the slide dryer. The state variables are the temperatures Ta of the air in the box and Tb of the box itself. The inputs to the system are the power output q(t) of the heater and the ambient temperature T¥. ma and mb are the masses of the air and the box, respectively, and Ca and Cb their specific heats. μ1 and μ2 are heat transfer coefficients from the air to the box and from the box to the external world, respectively.It’s not hard to show that the (linearized) state equationscorresponding to Figure 4 areTaking Laplace transforms of (1) and (2) and solving for Ta(s), which is the output of interest, gives the following open-loop model of the thermal system:where K is a constant and D(s) is a second-order polynomial.K, tz, and the coefficients ofD(s) are functions of the variousparameters appearing in (1) and (2).Of course the various parameters in (1) and (2) are completely unknown, but it’s not hard to show that, regardless of their values, D(s) has two real zeros. Therefore the main transfer function of interest (which isthe one from Q(s), si nce we’ll assume constant ambient temperature) can be writtenMoreover, it’s not too hard to show that 1=tp1 <1=tz <1=tp2, i.e., that the zero lies between the two poles. Both of these are excellent exercises for the student, and the result is the openloop pole-zero diagram of Figure 5.Obtaining a complete thermal model, then, is reduced to identifying the constant K and the three unknown time constants in (3). Four unknown parameters is quite a few, but simple experiments show that 1=tp1 _ 1=tz;1=tp2 so that tz;tp2 _ 0 are good approximations. Thus the open-loop system is essentially first-order and can therefore be written(where the subscript p1 has been dropped).Simple open-loop step response experiments show that,for a wide range of initial temperatures and heat inputs, K _0:14 _=W and t _ 295 s.14.2 Control System DesignUsing the first-order model of (4) for the open-loop transfer function Gaq(s) and assuming for the moment that linear control of the heater power output q(t) is possible, the block diagram of Figure 6 represents the closed-loop system. Td(s) is the desired, or set-point, temperature,C(s) is the compensator transfer function, and Q(s) is the heater output in watts.Given this simple situation, introductory linear control design tools such as the root locus method can be used to arrive at a C(s) which meets the step response requirements on rise time, steady-state error, and overshoot specified in Table 1. The upshot, of course, is that a proportional controller with sufficient gain can meet all specifications. Overshoot is impossible, and increasing gains decreases both steady-state error and rise time.Unfortunately, sufficient gain to meet the specifications may require larger heat outputs than the heater is capable of producing. This was indeed the case for this system, and the result is that the rise time specification cannot be met. It is quite revealing to the student how useful such an oversimplified model, carefully arrived at, can be in determining overall performance limitations.4.3 Simulation ModelGross performance and its limitations can be determined using the simplified model of Figure 6, but there are a number of other aspects of the closed-loop system whose effects on performance are not so simply modeled. Chief among these are·quantization error in analog-to-digital conversion of the measured temperature and· the use of PWM to control the heater.Both of these are nonlinear and time-varying effects, and the only practical way to study them is through simulation (or experiment, of course).Figure 7 shows a SimulinkTM block diagram of the closed-loop system which incorporates these effects. A/D converter quantization and saturation are modeled using standard Simulink quantizer and saturation blocks. Modeling PWM is more complicated and requires a customS-function to represent it.This simulation model has proven particularly useful in gauging the effects of varying thebasic PWM parameters and hence selecting them appropriately. (I.e., the longer the period, the larger the temperature error PWM introduces. On the other hand, a long period is desirable to avoid excessive relay ―chatter,‖ among other things.) PWM is often difficult for students to grasp, and the simulation model allows an exploration of its operation and effects which is quite revealing.4.4 The MicrocontrollerSimple closed-loop control, keypad reading, and display control are some of the classic applications of microcontrollers, and this project incorporates all three. It is therefore an excellent all-around exercise in microcontroller applications. In addition, because the project isto produce an actual packaged prototype, it won’t do to use a simple evaluation board with theI/O pins jumpered to the target system. Instead, it’s necessary to d evelop a complete embedded application. This entails the choice of an appropriate part from the broad range offered in a typical microcontroller family and learning to use a fairly sophisticated development environment. Finally, a custom printed-circuit board for the microcontroller and peripherals must be designed and fabricated.Microcontroller Selection. In view of existing local expertise, the Motorola line of microcontrollers was chosen for this project. Still, this does not narrow the choice down much. A fairly disciplined study of system requirements is necessary to specify which microcontroller, out of scores of variants, is required for the job. This is difficult for students, as they generally lack the experience and intuition needed as well as the perseverance to wade through manufacturers’ selection guides.Part of the problem is in choosing methods for interfacing the various peripherals (e.g., what kind of display driver should be used?). A study of relevant Motorola application notes [2, 3, 4] proved very helpful in understandingwhat basic approaches are available, and what microcontroller/peripheral combinations should be considered.The MC68HC705B16 was finally chosen on the basis of its availableA/D inputs and PWMoutputs as well as 24 digital I/O lines. In retrospect this is probably overkill, as only oneA/D channel, one PWM channel, and 11 I/O pins are actually required (see Figure 3). The decision was made to err on the safe side because a complete development system specific to the chosen part was necessary, and the project budget did not permit a second such system to be purchased should the firstprove inadequate.Microcontroller Application Development. Breadboarding of the peripheral hardware, development of microcontroller software, and final debugging and testing of a customprinted-circuit board for the microcontroller and peripherals all require a development environment of some kind. The choice of a development environment, like that of themicrocontroller itself, can be bewildering and requires some faculty expertise. Motorola makes three grades of development environment ranging from simple evaluation boards (at around $100) to full-blown real-time in-circuit emulators (at more like $7500). The middle option was chosen for this project: the MMEVS, which consists of _ a platform board (which supports all 6805-family parts), _ an emulator module (specific to B-series parts), and _ a cable and target head adapter (package-specific). Overall, the system costs about $900 and provides, with some limitations, in-circuit emulation capability. It also comes with the simple but sufficient software development environment RAPID [5].Students find learning to use this type of system challenging, but the experience they gain in real-world microcontroller application development greatly exceeds the typical first-course experience using simple evaluation boards.Printed-Circuit Board. The layout of a simple (though definitely not trivial) printed-circuit board is another practical learning opportunity presented by this project. The final board layout, with package outlines, is shown (at 50% of actual size) in Figure 8. The relative simplicity of the circuit makes manual placement and routing practical—in fact, it likely gives better results than automatic in an application like this—and the student is therefore exposed to fundamental issues of printed-circuit layout and basic design rules. The layout software used was the very nice package pcb,2 and the board was fabricated in-house with the aid of our staff electronics technician.5 ConclusionThe aim of this paper has been to describe an interdisciplinary, undergraduate engineering design project: a microcontroller- based temperature control system with digital set-point entry and set-point/actual temperature display. A particular design of such a system has been described, and a number of design issues which arise—from a variety of engineering disciplines—have been discussed. Resolution of these issues generally requires knowledge beyond that acquired in introductory courses, but realistically accessible to advance undergraduate students, especiallywith the advice and supervision of faculty.Desirable features of the problem, from a pedagogical viewpoint, include the use of a microcontroller with simple peripherals, the opportunity to usefully apply introductorylevel modeling of physical systems and design of closed-loop controls, and the need for relatively simple experimentation (for model validation) and simulation (for detailed performance prediction). Also desirable are some of the technologyrelated aspects of the problem including practical use of resistive heaters and temperature sensors (requiring knowledge of PWM and calibration techniques, respectively), microcontroller selection and use of development systems, and printedcircuit design.AcknowledgementsThe author would like to acknowledge the hard work, dedication, and ability shown by the students involved in this project: Mark Langsdorf, Matt Rall, PamRinehart, and David Schuchmann. It is their project, and credit for its success belongs to them.References[1] M. Langsdorf, M. Rall, D. Schuchmann, and P. Rinehart,―Temperature control of a microscope slide dryer,‖ in1997 National Conference on Undergraduate Research,(Austin, TX), April 1997. Poster presentation.[2] Motorola, Inc., Phoenix, AZ, Temperature Measurementand Display Using the MC68HC05B4 and the MC14489,1990. Motorola SemiconductorApplicationNote AN431.[3] Motorola, Inc., Phoenix, AZ, HC05 MCU LED DriveTechniques Using the MC68HC705J1A, 1995. MotorolaSemiconductor Application Note AN1238.[4] Motorola, Inc., Phoenix, AZ, HC05MCU Keypad DecodingTechniques Using the MC68HC705J1A, 1995. MotorolaSemiconductor Application Note AN1239.[5] Motorola, Inc., Phoenix, AZ, RAPID Integrated DevelopmentEnvironment User’s Manual, 1993. (RAPID wasdeveloped by P & E Microcomputer Systems, Inc.).单片机温度控制:一个跨学科的本科生工程设计项目JamesS.McDonald工程科学系三一大学德克萨斯州圣安东尼奥市78212摘要本文所描述的是作者领导由四个三一大学高年级学生组成的团队进行的一个跨学科工程项目的设计。
温湿度控制中英文
外文原文Single chip microcomputer and the development of the temperature and humidity sensorAbstract:Temperature control system has been widely used over the past decades. In this paper, a general architecture of distributed temperature control system is put forward based on multi-sensor data fusion and CAN bus. A new method of multi-sensor data fusion based on parameter estimation is proposed for the distributed temperature control system. The major feature of the system is its generality, which is suitable for many fields of large scale temperature control. Experiment shows that this system possesses higher accuracy, reliability, good real—time characteristic and wide application prospectBorn in the 1970 s single chip microcomputer, and experience the SCM, MCU, SOC three phases.(1) SCM namely Single Chip computer stage, main is to seek out the monolithic forms of the embedded system best system structure. "Innovation mode" success, laid the SCM and general computer completely different development road.(2) MCU namely Micro Controller (Micro Controller Unit) stage, the main technological development direction is: expanding meet embedded application, the object system requirements of various peripheral circuit and interface circuit, dash forward show its object the intelligent control ability.(3) MCU is embedded system independent development way, to a key factor to the development of MCU stage, is to seek application system on a chip in the maximization of the solution; Therefore, special MCU development natural form the SOC tendency. With microelectronics technology, IC design, EDA tools development, based on the single chip microcomputer application system SOC design can have larger development.Temperature is a basic physical quantities, everything in nature is closely related with the process of temperature. The temperature sensoris the earliest development, the most widely used kind of sensor. From 17 th century people began to use temperature measuring. The temperature sensor there are four main types: thermocouple, thermal resistance, resistance temperature detector (RTD) and temperature sensor IC. IC temperature sensor and including analog output and digital output two types. Contact temperature sensor detection part and the tested object has a good contact, and calls the thermometer. The thermometer through the transmission or convection reach thermal equilibrium, thus make the thermometer and value can be measured directly says the temperature of the objects. General measurement precision. In a certain temperature range, the thermometer can also be measuring objects of internal temperature distribution. But for sports body, small target or heat capacity is very small objects will produce larger measurement error, commonly used a thermometer have two-metal thermometer, glass liquid thermometer, pressure type thermometer, resistance thermometers, thermistors and temperature difference electric dipole, etc. Contactless temperature sensor sensitive components and tested object each other is not contact, again say non-contact highlighted.it table. This instrument can be used to measure movement object, small goals and heat capacity small or temperature change quickly (transient) the surface temperature of the object, also can used for the measurement of the temperature distribution.Distributed temperature control system has been widely used in our daily life and production, including intelligent building, greenhouse, constant temperature workshop, large and medium granary, depot, and soon[1]. This kind of system should ensure that the environment temperaturecan be kept between two predefined limits. In the conventional temperature measurement systems we build a network through RS-485 Bus using a single-chip metering system based on temperature sensors. With the aid of the network, we can carry out centralized monitoring and controlling. However, when the monitoring area is much more widespread and transmission distance becomes farther, the disadvantages of RS-485 Bus become more obvious. In this situation, the transmission and response speed becomes lower, the anti-interference ability becomes worse. Therefore, we shouldseek out a new communication method to solve the problems produced by RS-485 Bus.During all the communication manners, the industrial control-oriented field bus technology can ensure that we can break through the limitation of traditional point to point communication mode and build up a real distributed control and centralized management system. As a serial communication protocol supporting distributed real-time control, CAN bus has much more merits than RS-485 Bus, such as better error correction ability, better real-time ability, lower cost and so on. Presently, it has been extensively used in the implementation of distributed measurement and control domains.With the development of sensory technology, more and more systems begin to adopt multi-sensor data fusion technology to improve their performances. Multi-sensor data fusion is a kind of paradigm for integrating the data from multiple sources to synthesize the newinformation so that the whole is greater than the sum of its parts [3][4][5].And it is a critical task both in the contemporary and future systems which have distributed networks of low-cost, resource-constrained sensors1.AVR devices profileA VR MCU is 1997 by ATMEL company developed of enhanced the built-in Flash RISC (Reduced Instruction Set CPU) Reduced Instruction Set high speed eight microcontroller. AVR single-chip can be widely used in computer external equipment, industrial real-time control, instrument and apparatus, communication equipment, household electrical appliances, etc. In 1997, the Atmel company Norway design center of Mr. A and V sir, the use of the new technology Atmel company Flash, to research the RISC reduced instruction set high speed eight microcontroller, hereinafter referred to as the AVR.Avr microcontroller characteristicsAVR microcontroller hardware structure take eight machine and 16 machine of compromise strategies that use local registers of deposit (32 register file) and monomer high-speed input/output scheme (i.e. input capture registers, output is matching register and the corresponding control logic). Improve the instruction execution speed (1 Mips/MHz), overcome the bottlenecks, and enhance the function; At the same time, reduce the cost of the management of foreign set, relative simplified the hardware structure, reduce the costs. So AVR microcomputer in the soft/hardware cost, speed, performance and cost many has made optimization balance, is a cost-effective microcontroller.AVR SCM's I/O line can be set on the all take pull-up resistors, set separately for input/output, can be set (initial) the high impedance input,driving ability (can save power drive devices) features, make the I/O mouth flexible and powerful and resources can be fully used.Single chip microcomputer automatic power AVR reset circuit, independent watchdog circuit, low voltage detection circuit BOD, multiple reset source (automatic reset and external reset and electricity, the watchdog reset, BOD reset), can be set to start delay to run the program, enhance the reliability of the embedded system.AVR SCM has a variety of province electricity sleep mode, and wide voltage operation (5-1.8 V), the anti-interference ability is strong, can reduce the average 8 bits of software anti-interference design work machine and the usage of the hardware.AVR microcontroller technology embodies the single-chip microcomputer collect A variety of devices including FLASH program memory, the watchdog, EEPROM, with/asynchronous serial mouth, TWI, SPI, A/D converter module, timer/counter, etc) and A variety of functions (enhance the reliability of the system, reduce the power consumption reduction of anti-interference sleep mode and many varieties of all categories interrupt system, with input and output is matching and capture the timer function of diversification, replace function with/counter the I/O port...) at A suit, fully embodies the microcontroller technology from "piece of self conduct war" to "chip systems SoC" the development direction of the transition.2.Integrated temperature sensorAD590Integrated temperature sensor AD590 to, its temperature resolution for the 0.3 degrees Celsius. The analog signal is output AD590 to, when the temperature of 0 degrees, output current 273.2 microamps, and current variation and temperature variation in a linear relationship, temperature, and once every change, the output current change 1 microamps, the temperature sensor of working temperature range is-30 degrees-150 degrees. If use AD590 to make the temperature sensor, sensor peripheral circuit is simple, just put sampling resistance and AD590 to link and then to amplify the signal, and then using voltage comparator compared to output voltage, voltage comparator output signals can be directly as PLC the input signal.3.Humidity sensorThere are many ways of measuring the air humidity, its principle isbased on certain material from the surrounding air absorb water caused by physical or chemical properties of the change, indirectly from the material of water quantity and the surrounding air humidity. Capacitive and resistive and wet go up wet type according to its original susceptibility were macromolecule material moisture absorption after the dielectric constant and resistivity and volume change and humidity measurementSolution a: the HOS-201 wet sensors. HOS-201 wet sensor for high humidity sensor switches, it's the job of the voltage of ac 1 V the following, frequency for frequency 50 HZ ~ 1 KHZ, humidity measurement range of 0 ~ 100% RH, working temperature range is 0 ~ 50 ℃, impedance in 75% RH (25 ℃) for 1 M Ω. The sensor is used to switch the sensor, not on the wideband range detection humidity, therefore, mainly for the judgment or under more than e. humidity level. However, the sensor to a certain range, have a good use of the linear, and can be effectively using the linear characteristics.Scheme ii: the HS1100 / HS1101 humidity sensor. HS1100 / HS1101 capacitance sensor, in a circuit of equivalent to a capacitor, it has the capacity as the air humidity increases while. Do not need to complete interchangeability of calibration, high reliability and long-term stability, fast response time, patent design of solid polymer structure, the top contact (HS1100) and lateral contact (HS1101) two kinds of packaging products, apply to linear output voltage and frequency output two circuit, is suitable for making automatic assembly line of the plugin and automatic assembly process, etc.Relative humidity at 1%-100% RH range; The capacity to change by 16 pF 200 pF, the error is not more than plus or minus 2% RH; Response time less than 5 S; The temperature coefficient is 0.04 pF / ℃. Visible is higher accuracy.A comprehensive comparison of scheme and scheme ii, plan one although meet the precision and the requirements of the measure humidity range, but its limited to certain scope, have a good use of the linear, and can be effectively using the linear characteristics. And still do not have in this design system of temperature-30 to 50 ℃ request, so we chose this design as the second scheme humidity sensor.4.MC14433 A/D converterMC14433 is three and A half double integral type of the A/D converter, with high precision, good anti-jamming performance advantages, its shortcoming is conversion rate low, about 1-10 times/SEC. Without the requirement of high speed switching occasions, for example, in low speed data acquisition system, is widely used. MC14433A a/D converter and domestic product 5 G14433 are all the same, can be interchanged.5.Multi-sensor data fusonThe aim to use data fusion in the distributed temperature control system is to eliminate the uncertainty, gain a more precise and reliable value than the arithmetical mean of the measured data from finite sensors. Furthermore, when some of the sensors become invalid in the temperature sensor groups, the intelligent CAN node can still obtain the accurate temperature value by fusing the information from the other valid sensors.5.1. Consistency verification of the measured dataDuring the process of temperature measurement in our designed distributed temperature control system, measurement error comes into being inevitably because of the influence of the paroxysmal disturb or the equipment fault. So we should eliminate the careless mistake before data fusion.We can eliminate the measurement errors by using scatter diagram method in the system equipped with little amount of sensors. Parametersto represent the data distribution structure include median—TM, upperquartile number—Fv , lower quartile number—FLand quartiledispersion—dF.It is supposed that each sensor in the temperature control systemproceeds temperature measurement independently. In the system, there are eight sensors in each temperature sensor group of the intelligent CAN node. So we can obtain eight temperature values in each CAN node at the same time. We arrange the collected temperature data in a sequence from small to large:T 1, T 2, …, T 8In the sequence, T 1 is the limit inferior and T 8 is the limit superior.We define the median —T M as:(1)The upper quartile —F v is the median of the interval [T M , T 8].The lowerquartile number —F L is the median of the interval [T 1, T M ].The dispersion of the quartile is:(2)We suppose that the data is an aberration one if the distance from the median is greater than adF, that is, the estimation interval of invalid data is:(3)In the formula, a is a constant, which is dependent on the system measurement error, commonly its value is to be 0.5, 1.0, 2.0 and so on. The rest values in the measurement column are considered as to be the valid ones with consistency. And the Single-Chip in the intelligent CAN node will fuse the consistent measurement value to obtain a fusion result6.The research significanceThe collection of temperature and humidity monitoring in daily life has a wide range of USES, the temperature and humidity monitor based on this and design, the biggest advantage is that it can display the current temperature and humidity measurement, and the current temperature and preset temperature carries on the comparison, more than when the current temperature and humidity preset temperature alarm, realize the historicaldata monitoring, collection and analysis purposes. The temperature and humidity monitoring alarm low power consumption, can use the minimal resource for different temperature for high precision measurement, reliable performance, convenient operation information, complex work through software programming to complete, easy to get results, in actual use for the ideal effect. This design has realized to the real-time control of the temperature, flexible control precision and reliability, high, can meet the product preliminary test the requirements of the aging. In the processing of constant temperature and heating temperature, formed a complete set of control plan, can transplantation for constant temperature, heating the house and equipment many aspects. Therefore, this design research results and the design idea can be good in other design transplantation, did it and the actual good union, with strong practical significance.译文单片机及温湿度传感器的发展摘要:在过去的几十年,温度控制系统已经被广泛的应用。
(完整word版)单片机_温度控制系统_外文翻译_外文文献_英文文献_中英翻译
Design of the Temperature Control System Based on AT89C51ABSTRACTThe principle and functions of the temperature control system based on micro controller AT89C51 are studied, and the temperature measurement unit consists of the 1-Wire bus digital temperature sensor DS18B20。
The system can be expected to detect the preset temperature,display time and save monitoring data. An alarm will be given by system if the temperature exceeds the upper and lower limit value of the temperature which can be set discretionarily and then automatic control is achieved, thus the temperature is achieved monitoring intelligently within a certain range。
Basing on principle of the system, it is easy to make a variety of other non-linear control systems so long as the software design is reasonably changed。
The system has been proved to be accurate,reliable and satisfied through field practice. KEYWORDS: AT89C51; micro controller; DS18B20;temperature1 INTRODUCTIONTemperature is a very important parameter in human life。
单片机-温度控制系统-外文翻译-外文文献-英文文献-中英翻译
Design of the Temperature Control System Based on AT89C51ABSTRACTThe principle and functions of the temperature control system based on micro controller AT89C51 are studied, and the temperature measurement unit consists of the 1-Wire bus digital temperature sensor DS18B20. The system can be expected to detect the preset temperature,display time and save monitoring data. An alarm will be given by system if the temperature exceeds the upper and lower limit value of the temperature which can be set discretionarily and then automatic control is achieved, thus the temperature is achieved monitoring intelligently within a certain range. Basing on principle of the system, it is easy to make a variety of other non—linear control systems so long as the software design is reasonably changed。
The system has been proved to be accurate, reliable and satisfied through field practice. KEYWORDS: AT89C51; micro controller; DS18B20;temperature1 INTRODUCTIONTemperature is a very important parameter in human life. In the modern society, temperature control (TC) is not only used in industrial production, but also widely used in other fields. With the improvement of the life quality,we can find the TC appliance in hotels, factories and home as well. And the trend that TC will better serve the whole society,so it is of great significance to measure and control the temperature。
单片机温度控制系统外文翻译外文文献英文文献中英翻译
Design of the Temperature Control System Based onAT89C51ABSTRACTThe principle and functions of the temperature control system based on micro controller AT89C51 are studied, and the temperature measurement unit consists of the 1-Wire bus digital temperature sensor DS18B20. The system can be expected to detect the preset temperature, display time and save monitoring data. An alarm will be given by system if the temperature exceeds the upper and lower limit value of the temperature which can be set discretionarily and then automatic control is achieved, thus the temperature is achieved monitoring intelligently within a certain range. Basing on principle of the system, it is easy to make a variety of other non-linear control systems so long as the software design is reasonably changed. The system has been proved to be accurate, reliable and satisfied through field practice.KEYWORDS: AT89C51; micro controller; DS18B20; temperature 1 INTRODUCTIONTemperature is a very important parameter in human life. In the modern society, temperature control (TC) is not only used in industrial production, but also widely used in other fields. With the improvement of the life quality, we can find the TC appliance in hotels, factories and home as well. And the trend that TC will better serve the whole society, so it is of great significance to measure and control the temperature. Based on the AT89C51 and temperature sensor DS18B20, this system controls the condition temperature intelligently. The temperature can be set discretionarily within a certain range. The system can show the time on LCD, and save monitoring data; andautomatically control the temperature when the condition temperature exceeds the upper and lower limit value. By doing so it is to keep the temperature unchanged. The system is of high anti-jamming, high control precision and flexible design; it also fits the rugged environment. It is mainly used in people's life to improve the quality of the work and life. It is also versatile, so that it can be convenient to extend the use of the system. So the design is of profound importance. The general design, hardware design and software design of the system are covered.1.1 IntroductionThe 8-bit AT89C51 CHMOS microcontrollers are designed to handle high-speed calculations and fast input/output operations. MCS 51 microcontrollers are typically used for high-speed event control systems. Commercial applications include modems, motor-control systems, printers, photocopiers, air conditioner control systems, disk drives, and medical instruments. The automotive industry use MCS 51 microcontrollers in engine-control systems, airbags, suspension systems, and antilock braking systems (ABS). The AT89C51 is especially well suited to applications that benefit from its processing speed and enhanced on-chip peripheral functions set, such as automotive power-train control, vehicle dynamic suspension, antilock braking, and stability control applications. Because of these critical applications, the market requires a reliable cost-effective controller with a low interrupt latency response, ability to service the high number of time and event driven integrated peripherals needed in real time applications, and a CPU with above average processing power in a single package. The financial and legal risk of having devices that operate unpredictably is very high. Once in the market, particularly in mission critical applications such as an autopilot or anti-lock braking system, mistakesare financially prohibitive. Redesign costs can run as high as a $500K, much more if the fix means 2 back annotating it across a product family that share the same core and/or peripheral design flaw. In addition, field replacements of components is extremely expensive, as the devices are typically sealed in modules with a total value several times that of the component. To mitigate these problems, it is essential that comprehensive testing of the controllers be carried out at both the component level and system level under worst case environmental and voltage conditions. This complete and thorough validation necessitates not only a well-defined process but also a proper environment and tools to facilitate and execute the mission successfully. Intel Chandler Platform Engineering group provides post silicon system validation (SV) of various micro-controllers and processors. The system validation process can be broken into three major parts. The type of the device and its application requirements determine which types of testing are performed on the device.1.2 The AT89C51 provides the following standard features4Kbytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bittimer/counters, a five vector two-level interrupt architecture, a full duple ser-ial port, on-chip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt sys -tem to continue functioning. The Power-down Mode saves the RAM contents but freezes the oscil–lator disabling all other chip functions until the next hardware reset.1.3Pin DescriptionVCC Supply voltage.GND Ground.Port 0:Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull ups. Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pull ups are required during program verification.Port 1:Port 1 is an 8-bit bi-directional I/O port with internal pull ups. The Port 1 output buffers can sink/so -urce four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pullups. Port 1 also receives the low-order address bytes during Flash programming and verification.Port 2:Port 2 is an 8-bit bi-directional I/O port with internal pull ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses (MOVX@DPTR). In this application,it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals durin Flash programming and verification.Port 3:Port 3 is an 8-bit bi-directional I/O port with internal pull ups. The Port 3 output buffers can sink/sou -rce four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull ups.Port 3 also serves the functions of various special features of the AT89C51 as listed below:RST:Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.ALE/PROG:Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped duri-ng each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.PSEN:Program Store Enable is the read strobe to external program memory. When theAT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skippedduring each access to external data memory.EA/VPP:External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin alsreceives the 12-volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt VPP.XTAL1:Input to the inverting oscillator amplifier and input to the internal clock operating circuit.XTAL2 :Output from the inverting oscillator amplifier. Oscillator CharacteristicsXTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2.There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed. Idle Mode In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. It should be noted that when idle is terminated by a hard ware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits accessto internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory.Power-down ModeIn the power-down mode, the oscillator is stopped, and the instruction that invokes power-down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the power-down mode is terminated. The only exit from power-down is a hardware reset. Reset redefines the SFRS but does not change the on-chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize. The AT89C51 code memory array is programmed byte-by byte in either programming mode. To program any nonblank byte in the on-chip Flash Memory, the entire memory must be erased using the Chip Erase Mode.2 Programming AlgorithmBefore programming the AT89C51, the address, data and control signals should be set up according to the Flash programming mode table and Figure 3 and Figure 4. To program the AT89C51, take the following steps.1. Input the desired memory location on the address lines.2. Input the appropriate data byte on the data lines. 3. Activate the correct combination of control signals. 4. Raise EA/VPP to 12V for the high-voltage programming mode. 5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-write cycle is self-timed and typically takes no more than 1.5 ms. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object reached. Data Polling: The AT89C51features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the complement of the written datum on PO.7. Once the write cycle has been completed, true data are valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated.2.1Ready/Busy:The progress of byte programming can also be monitored by the RDY/BSY output signal. P3.4 is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is pulled high again when programming is done to indicate READY.Program Verify:If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read back via the address and data lines for verification. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled.2.2 Chip Erase:The entire Flash array is erased electrically by using the proper combination of control signals and by holding ALE/PROG low for 10 ms. The code array is written with all “1”s. The chip erase operation must be executed before the code memory can be re-programmed.2.3 Reading the Signature Bytes:The signature bytes are read by the same procedure as a normal verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values returned areas follows.(030H) = 1EH indicates manufactured by Atmel(031H) = 51H indicates 89C51(032H) = FFH indicates 12V programming(032H) = 05H indicates 5V programming2.4 Programming InterfaceEvery code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is self timed and once initiated, will automatically time itself to completion. A microcomputer interface converts information between two forms. Outside the microcomputer the information handled by an electronic system exists as a physical signal, but within the program, it is represented numerically. The function of any interface can be broken down into a number of operations which modify the data in some way, so that the process of conversion between the external and internal forms is carried out in a number of steps. An analog-to-digital converter(ADC) is used to convert a continuously variable signal to a corresponding digital form which can take any one of a fixed number of possible binary values. If the output of the transducer does not vary continuously, no ADC is necessary. In this case the signal conditioning section must convert the incoming signal to a form which can be connected directly to the next part of the interface, the input/output section of the microcomputer itself. Output interfaces take a similar form, the obvious difference being that here the flow of information is in the opposite direction; it is passed from the program to the outside world. In this case the program may call an output subroutine which supervises the operation of the interface and performs the scaling numbers which may be needed for digital-to-analog converter(DAC). This subroutine passes information in turn to an output device which produces a corresponding electrical signal, which could be converted into analog form using a DAC. Finally the signal is conditioned(usually amplified) to a form suitable for operating an actuator.The signals used within microcomputer circuits are almost always too small to be connected directly to the outside world” and some kind of interface must be used to translate them to a more appropriate form. The design of section of interface circuits is one of the most important tasks facing the engineer wishing to apply microcomputers. We have seen that in microcomputers information is represented as discrete patterns of bits; this digital form is most useful when the microcomputer is to be connected to equipment which can only be switched on or off, where each bit might represent the state of a switch or actuator. To solve real-world problems, a microcontroller must have more than just a CPU, a program, and a data memory. In addition, it must contain hardware allowing the CPU to access information from the outside world. Once the CPU gathers information and processes the data, it must also be able to effect change on some portion of the outside world. These hardware devices, called peripherals, are the CPU’s window to the outside.The most basic form of peripheral available on microcontrollers is the general purpose I70 port. Each of the I/O pins can be used as either an input or an output. The function of each pin is determined by setting or clearing corresponding bits in a corresponding data direction register during the initialization stage of a program. Each output pin may be driven to either a logic one or a logic zero by using CPU instructions to pin may be viewed (or read.) by the CPU using program instructions. Some type of serial unit is included on microcontrollers to allow the CPU to communicate bit-serially with external devices. Using a bit serial format instead of bit-parallel format requires fewer I/O pins to perform the communication function, which makes it less expensive, but slower. Serial transmissions are performed either synchronously orasynchronously.3 SYSTEM GENERAL DESIGNThe hardware block diagram of the TC is shown in Fig.1. The system hardware includes the micro controller, temperature detection circuit, keyboard control circuit, clock circuit, Display, alarm, drive circuit and external RAM. Based on the AT89C51, the DS18B20 will transfer the temperature signal detected to digital signal. And the signal is sent to the micro controller for processing. At last the temperature value is showed on the LCD 12232F. These steps are used to achieve the temperature detection. Using the keyboard interface chip HD7279 to set the temperature value, using the micro controller to keep a certain temperature, and using the LCD to show the preset value for controlling the temperature. In addition, the clock chip DS1302 is used to show time and the external RAM 6264 is used to save the monitoring data. An alarm will be given by buzzer in time if the temperature exceeds the upper and lower limit value of the temperature.3.1 HARDWARE DESIGNA. Micro controllerThe AT89C51 is a low-power, high-performance CMOS 8-bit micro controller with 4K bytes of in-system programmable Flash memory. The device is manufactured using At mel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the At mel AT89C51 is a powerful micro controller which provides a highly-flexible and cost-effective solution to many embedded controlapplications. Minimum system of the micro controller is shown in Fig. 2. In order to save monitoring data, the 6264 is used as an external RAM. It is a static RAM chip, low-power with 8K bytes memory.B. Temperature Detection CircuitThe temperature sensor is the key part in the system. The Dallas DS18B20 is used, which supports the 1-Wire bus interface, and the ON-BOARD Patented is used internally. All the sensor parts and the converting circuit are integrated in integrated circuit like a transistor [1]. Its measure range is -55℃~125 ℃, and the precision between -10℃~85℃is ±0.5℃[2 ,3]. The temperature collected by the DS18B20 is transmitted in the 1-Wire bus way, and this highly raises the system anti-jamming and makes it fit in situ temperature measurement of the rugged environment [4]. There are two power supply ways for the DS18B20. The first is external power supply: the first pin of the DS18B20 is connected to the ground; the second pin serves as signal wire and the third is connected to the power. The second way is parasite power supply [5]. As the parasite power supply will lead to the complexity of the hardware circuit, the difficulty of the software control and the performance degradation of the chip, etc. But the DS18B20(s) can be connected to the I/O port of the micro controller in the external power supply way and it is more popular. Therefore the external power supply is used and the second pin is connected to the pin P1.3 of the AT89S51. Actually, if there are multipoint to be detected, the DS18B20(s) can be connected to the 1-Wire bus. But when the number is over 8, there is a concern to the driving and the more complex software design as well as the length of the 1-Wire bus. Normally it is no more than 50m. To achieve distant control, the system can be designed in to a wireless one to break the length limit of the 1-Wire bus [6].C. LCD CircuitThe LCD 12232F is used, which can be used to show characters, temperature value and time, and supply a friendly display interface. The 12232F is a LCD with 8192 128×32 pixels Chinese character database and 128 16×8 pixels ASCII character set graphics. It mainly consists of row drive/column drive and 128×32 full lattice LCD with t he function of displaying graphics as well as 7.5×2 Chinese characters. It is in a parallel or serial mode to connect to external CPU [7]. In order to economize the hardware resource, the 12232F should be connected to the AT89S51 in serial mode with only 4 output ports used. The LCD grayscale can be changed by adjusting the variable resistor connected the pin Vlcd of the LCD. CLK is used to transmit serial communication clock. SID is used to transmit serial data. CS is used to enable control the LCD. L+ is used to control the LCD backlight power.D. Clock CircuitThe Dallas DS18B20 is used, which is a high performance, low-power and real-time clock chip with RAM. The DS18B20 serves in the system with calendar clock and is used to monitor the time. The time data is read and processed by the AT89C51 and then displayed by the LCD. Also the time can be adjusted by the keyboard. The DS18B20 crystal oscillator is set at 32768Hz, and the recommended compensation capacitance is 6pF. The oscillator frequency is lower, so it might be possible not to connect the capacitor, and this would not make a big difference to the time precision. The backup power supply can be connected to a 3.6V rechargeable battery.E. Keyboard Control CircuitThe keyboard interface in the system is driven by the HD7279A which has a +5V single power supply and which is connected to the keyboard and display without using anyactive-device. According to the basic requirements and functions of the system, only 6 buttons are needed. The system's functions are set by the AT89C51 receiving the entered data. In order to save the external resistor, the 1×6 keyboard is used, and the keyboard codes are defined as: 07H, 0FH, 17H, 1FH, 27H, 2FH. The order can be read out by reading the code instruction. HD7279A is connected to the AT89S51 in serial mode and only 4 ports are need. As shown in Fig. 6, DIG0~DIG5 and DP are respectively the column lines and row line ports of the six keys which achieve keyboard monitoring, decoding and key codes identification.F. Alarm CircuitIn order to simplify the circuit and convenient debugging, a 5V automatic buzzer is used in the alarm circuit [8]. And this make the software programming simplified. As shown in Fig. 7, it is controlled by the PNP transistor 9012 whose base is connected to the pin P2.5 of the AT89C51. When the temperature exceeds the upper and lower limit value, the P2.5 output low level which makes the transistor be on and then an alarm is given by the buzzer.G. Drive CircuitA step motor is used as the drive device to control the temperature. The four-phase and eight-beat pulse distribution mode is used to drive motor and the simple delay program is used to handle the time interval between the pulses to obtain different rotational speed. There are two output states for the step motor. One: when the temperature is over the upper value, the motor rotates reversely (to low the temperature), while when lower than the lower limit value, the motor rotates normally (to raise the temperature); besides not equals the preset value. Two: when the temperature is at somewhere between the two endsand equals the preset value, the motor stops. These steps are used to achieve the temperature control. In addition, the motor speed can also be adjusted by relative buttons. As shown in Fig. 8, the code data is input through ports A11~A8 (be P2.3~P2.0) of the AT89C51 and inverted output by the inverter 74LS04. Finally it is amplified by the power amplifier 2803A to power the motor.3.2 SOFTWARE DESIGNAccording to the general design requirement and hardware circuit principle of the system, as well as the improvement of the program readability, transferability and the convenient debugging, the software design is modularized. The system flow mainly includes the following 8 steps: POST (Power-on self-test), system initiation, temperature detection, alarm handling, temperature control, clock chip DS18B20 operation, LCD and keyboard operation. The main program flow is shown in Fig. 9. Give a little analysis to the above 8 tasks, it is easy to find out that the last five tasks require the real time operation. But to the temperature detection it can be achieved with timer0 timing 1 second, that is to say temperature detection occurs per second. The system initiation includes global variable definition, RAM initiation, special function register initiation and peripheral equipment initiation. Global variable definition mainly finishes the interface definition of external interface chip connected to the AT89C51, and special definition of some memory units. RAM initiation mainly refers to RAM processing. For example when the system is electrified the time code will be stored in the internal unit address or the scintillation flag will be cleared. The special function register initiation includes loading the initial value of timer and opening the interrupt. For example, when the system is electrified the timer is initialized. Theperipheral equipment initiation refers to set the initial value of peripheral equipment. For example, when the system is electrified, the LCD should be initialized, the start-up display should be called, the temperature conversion command should be issued firstly and the clock chip DS18B20 should also be initialized. The alarm handling is mainly the lowering and the raising of temperature to make the temperature remain with the preset range. When the temperature is between the upper and the lower limit value, it goes to temperature control handling, that is to say the temperature need to be raised or lowered according to the preset value. By doing so make the condition temperature equal to the preset value and hence to reach the temperature target.4 CONCLUSIONThe temperature control system has the advantages of friendly human-computer interaction interface, simple hardware, low cost, high temperature control precision (error in the range of ±1 ℃), convenience and versatility, etc. It can be widely used in the occasions with -55℃to 125℃range, and there is a certain practical value.温度控制系统的设计摘要研究了基于AT89C51单片机温度控制系统的原理和功能,温度测量单元由单总线数字温度传感器DS18B20构成。
单片机温湿度控制论文英文文献(基于 C8051F)
Temperature sensor choose integrated temperature sensor AD590 developed by America AD company[l]. It pulls excellent linearity, moderate precision, small volume, convenient and long-term stability etc, and high cost-performance ratio, could simply, accurately achieve measurement results. As AD590 dispenses with compensation, with small heat capacity and strong anti-jamming capability, therefore the application of distance measuring temperature is very convenient. When tested temperature is a certain value, the device is equivalent to a constant current source, with high measurement accuracy, and possesses the characteristics of power supply fluctuation elimination. Its voltage of power supply can be changed from 4V to 6V , current Ir change IflA, equivalent to the temperature change lK. AD590 can afford 44V positive voltage and 20V reverse voltage, thus even when the device be reverse connected also won't be damaged. There is a lot of types of humidity sensor. One of relatively common is wet sensitive resistors and wet sensitive capacitance. Capacitive humidity sensor possesses large dynamic range, the quick dynamic response, almost no zero drift, adaptable, and also simpler structure, which is
单片机温度自动控制系统外文文献
ign of a temperature controller on a single CY8C27143, 8 pin PSoC chip. As shown in fig.1, it features four main areas: PSoC core, digital system, analog system, and system resources including in/out ports. This architecture allows the user to create customized peripheral configurations that match the requirements of each individual application. The UART interface, coupled with configurable analog and digital peripherals makes theCY8C27143 truly universal in its connections to the external world. The PSoC core includes: an M8C microcontroller; 32 Kbytes of program flash memory; 2 Kbyte of data RAM; internal 24 MHz oscillator; sleep and watchdog timer; general-purpose input/ output pins (GPIO allowing any pin to be used as digital input or output, and most pins to be used as analog inputs or outputs. Every pin can be used as a digital or analog interrupt. The digital system is made up of 8 digital PSoC blocks. Each block is an 8-bit resource that can be used alone or combined with other blocks to form peripherals. Possible peripherals include: PWMs (8-to 32-bit; PWMs with dead band (8-to 24-bit; counters (8-to 32-bit; UART 8-bit with selectable parity; SPI master and slave; cyclical redundancy checker/generator (8-to 32-bit; pseudo random sequence generators (8-to 32-bit. These digital blocks can be connected to any of the GPIO through a series of global buses. These buses also allow for signal multiplexing and performing logic operations. The analog system is made up of 12 configurable blocks, each comprising an op amp circuit allowing the creation of complex analog signal flows. Analog peripherals J. Jayapandian and Usha Rani Ravi are very flexible and can be customized to support specific application requirements. Some of the more common PSoC analog functions are: filters (2-and 4-pole band-pass, low-pass, and notch; amplifiers (up to 2, with selectable gain to 48x; instrumentation amplifiers (1 with selectable gain to 93x; comparators (up to 2, with 16 selectable thresholds; DACs (up to 2, with 6-to 10-bit resolution; and SAR ADCs (up to two, with 6-bit resolution. In combination with the digital blocks, additional functions can be created, including: incremental ADCs (up to 2, with 6-to 14-bit resolution; delta sigma ADC (1,with 8-bit resolution at 62.5ksps. The additional system resources provideadditional capability useful for the complete system design. 3. VIRTUAL INSTRUMENT PROGRAM Virtual instrument (VI is an application of general purpose digital PCs for the measurement and control of various physical variables. The VI program mimics the control processes, which are in a remote area, on the PC screen. On-going process control automation can be visualized by the experimentalist through PC screen. VI program provides inexpensive and yet a powerful platform for the control and data acquisitionof process variables. These programs are easy to implement with graphic languages (G-language. The “G” language implements the data flow technique. The usage of “G” language VIs provides easy interfacing with PCs under the Windows environment [2]. The “G” language provides built-in function libraries for a variety of application requirements as graphic palettes, which in turn supports the required DLLs for the functions to run under windows environment. Usually the “G” language VI programs consist of two frames viz., panel diagram and functional diagram. In the panel diagram, programmers can assign various controls and indicators (i.e., input and output variables as per their requirements and in the functional diagram, the designers can implement the required Fig. 2 : PSoC designer screen for single chip temperature controller An embedded single chip temperature controller design functions available as a function library in LabVIEW. National Instruments LabVIEW version 7.1 incorporates all the necessary functions as ‘icons’ in its package. 4. PSoC SINGLE CHIP TEMPERATURE CONTROLLER DESIGN Fig.2 shows the PSoC designer screen for the embedded single chip (8 pin PSoC chip CY827143 temperature controller design project [1]. Left side of the screen shows the settings of global resource and user module parameters along with pin connectivity configuration. Middle portion of the screen shows the analog and digital blocks user module placement. Top portion of the screen shows the selected user modules for this project. Right side of the screen describes the pin connectivity configured in the design. In this novel single chip design, thermocouple (TC signal has been amplified by a programmable gain amplifier (PGA placed in the PSoC’s analog block. The amplified TCsignal has been fed in to a 12 bit Analog-to digital (ADC user module programmed in the PSoC chip, which includes both analog and digital blocks for its functionality by PSoC designer programming. The converted digital data of the amplified TC signal has been fed to the UART user module for serial communication with Personal Computer. The UART user module placed in the PSoC chip, automatically gets placed in two digital blocks of PSoC chip, transmitter (TxD and receiver (RxD for PCs serial communication.A pulse width modulator (PWM, placed in the PSoC digital block, sets a serial pulse width modulated TTL pulses in response to the PID control function for the deviation in set and measured temperature. This will in turn controls the optically coupled solid state relay (SSR driving the AC line power connected to the load/furnace [3,4]. The menu driven window based virtual instrument control program senses the temperature, via, thermocouple, TC amplifier, 12-bit ADC and UART communication block of PSoC chip and evaluate the control functions like P,I,D, linear heating, on-sweep and sets the pulse width of PWM in a PSoC chip via UART block in a serial communication. Fig. 3 : Single PSoC chip Temperature controller design J. Jayapandian and Usha Rani Ravi Fig.3. shows the connectivity of a single PSoC chip design with solid state relay (SSR and USB port via, serial-to-USB converter cable for communication with PC. The SSR, acts as AC power controller for controlling the furnace power, has been activated by the PWM pulses from PSoC chip. The menu driven virtual instrument control program works in window environment interacts with the embedded design for sensing, controlling and acquiring the temperature data. On-line plotting of acquired temperature data also carried out by the VI program. 5. CONCLUSION A simple and cost effective embedded temperature controller has been designed, fabricated and tested successfully for its functionality. This compact designs permits the user to select any type of control function through its virtual instrument program, written in LabVIEW 7.1, and works under window environment. This design can be directly connected to PCs ‘com’ port or USB port via USB-to-serial converter cable, the SSR power controller module can be connected on the furnace stand.The optically isolated power controller provides safe operation without damaging the interfacing intelligent controller. 6. REFERENCES 1. J. Jayapandian. Current Science, Vol 90. No.6. 25th March 2006. p.765-770. 2. National Instrument’s LabVIEW user manual. 3. J. Jayapandian. Design Briefs. Electronic Design Magazine. A Penton Publication.New Jersey, USA. ED Online ID #5687. September 15, 2003. 4. J. Jayapandian et.al. J. Instrum. Soc. India 33 (2 75 – 80 (2003.。
基于单片机控制温湿度的系统外文及翻译
New Environment Parameters Monitoring And Control System For Greenhouse Based OnMaster-slave DistributedAbstract--According to the actual need of monitoring and control of greenhouse environment parameters in rural areas,a master-slave distributed measurement and control system is designed,in which PC is taken as the host. The system consists of PC ,soil moisture measurement and control module,temperature and humidity, and CO2 monitoring and control module. In the system,PC has large amount of data storage which is easy to make use of fuzzy control expert system,configuration software-KingView is used to develop software for PC,by which the development cycle is shorten and a friendly human-computer interaction is provided.Each monitoring and control module consists of STC12 series of microcontrollers,sensors,relays etc.Different modules are select based on the need if system to achieve control greenhouse in partition and block.I. INTRODUCTIONTo modern indoor agriculture, the automatic measurement and control of environment parameters is the key to achieve crop yield and quality of greenhouse.In recent years,facilities agriculture develops vigorously in our country,matched with it,the monitoring and control instrument of greenhouse have also made certain development.After nearly 10 years of unremitting hard work,our research team of measurement and control system of agriculture environment parameters,designed an intelligent measurement and control system of distribution combined of greenhouse which can be popularized in the vast rural areas.This system is mainly control of temperature,humidity,CO2 concentration,soil moisture and illumination of greenhouse.OF SCM,as the data storage is small,display interface is single,amount of information is limited,but its capability price ratio is high,so it is used as a front unit of data acquisition and control;and of PC,it has a large amount of data storage,rich software,convenient human-computer interaction,and so on.If we use outdated and low-priced PC,taking the PC as the upper machine,taking the different function control modules composed of multiple microcomputers as the lower machines,then a master-slave distributed and intelligent control system bases on microcomputer is made up,by which both better monitoring and control,display and data collection or management are achieved,but also lower cost of system is get according to the actual need.II SYSTEM STRUCTURE AND PRINCIPLEThe most marked feature of the distribution combined and intelligent control system greenhouse is that of incorporating with data acquisition, control and management as a whole,module combination, simple structure,convenient human-computer interaction,and using technology of intelligent expert fuzzy control,which can adapt to a variety of crop management control in greenhouse.The basic structure of the system is shown in Fig.1.The structure of the distributed system is composed of two layers:the upper and lower.In the top-price PC is taken as the host to make system management and experts fuzzy operation in intelligent,and to provide a friendly human-computer interface,and to realize the united monitoring and management of greenhouse; the lower is composed of a series of modules of different function,and in each module,a single chip of AT89C is adopted as the lower machine,RS485 is used to communicate PC with all AT89C,and then the collection,processing and control of the greenhouse parameters is achieved.Each function module is completely isolated in electrical,any failure on the nodule does not produce any effect on other modules.The systemcollects separately ways of environment information through each monitoring and control module,and sends it to host PC through the RS485 interface.And in the PC configuration control system,the acquired parameters are compared with the values of setting,then according to a variety of expert intelligent fuzzy control system of crops at different growth stages,the fuzzy control instructions on the environment temperature,humidity,CO2 concentration,soil water content and the corresponding operation instructions or alarm are given.The system is applied in rural greenhouses in ually at 1/4 near East and West end in a greenhouse,and at the height of 1.5m from the ground in the middle in the northern half (near the wet curtain) and the southern half (near the fan ),a module of air temperature and humidity ,CO2 concentration and a module of soil moisture content are set;a module of soil moisture content will be added in the middle of the greenhouse according to the actual condition;at the height of 1.5m in the main entrance,a water tank is set,of which the solenoid of drip tube should be set based on the need and controlled by module of soil moisture content;and the PC is placed in the main entrance to the greenhouse.III . HARDW ARE DESIGNA.The CP and communication systemIn the distributed system of data acquisition and control,as the micro control unit is limited in data storage and slow in calculating of complex functions,so PC is used and the master-slave module is adopted in the system,that is a system of,taking PC as the host and taking the SCM systems located in the scene as slave.In this distributed system,communication is the key to it.Generally,the serial port of PC is standard RS232,of which transmission distance is shorter.But in agriculture control system.its communication distance is of tens of meters or several kilometers, so RS232/RS485 converter is used to achieve communication between the PC and SCM.To reduce investment,both considering the user convenience and friendly human-computer interaction,low-price PC of above 486 and below PIV is adopted;and considering the operation of configuration software,it is required that memory is 64M or above and hard disk is 10Gb or above.B. The control modules of temperature and humidity,illuminance and CO2 concentrationEach control unit consists of SCM,sensors,signal processing circuit,RS485 interface and output circuit.The hardware structure of module of temperature and humidity,CO2 concentration is shown in Fig.2.CO2 concentration is measured by sensor based on NDIR technology,measurement is of 0~2×103mol.Through the sensor,control system,by software of digital filter,linear interpolation and temperature compensation,the CO2 concentration is output as digital adhered to UART protocol,and then is input directly to the SCM.The new intelligent sensor of SHT11 based on CMOSens technology is chosen in the measurement of temperature and humidity.In SHT11,the temperature and humidity sensors,signal amplification,A/D,I2C bus are all integrated in a chip;it has full-scale calibration,second-line digital output,and humidity measuring range of 0~100% RH,temperature measurement range of -40℃~+123.8℃,humidity measurement accuracy of ±3.0% RH,temperature measurement accuracy of ±0.4℃,the response time of <4s.The illuminance sensor of JY1-TBQ-6 of silicon photovoltaic detection is used Light measuring.Its measurement range is 0~200,000 Lux;spectral range is 400~700(nm) visible light;measurement error is less than 2%; output is 4~20mA or 0~20mV;output signal can bedirectly send to the A/D of the SCM after being amplified to 0~4V.Modules accept the instructions form the the Upper,and output via the output circuit .The output circuit consists of optical isolation,the signal driver and the output relays.C. The measurement and control modules of soil moistureWater is a polar medium, the dielectric constant of the soil containing water is mainly determined by the water,when water content is different,the wave impedance is different.The soil moisture is measured by standing wave radio method in this system.Based on the theory of Engineering Electromagnetic Field,for lossy medium,the electromagnetic wave impedance as follows:Z0=√μ/ε(1+jλ/(ωε))Where μis medium permeability,and μof soil is μ≈μ0 is the vacuum permeability;εis medium dielectric constant;λis medium conductivity;ωis electromagnetic wave frequency.In the very low audio(<2000Hz),the loss tangent of dry soil dielectric is λ/ωε≈0.07,if you choose the frequency of the signal source at above 20MHz.then,ε≈ε∞,the imaginary part of the soil wave impedance is neglect,only the real part,which amounts to a pure resistance.Soil moisture sensor consists of 100MHz signal source,a coaxial transmission line and a 4-pin stainless probe.The electromagnetic waves of signal transmit to the probe along the lines.As the probe impedance and line impedance are different,the superimposition of incident waves and reflected waves forms a standing waves.Taking the coaxial transmission line as a lossless uniform line,wave impedance is Z0,Z l is the load impedance.Then the reflected coefficient of voltage wave at the probe is:Γ=(Z L-Z0)/(Z L+Z0)Choosing the length of transmission line is l=λ/4,the maximum and minimum of both ends of the line are U max and U min,Then the standing wave radio in the line can be expressed as: S=U max /U min =(1-|Γ|)/(1+|Γ|)In the way,the soil moisture radio can be measured by measuring the standing wave rate of transmission line.As shown in Fig.3.,soil moisture module consists of sensors and controllers,the sensors are subordinated to controllers,controllers can be omitted without the need of irrigation in greenhouse.To simplify the control,irrigation technology of node-type in partition is adopted in the control soil moisture in this system.To a certain extent,the parameters of upper and lower the ground can be decoupled by adopting this technology.IV CONTROL SYSTEM PROGRAMMINGThe software of PC is developed by KingView 6.51 of Beijing-controlled Asia.This configuration software has high reliability,shorter development cycle,perfect capability of graphical interface generation,and friendly human-computer interaction;and can create dynamic images and charts in accordance with the layout of equipment in the scene;can visually display the changes of parameters,control status,and can give an alarm when over-limited;and can achieve fuzzy control of greenhouse parameters by using the history curve of environment parameters stored in the specific database and adopting the agricultural expert system.The software of SCM of the slave is developed by Keil C51 to achieve real-time collecting,processing,uploading of the parameters and accept the fuzzy control instructions from the host computer and complete local control of the device.A.Program design of the control moduleThe software of the sub-slave machine of soil moisture module,that include the main function,subroutines of data acquisition and processing,interrupt handling and communicating etc,read the value of standing wave voltage through the parallel data port and obtained the value of soil moisture content by function calculating.The software of the slave machine of monitoring and control of soil moisture mainly complete data communication with the sub-slave machine,uploading measurement data and current control state to the host computer,accepting the fuzzy control instructions from the host computer and output the implementation instructions.The software of the slave machine of temperature and humidity,and CO2 mainly complete reading data of CO2 concentrations and temperature and humidity through the I2C concentration,uploading measurement data and current control state to the host computer,accepting the fuzzy control instructions from the host computer and output the implementation instructions.The structure of the main program and interrupt subroutine of temperature and humidity module are shown in Fig.4.The serial interrupt mode 3 is adopted by all slaves to communicate with the host,transmit the digital collecting and receive instructions.B. Program design of PC and fuzzy control system1)The communication settings of KingView 6.51:In order to ensure the correctness of communication,the upper and lower must follow the same communication protocol,set the communication ually in communication,master-slave mode is adopted in style and responder is adopted in the process.That is ,the master sent a command to the slave first,then et slave give an answer after receiving the command,thus once communication is completed.In KingView ,a scheduled polling method is adopted to do reading and writing between the lower machine by PC.In the project browser of KingView,first,click device →COM1;in the wizard of device configuration,select intelligent modules→SCM→current SCM of HEX→serial port,and then ser parameters for the host computer’s communication.2)The connection of KingView 6.51 and database:Database is the core of the software,that not only contains the definition of variables,real-time parameters and the historical parameters,but also is needed by parameters alarming,fuzzy calculating,reporting ,and displaying.Access2003 desktop database is used as records database of the system,and by using SQL,it is operated by KingView via ODBC.The procedure is :to create data variables in KingView to create a body of records to establish a data source of ODBC to create query screens and make the screen connection.To connected with Microsoft Access2003,the functions of SQLConnect(),SQLSelect(),SQLLast(),SQLNext(),SQLFist(),SQLPrew(),SQLInsrt(),and so on,should be implemented in the command language,and then real-time storage and inquiry of data are completed.3)Software design of PC :For the control system of greenhouse,data storage capacity of the PC is unlimited,so if the existing mature software modules are include into the system,it both be relaxed and can improve the system reliability.The software of software consists of control module and management module.Software of the system consists of the main control interface,auxiliary,databases,etc.A typical main interface of monitoring and control of PC is shown in Fig.5.V. CONCLUSIONAccording to the economic bearing capacity of farmer in Qinhuangdao ,with the existing technology of monitoring and control of environment parameters of greenhouse,a master-slave distributed automatic control system of greenhouse environment in which PC is taken as the host computer is developed.The system has following characteristics:1)With the large amount of data storage of PC,fuzzy control expert system is easy of data storage,modification and system upgrading.2)By using KingView to develop software of PC,the system reliability is improved,and the development cycle is shorten,and a friendly human-computer interface is get.3)A distributed and modular structure is used in the system,it makes the system maintenance easier and adapts to production needs more. The monitoring and control modules of the slave are connected to the host through the RS485 bus based on needs,then the control of greenhouse in partition or block can be achieved.ACKNOWLEDGMENTThis work is supported by Agricultural Science and Technology Achievement Transformation Fund Project.基于主从分布式新的温室环境参数监测和控制系统根据实际在农村地区的温室环境参数的监测和控制,主从分布式测量和控制系统的设计需要,以其中一台计算机作为主机,该系统由PC、土壤水分测量和监测和控制模块组成。
单片机温湿度控制论文英文文献(基于_C8051F)中文翻译
单片机温湿度控制论文英文文献(基于_C8051F)摘要在工业生产中,温度和湿度是常见的主要操作参数,特别是在热处理行业中,温度控制变得越来越重要。
本文即从硬件和软件这两方面介绍单片机(SCM)C8051F单片机智能温湿度控制硬件的系统,并描述示意图和软件。
该设计增加了二氧化碳的整合浓度和光强度检测和必要通信功能。
这是一个更人性化,更实用智能温湿度测量。
关键字:C8051F单片机,温度和相对环境控制; C02 浓度测量;传感器; GSM1、介绍在许多环境因素的影响,温度和湿度的因素是最重要的和最难以控逆变环境因素。
在一些工业方面,对于生产某些特殊环境要求。
此外,近年来,能源和环境问题成为人们关注的热门话题,所以节能和环保保护的想法为这个设计开辟了新的观点。
本文介绍了温度的设计湿度测量系统基于单片机,并增加了C02浓度的检测功能以及强度照明,智能人机通信功能使得该系统具有一定的人性化。
通过改变参数,将其设置为适用于一般的工业生产环境的监测。
设计更加智能化,并通过微控制器和管理人员之间的沟通,更多灵活控制,更实用和更广泛应用领域。
2、整体设计建议这样的设计主要是针对智能监控工业生产环境温度和湿度,二氧化碳浓度,光照强度以及参与其他一般环境因素。
该系统可以直接实现全自动控制,管理者也可以通过GSM通信调整控制方案模块。
其中,主机采用单片机来控制控制器的命令来完成以下工作:数据采集和测试,可以通过操作员机器接口(键盘和显示器)到实现参数设定,显示和手动介入,以及其他功能。
当参数超限或意外情况(以频率为例)出现该系统应该立即自动报警,并与经理及时以解决沟通的问题。
基于单片机的整个系统,包括数据收集和测试模块,键盘输入和显示模块,GSM和报警模块。
数据采集,检测治疗可以完成收集和放大在生产各种环境模拟参数车间,其结果将反馈到单片机,其中数据来实现的AID皈依,存储和分析,并确定是否超出设定范围所收集的数据如果它是超越,什么控制方案,然后与发送短信,及时传达给管理者。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
基于单片机的温湿度控制系统英文文
献
英文文献翻译
学 生 姓名 刘学毅 专
业 自动化
学 号 0833141
分 院 电子工程分院
6 月
1. 外文原文
A: Fundamentals of Single-chip Microcomputer
The single-chip microcomputer is the culmination of both the development of the digital computer and the integrated circuit arguably the tow most significant inventions of the 20th century
These tow types of architecture are found in single-chip microcomputer. Some employ the split program/data memory of the Harvard arch itecture, others follow the philosophy, widely adapted for general-purpose computers and microprocessors, of making no logical distinction between program and data memory as in the Princeton architecture, shown in F ig.3-5A-2.
In general terms a single-chip microcomputer is characterized by the incorporation of all the units of a computer into a single device.
Read only memory (ROM)
ROM is usually for the permanent, non-volatile storage of an applications program .Many microcomputers and microcontrollers a re intended for high-volume applications and hence the economical manufacture of
the devices requires that the contents of the program memory be committed permanently during the manufacture of chips . Clearly, this implies a rigorous approach to ROM code d evelopment since changes cannot be made after manufacture .This development process may involve emulation using a sophisticated development system with a hardware emulation capability as well as the use of powerful software tools.
Some manufacturers provid e additional ROM options by including in their range devices with (or intended for use with) user programmable memory. The simplest of these is usually device which can operate in a microprocessor mode by using some of the input/output lines as an address and data bus for accessing external memory. This type of device can behave functionally as the single chip microcomputer from which it is derived albeit with restricted I/O and a modified external circuit. The use of these ROM less devices is common even i n production circuits where the volume does not justify the development costs of custom on-chip ROM[2];there can still be a significant saving in I/O and other chips compared to a conventional microprocessor based
circuit. More exact replacement for ROM de vices can be obtained in the form of variants with 'piggy-back' EPROM(Erasable programmable ROM )sockets or devices with EPROM instead of ROM 。
These devices are naturally more expensive than equivalent ROM device, but do provide complete circuit equivalent s. EPROM based devices are also extremely attractive for low-volume applications where they provide the advantages of a single-chip device, in terms of on-chip I/O, etc. ,with the convenience of flexible user programmability.
Random access memory (RAM).
RAM is for the storage of working variables and data used during program execution. The size of this memory varies with device type but it has the same characteristic width (4,8,16 bits etc.) as the processor ,Special function registers, such as stack pointer or timer register are often logically incorporated into the RAM area. It is also common in Hard type microcomputers to treat the RAM area as a collection of register; it is unnecessary to make distinction between RAM and processor register as is。