Design of thermistor thermometer based on LPC2142

Publisher:HappyHeartedLatest update time:2012-08-21 Source: 电子发烧友Keywords:LPC2142 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Due to the rapid development of electronic technology, the cost performance of electronic components has been continuously improved. This article uses the 32-bit ARM7 TDMI-S microprocessor core LPC2142 as the control core, and uses its internal A/D converter and SPI interface to control the LED display driver MC14489 for real-time temperature display.

2 Thermistor temperature conversion principle

Thermistor is a type of temperature sensor, which is composed of imitation ceramic semiconductors. Thermistor (NTC) is different from ordinary resistors. It has a negative resistance temperature characteristic, that is, when the temperature rises, its resistance value decreases. Figure 1 is the characteristic curve of thermistor. The resistance-temperature characteristic curve of thermistor is an exponential curve with large nonlinearity, so it needs to be linearized when used. Although linearization can improve the characteristic curve of thermistor, it is relatively complicated. For this reason, in general applications with low requirements, it is often assumed that the temperature and resistance are linearly related within a certain temperature range to simplify the calculation. Thermistors are used to sense temperature. When a constant current is passed through the thermistor, a voltage can be measured across the resistor. Then the temperature can be calculated using the following formula:



T is the measured temperature; T0 is a temperature parameter related to the thermistor characteristics; K is a coefficient related to the thermistor characteristics; VT is the voltage across the thermistor.

According to this formula, if the voltage across the thermistor can be measured, and the parameters T0 and K are known, the ambient temperature of the thermistor, that is, the measured temperature, can be calculated. This converts the relationship between resistance and temperature into the relationship between voltage and temperature. The main task of designing a digital resistance thermometer is to convert the voltage value across the thermistor into a digital value through A/D and send it to the microcontroller, then calculate the temperature value through software methods, and then display, print, and other processing.



3 Hardware Circuit Design

With the rapid development of electronic technology, the prices of some powerful components are constantly falling, which makes their cost performance continuously improved and their application fields are becoming more and more extensive. This article uses the 32-bit ARM microprocessor core LPC2142 to replace the traditional 805l single-chip microcomputer as the control core to perform A/D conversion and real-time temperature display. Figure 2 is the structural schematic diagram of the entire system.



The thermistor NTC is connected in series with a common resistor R, and then connected to a +5V power supply. The voltage across RT is taken and sent to the AINl (P0.28 pin) channel of the microcontroller LPC2142 for A/D conversion. The conversion start mode and the selection of the conversion channel can be achieved by setting the ADC control register ADC0DR. The conversion result is output to the LED display driver MCl4489 through a synchronous, full-duplex serial SPI interface for real-time display of temperature.

3.1 Introduction to ARM microcontroller LPC2142

The ARM 7 TDMI-S core is a general-purpose 32-bit microprocessor core that uses a von Neumann structure and has high performance and low power consumption. The ARM structure is designed based on the principle of reduced instruction set computer (RISC). The instruction set and related decoding mechanism are much simpler than complex instruction set computers. . The ARM 7 TDMI-S processor uses pipeline technology, and all parts of the processing and storage system can work continuously. In this way, it is very easy to achieve high throughput and real-time interrupt response using a small, inexpensive processor core.

The LPC2142 is a microcontroller based on a 3Z/16-bit ARM7TDMI-s CPU that supports real-time simulation and embedded tracing. It has 64 kB of high-speed FLASH memory and 16 kB of on-chip SRAM. The 128-bit memory interface and unique accelerator interface enable 32-bit code to run at the highest clock frequency. Applications that have strict control over code size can use 16-bit Thumb mode to reduce code size by more than 30%, while its performance loss is very small.

The LPC2142 has a 10-bit successive approximation A/D converter inside. Its main features are:

(1) 6 pins are multiplexed as input pins;

(2) Power-down mode;

(3) Measurement range OV ~ Vref is usually 3 V, not exceeding VDDA voltage);

(4) Each converter contains a programmable divider that can adjust the clock to the 4.5 MHz (maximum) required for successive approximation conversion. Thus, the 10-bit conversion time is greater than or equal to 4.55μs;

