1626 views|0 replies

6609

Posts

0

Resources
The OP
 

Design of temperature measurement system based on msp430 single chip microcomputer [Copy link]

This article introduces a method of measuring temperature using an msp430 microcontroller to replace the relatively backward experimental method of combining thermistors with ammeters in traditional teaching.
1 Temperature measurement
There are many types of temperature-sensitive components used to measure temperature, such as thermocouples, thermistors, integrated temperature sensors, digital temperature sensors, etc. This system uses a thermistor. The thermistor is composed of a semiconductor ceramic working body that is very sensitive to temperature. Compared with commonly used metal resistors, it has a larger resistance temperature coefficient and can obtain a higher temperature resolution. Thermistors made of different materials are suitable for different temperature measurement ranges. For example, thermistors made of CuO and MnO2 are suitable for -70~120℃, which is suitable for measuring body temperature. Temperature is an analog quantity, and the measured analog quantity must be converted into a digital quantity for processing by the microcontroller. In order to save costs, analog-to-digital conversion can be achieved through slope A/D conversion. Slope A/D conversion is achieved by charging and discharging an external capacitor. The circuit connection is shown in Figure 1.

The resistance of thermistor can be measured by using the comparator (Comparator_A) and timer (Timer_A) of msp430. The temperature to be measured can be obtained based on the corresponding relationship between resistance and temperature, and A/D conversion can be realized. Connect CA0 of Comparator_A to external signal, and connect CA1 to internal reference voltage 0.25Vcc. Timer_A works in capture mode, captures falling edge, and captures CAOUT through CCI1B. First, make P1.2 port output high level, and charge capacitor C6 through Rref. When charging is completed, the voltage at CA0 is higher than that at CA1, and CAOUT outputs 1. Read the count value t0 of Timer_A, t0=TAR. Then make the P1.2 port output a low level, and capacitor C6 discharges through Rref. When the voltage at CA0 drops to 0.25Vcc, the output of Comparator_A flips, and CAOUT outputs 0. Timer_A captures the falling edge through CCI1B, triggering the timer interrupt and reading the capture value CCR1, t1=CCR1. The time time_ref=t1-t0 for C6 to discharge to 0.25Vcc through Rref. Then charge and discharge the thermistor Rsens, and measure the time time_sens for C6 to discharge to 0.25Vcc through Rsens. The resistance value of the thermistor (Rsens) can be calculated by the following formula.

2 Temperature display part
MSP430F413 has a liquid crystal drive circuit and display cache. By setting and resetting each bit in the video memory, the corresponding segment on the LCD screen is displayed or disappeared. The data obtained after slope conversion is sent to the video memory, and the measured temperature can be displayed on the LCD screen. MSP430 has 4 driving modes. The driving mode is determined by the number of liquid crystal segments to be driven, the pins of the LCD screen, and the arrangement of the electrodes inside the LCD screen. The LCD screen used in this system is the EDS812 LCD screen produced by Dalian Dongxian Electronics Co., Ltd. The display can display 3 digits and has 24 pins, including 1 common pole pin and 23 segment pole pins. Since the LCD screen has only 1 common pole, it can only use static driving mode. According to the corresponding relationship shown in Figure 2 and Table 1, connect MSP4 30 and EDS812, and write the data into the video memory to display the measured temperature.

3 Keyboard control part
The keyboard is an input device for human-computer dialogue. The system parameters can be set and the system operation can be controlled through the keyboard. The keyboard of the application system can use non-determinant keyboard and determinant keyboard. The hardware circuit and execution software of the non-determinant keyboard are relatively simple, consuming less CPU resources, but it is only suitable for the case of fewer keys. This system has only one switch key and one temperature measurement key, which is suitable for the use of non-determinant keyboard. This system uses a light touch key, which realizes its function through the switch state. In actual application, the running speed is very fast relative to the speed of the operator's key press, so the jitter problem before and after pressing the key must be considered. This system uses software delay to eliminate jitter, that is, when the system detects that a key is pressed, it will detect whether the key is pressed again after 20 ms. If it is detected that the key is indeed pressed, the function corresponding to the key is executed; if the key is not detected to be pressed, it will continue to remain in standby state.
4 Conclusion
The above system can accurately measure the temperature. Different schools can formulate specific experimental steps in hardware connection, software design, etc. according to specific teaching requirements. Through this experiment, students will initially master the application of integrated circuits in the teaching stage of basic courses. Compared with traditional experimental instruments, the experimental instruments composed of this system apply more modern scientific and technological methods and are closer to actual instruments and equipment, which can enable students to better apply the knowledge they have learned in school to actual work.

This post is from Microcontroller MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list