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]
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.
Previous article:Accurate delay method for LPC21xx C program
Next article:Design of Chinese Input System Based on LPC2138
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Filter Design——FilterSolutions
- Android driver learning 1-driver development process (Android.mk)
- MSP430 clock problem
- 【Repost】Master these five methods to make your MCU easily low power
- Asking for advice: Question about TMS320C5509A low power mode
- Based on PSOC6 development board simulation I2C solution X-NUCLEO-IKS01A3's STTS751;
- Apply for VICOR DCM DC-DC converter module related evaluation board for free!
- MATLAB offline seminar | Assisting the development of artificial intelligence and electronic products (March 30, Nanjing)
- Dear seniors, please help me choose a chip
- [EasyARM-RT1052 Review] + Serial port idle reception to implement modbus host