(5) Burst conversion mode for one or more inputs;

(6) The conversion can be triggered by direct start, input jump or timer match signal;

LPC2142 also has a hardware SPI (Serial Peripheral Interface) interface. It is a synchronous, full-duplex serial interface with a maximum data bit rate of 1/8 of the clock rate and can be configured as a master or slave. [page]

3.2 LED display driver management chip MC14489

MCl4489 is a serial interface LED display driver management chip produced by MOTOROLA, USA. There are only three I/O lines between its input end and the system main CPU, which are used to receive the serial data to be displayed. The output end can directly drive the seven-segment LED display or the indicator light.

MCl4489 integrates all the circuits required for data reception/decoding/scan output/drive display. It only needs an external current setting resistor to control the high brightness of the LED display. Each MC14489 chip can display in any of the following ways: 5-digit LED digits plus decimal point display; 4.5-digit digits plus decimal point with symbol display; 25 indicator lights display; 5.5-digit digit display. The decoder circuit contained in the chip can output seven-segment format numbers 0 to 9, hexadecimal letters A to F, and 15 letters and symbols.

Figure 2 is an example of a 5-digit LED display using a single MC14489. As can be seen from the figure, the display circuit composed of MC14489 does not need any current limiting resistors, nor does it need to add inverting or driving circuits. The circuit design is very simple.

The MC14489 chip adopts special design technology to make its power pin still have the lowest peak and smaller EMI (electromagnetic interference) when working with large current.

4 System software design

From the brief description of the temperature conversion principle of thermistor above, it can be seen that the characteristic curve of thermistor is an exponential curve with large nonlinearity. Since the nonlinear processing is relatively complicated, it can be simplified when the design requirements of this article are not very high.

4.1 Program design flow chart

Due to the limited space, this article only gives the flowchart of program design. The flowchart of the whole program is shown in Figure 3.

4.2 Temperature calculation program

In the formula T=T0-KVT, the coefficient value K is a very small number. In order to facilitate calculation, take the K value after 256 times expansion and VT as the product, that is, 256×K×VT. After multiplication, only the high 8 bits of the product are taken and the low 8 bits are discarded, which can offset the effect of the coefficient value K being expanded 256 times and obtain the correct result.

In addition, it can be seen from the resistance-temperature characteristic curve of the thermistor in Figure 1 that the linearity of the relationship between resistance and temperature is good within the temperature range of +10 to 150°C. This temperature range is usually taken as the effective temperature range. When the temperature exceeds this range, the digital tubes all display F as a sign.

Since the effective temperature range does not exceed 150°C, the temperature is displayed using a 3-digit digital tube, and its display format is: AD XXX, where XXX is the temperature value. LED1 and LED2 in Figure 2 only display characters A and D, and the following three digital tubes LED3, LED4 and LED5 display the temperature value.



5 Conclusion

The use of SPI serial interface and MCl4489 management chip to form the display driver circuit of intelligent instrumentation can greatly improve the performance-price ratio of the system. In this paper, the characteristics of thermistor are simplified and linearized when the accuracy is not very high, and the temperature in the range of +10 to 150℃ is measured using the designed circuit in this paper, achieving good results. The following points need to be noted in the entire design process:

(1) The LPC2142 microcontroller has independent analog power pins VDDA and USSA. In order to reduce noise and error probability, the analog power supply and digital power supply should be isolated with a 10μH inductor.

(2) The selection of A/D conversion reference voltage Vref must meet the measurement accuracy requirements. If you want to improve the A/D conversion accuracy, a reference source chip is generally used to provide the reference voltage. TL431 is a low-noise three-terminal adjustable shunt reference source with good thermal stability (temperature coefficient is 30×10-6/℃). This paper uses this reference source chip to provide the reference voltage.

(3) Since the LPC2142 microcontroller is used as the SPI master in this system, its P0.7 pin SSEL should be connected to a 10 kΩ pull-up resistor.

Keywords:LPC2142 Reference address:Design of thermistor thermometer based on LPC2142

Previous article:Accurate delay method for LPC21xx C program
Next article:Design of Chinese Input System Based on LPC2138

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号