International Journal of u- and e- Service, Science and Technology Vol.8, No. 8 (2015), pp.189-198 http://dx.doi.org/10.14257/ijunesst.2015.8.8.19 Design of the Thermistor Tester based on MSP430 Zenglin Zhang and Xiaoqing Yu* Northwest A & F University, Shaanxi,Yangling, 712100, China E-mail:zhangzenglin115@gmail.com,yuxiaoqing115@gmail.com Abstract With the development of the single-chip microcomputer and integrated circuits, thermal resistance tester has gradually replaced the traditional temperature test equipment. The design uses the low power consumption MSP430 microcomputer as the core processor, heating power is produced by the switch tube FSDM0565RB, EMI filters is joined in the switch power supply in order to inhibit the influence of high frequency interference in AC power network on the equipment. Ref voltage of microcomputer generates through the transformation of voltage conversion chip AMS1117, signal input port uses voltage follower to minimize signal noise. The system circuit also joined some protection circuit, prevention of circuit false operation, etc. In the software design, measuring resistance judgment is achieved through the difference value of comparison measuring and standard resistance, which can shorten measure time and is very suitable for batch into production. Test results show that the thermal tester has a good stability and reliability, and meet the requirements of design. Keywords: Mirocomputers, thermistors, Sswitching mode, power supplies, filters 1. Introduction With the development of electronic technology and the wide application of thermistor, it is the popularity of measuring instruments for ultra-low power consumption single chip microprocessor and thermistor sensor [1, 2], which have a significant impact on the industrial economy and people's daily life. The measuring instrument circuit of traditional methods is complexity, cost is high, and many components in circuit directly affect the measurement accuracy. The design is thermal resistance test equipment, which mainly based on MSP430F5 series single chip microcomputer [3]. General resistance measurement methods have R-V switching voltage measurement method and R-C transformation frequency measurement, but circuits are complexity and cost are high in these methods. The most application is the bridge measurement method [4-6], but debugging is more complex. It can avoid the inconvenience and less dependence on the external environment by using the comparison method to measure the thermal resistance measurement. MSP430F5 series single chip microcomputer is applied for the main chip processing in the design [7, 8]. According to the design requirements, standard thermal resistor is used for temperature sensor. When the temperature reaches test temperature 150℃, fan works to cool the measuring system and the temperature measurement control system starts to sample at the same time. The main task of design is realizes the comparison measurement between treatment thermistor and standard thermistor, then, the accuracy is controlled according to the difference of judgment. The main hardware circuits have switch power, signal input circuit, single-chip microcomputer control circuit, 3.3 v voltage conversion circuit several parts. ISSN: 2005-4246 IJUNESST Copyright ⓒ 2015 SERSC International Journal of u- and e- Service, Science and Technology Vol.8, No. 8 (2015) 2. System Hardware 2.1 MSP430 Single Chip Microcomputer Interface Circuit Design The MSP430F5 series single chip that developed by TI company is a 16-bit super-low power consumption mixed signal processor [9, 10]. MSP430 is composed of a high gain reverse amplifier used for oscillator, fine-tuning capacitor size in the circuit will affect the oscillator frequency, the stability of the oscillator and the quickness of start up, therefore, capacitor is selected 22 pF under. Crystal oscillator frequency is 20 MHz. P5.0, P5.1 are reference voltage sides, C53, C54 are filter capacitance with 1F that are used to stable reference 2.5 v voltage and ensure accuracy of transformation. MSP430 reset uses the most simple external key reset circuit to realize, single chip microcomputer interface circuit design is shown in Figure 1. Figure 1. Design of Microcomputer Interface Circuit 2.2 Thermistor Signal Input Circuit In the design, the op-amp selects LM358 and uses ±5 v power. ADC12 kernel is one of 12 A/D converter and be able to store results in the transform memory, the kernel uses two programmable reference voltage to define converter maximum and minimum value. When the analog voltage input is higher than or equal 2.5 v, the ADC12 output is full scale value 0XFFF. ADC12 output is zero when the input voltage is equal or less than 0 v. The final conversion results of input analog voltage satisfy the formula: N ADC 4095 Vin Vr Vr Vr In the system software programming, the reference voltage selects Vr+=2.5 v, Vr-=0 v, the Vm should satisfy 0<Vm<2.5, namely, 3.3×R28/(R26+R28)<2.5 V, 3.3/(R26/R28+1)<2.5, R26>0.32R28. Due to the test minimum temperature of the thermistor under test is 50±1℃, thermistor resistance maximum is 148.6 KΩat this time, so R26Ω=51 KΩ. Thermistor signal input circuit design is shown in Figure 2. Figure 2. Design of Thermistor Signal Input Circuit 190 Copyright ⓒ 2015 SERSC International Journal of u- and e- Service, Science and Technology Vol.8, No. 8 (2015) Here, the R25 and R26 are protection resistance, resistance are 100 kΩ. R22, R23 and C110, C111 constitute a low-pass filter to ensure that the input signal is effective. 2.3 Fan and Electric Heating Control Circuit P4 and P5 are two 3 pin plug and used to install the fan and heater, respectively. K1 and K2 are two relay parameters, relay is controlled by switch circuit composed of P1.0, P1.1 and triode, control circuit is shown in Figure 3. Figure 3. The Control Circuit 2.4 The LCD Display Circuit V 3 . D N G 2 2 2 2 1 5 . R 0 R 0 R 0 R 0 0 1 0 1 0 1 0 1 4 . 9 P R13B S R D C - 3 . 9 P R13C W R - D C L 6 1 L 7 1 8 9 1 . D N G 3 1 9 P R13D N E - D C 4 1 1 1 2 1 SN74LVCC4245A U17 V 3 . 3 + 4 2 1 D 6 . 7 . 8 P D N G N G R R R R 0 0 0 0 0 0 0 0 R 0 0 1 1 1 0 . 8 P R14A 0 - D C D 1 . 8 P R14B 1 D D C - 2 . 8 P R14C 2 - D C D 3 . 8 P R14D 3 D D - 4 . 8 P R15A 4 - D C L D 5 . 8 P R15B 5 D - D C 8 P 7 R15C 6 D - D C L D - D C R R R 0 0 0 0 0 0 1 1 1 D N F n 0 7 G 4 C66 1 R15D 5 4 1 3 1 1 L 6 1 L 7 1 8 9 0 1 1 2 1 1 C L 9 8 1 7 SO-24 1 L 0 2 L 1 2 L 2 2 1 3 2 2 3 4 5 6 0 1 2 3 4 5 1 6 1 7 A L B K A B D 1 6 D 1 5 D 1 4 D 1 3 D 1 2 D 9 1 D 8 0 D 7 N E 6 W R 5 S R 4 O V 3 D D V 2 VSS 1 L 5 1 0 1 7 LCD1602 P 9 P R13A K B - D C 8 1 7 1R/0.5W L 9 1 6 R17 SO-24 0 3 5 4 R16 K 1 3 + SN74LVCC4245A 4 3 2 2 V 5 2 1 + U18 LCD display circuit is shown in Figure 4, U17、U18 are two pieces of LCD driver chip, respectively, P7 is the LCD display. Figure 4. LCD Display Circuit 2.5 Switching Power Supply Switching power supply uses pulse width modulation in the system, switching frequency is 50 KHz. Rated input voltage is 220-240V 50/60Hz, DC output +5 v, +24 v, -5 v supply for fan, heater and op amp, respectively, power is 50 w. 2.5.1 The Input Circuit of Switching Power Supply Input circuit including insurance circuit, low pass filter and rectifier filter circuit several parts, as shown in Figure 5. Insurance circuit is composed of F1 insurance tube that fusing rapidly when the insurance tube current exceeds rating 5 A to prevent the circuit components damaged due to overheating. Copyright ⓒ 2015 SERSC 191 M 2 2 2 4 2 1 1 Y C X 1 L 6 0 68uF/400V 1A/400V 1 F 2 1 M 2 2 D N G D N 2 G Y C 6 0 2 K 0 1 6 K 8 6 2 1 R N 5 D 4 1 T R N I _ ~ - A 5 / V 0 5 2 + ~ + 1 J C A L2801 W S _ C A 2 C 1 1 2 1 2 J C D K 0 8 6 C 4 7 4 R 2 International Journal of u- and e- Service, Science and Technology Vol.8, No. 8 (2015) Figure 5. The Input Circuit of Switch Power Here, TNR1 is varistor, EMI filter circuit consists of C1, R1, R2, L1, CX, CY1, CY2. CY1, CY2 can inhibit the surge current and protect diode. D1 is rectifier bridge pile and constitutes a bridge rectifier circuit. C2 is the power filter capacitor, rectifier filter circuit directly rectifier, filter for 220 v, 50 Hz AC voltage into about 300 v DC voltage. 2.5.2 Pulse Oscillation Circuit 6 5 4 3 C 2 4 2 H u 0 1 47uF/35V V 5 + 6 0 2 47uF/35V C15 47uF/35V -5V L12 C12 2 1 H H u 0 1 6 0 2 1 L13 0 6 0 2 1 H u 0 1 7 3 2 1 C11 D11 8 5 5 D N G A D N 5 R 1000uF/16V 5 0 2KF 8 0 Y 2KF 6 5 0 8 0 7 5 0 3 5 0 8 PC817 PGND DIP-4 2 U 0 TO-92 1.2K TL431 F n 7 4 8 0 5 0 8 5 9 R F n 0 1 0 U C13 K 8 1 0 8 0 8 R K 1 7 R 47uF/35V 8 C C 10nF/1KV 5 0 8 0 R + F n 0 1 C 6 3 D 3 V B F 4 6 C SR560 G FR103 C N C C D N G 2 L11 + D Vstr + FR103 6 D 1 FR103 + 6 0 1 u 0 2 1 1000uF/16V 9 10nF/1KV TO220-F6L FSDM0565RB D12 2 4 C 1 U 470uF/35V + C16 C10 + 流 整 1 + C14 TO220 1 1 1 L10 + D10 F10LC20U 1 T T2834_12 4 R 100K/1W 3 68K/1W R 1 D 2 P Pulse oscillation circuit including switching transformer primary winding, adjust tube, starting circuit, oscillating circuit, pulse width adjustment, error amplifier circuit, etc., is mainly composed of three loop circuits. Figure 6 is a simplified circuit of the pulse oscillation circuit, the switch tube FSDM0565RB, switch transformer T1, capacitor C7 composed of oscillation circuit, which function is produce high frequency oscillation and output rectangular pulse. Figure 6. The Simplified Diagram of Pulse Shock Circuit 2.5.3 The Output Circuit of the Switch Power Supply The output circuit of the switch power supply is shown in Figure 7, 7-8, 9-10,11-12 are secondary output winding of the switch transformer, C10, L10, C14 composed of ∏ type filter and change the high frequency pulse of high frequency rectifier output into a smooth DC. Because it is the high frequency filter, filter element value and volume are small. The switch tube during exit saturation to stop, the same name end of the switch transformer secondary winding will change potential to make the rectifier diode D10, D11 positive conducting, the magnetic energy of secondary coil 7-8, 11-12 can be converted into electrical energy and supply power to the load, and charging for C10, C11 at the same time. During the switch tube saturation and conductivity, the induced voltagethe of secondary coil 7-8, 11-12 makes D10, D11 cut-off, C10, C11 capacitor began to discharge and supply power to load through the accumulation energy. 192 Copyright ⓒ 2015 SERSC 2 6 5 4 3 C 2 4 2 H u 0 1 47uF/35V V 5 + 6 0 2 47uF/35V -5V L12 C12 47uF/35V H 6 u 0 1 0 2 1 L13 6 2 0 H u 0 1 D N G A D N 1000uF/16V Y D N G 10nF/1KV C 6 SR560 G C11 D11 8 5 L11 + + 1 0 7 3 1 FR103 + 6 0 2 1 C16 H u 0 1 1000uF/16V 9 D12 2 1 2 470uF/35V + C15 C10 + 1 + C14 TO220 1 1 1 L10 + D10 F10LC20U 1 T2834_12 T 1 D P International Journal of u- and e- Service, Science and Technology Vol.8, No. 8 (2015) Figure 7. The Output Circuit of Switch Power 2.5.4 Voltage Control Circuit 4 2 H u 0 1 47uF/35V V 5 + 6 0 2 47uF/35V C15 47uF/35V -5V L12 C12 u 0 1 H H u 0 1 6 0 2 1 L13 6 0 2 1 H u 0 C11 D11 8 5 R D N 5 5 0 8 0 2KF Y C 2KF 6 5 0 8 0 7 5 0 8 3 5 0 8 PC817 2 PGND DIP-4 U 0 TO-92 1.2K 9 R TL431 F n 7 4 5 0 5 0 8 F n 0 1 0 U C13 K 8 1 0 8 0 8 R K 1 7 R 47uF/35V 8 C C 10nF/1KV 5 0 8 0 R + F n 0 1 1000uF/16V 6 3 D C C V B F 3 6 4 C SR560 G FR103 5 C N D N G 2 L11 + D Vstr + 1 0 7 3 1 6 1 FR103 + 6 0 2 1 1000uF/16V 9 TO220-F6L FSDM0565RB D12 2 1 2 1 U 470uF/35V + C16 C10 + 1 + C14 TO220 1 1 1 L10 + D10 F10LC20U 1 T2834_12 T It can be included from U0=(T1/T)×Ui, the high and low of the output voltage can be adjusted as long as the adjust switch pulse duty ratio, namely the control switch tube conduction time. The longer switch tube conduction, the higher the output voltage, the lower conversely. Voltage control circuit is mainly composed of sampling comparison, error amplifier, pulse width adjustment and other parts, which is shown in Figure 8. Figure 8. The Stabilized Voltage Control Circuit Resistor R5, R6 constitutes the voltage sampling circuit and TL431, PC817 constitutes voltage comparison circuit, TL431 is integrated voltage regulator block which has three terminals are reference terminal R, anode, A cathode K, respectively. It uses shunt voltage method, namely anode terminal grounding, the reference voltage terminal connects R5 partial pressure, the cathode terminal connects photocell as adjustment terminals. The output of voltage value is: Vout (1 R5 ) U Re f R6 , Because the circuit requires stable 5 v voltage value: R5=R6=1.2 KF. The R5 partial pressure is input of the sampling voltage. 3. System Software System software design mainly includes: main program module, the basic time delay module, clock setting module, AD conversion module, LCD display module, etc. System is firstly initialized, mainly is the chip initialization, the initial time of clock circuit is set up, waiting for buttons command through the query way, the entire system begins to work if the button is pressed. For programming, the main program mainly realize the comparison of the sampling data, display control, key control, collection complete judgment, data archiving, etc. The main program flow chart is shown in Figure 9. Copyright ⓒ 2015 SERSC 193 International Journal of u- and e- Service, Science and Technology Vol.8, No. 8 (2015) 开始 初始化 否 按键标志位 P2.4=0 是 否 加热到180℃ 是 加热停止风扇工作 开始采样 否 采样64组 是 两组数据做差值 运算 符合标准 否 显示NG 是 显示PASS Figure 9. The Flow Chart of Main Program 3.1 The Timer Interrupt Program Interrupt time interval is controlled by timer A, an interrupt is generated every 240 ms, A/D conversion samples once until the complete of 64 data acquisition. Interrupt cycle produces program is followed: void Timer1Init(void) {TA1CTL |= MC_1+MC_2 + TASSEL_2; TA1CTL |= ID_2; TA1CCR0 = 0xEA60; CLRB(TA1CTL,TAIFG); TA1CTL |= TAIE; __bis_SR_register(GIE);} Interrupt entry procedures are follows: # pragmavector=TIMER1_A1_VECTOR __interrupt void Timer1(void) { } 3.2 The Heating Module Settings After the port initialization, the main program comes into the heating module to heat thermistor. The heating temperature is 180 ℃. When the thermistor resistance is heated to 180 ℃, thermistor is 7 kΩ and the MCU voltage value is: u=3.3/(50+7)×7=0.405v, NADC=4095×0.405/2.5=73.71=0X49. Procedures is follows: do { P2OUT |= 0X01; } while(ADC12MEM1 < 0X49); P2OUT |= 0X00; P2OUT |= 0X02; Here, P2.1 is heating control port and effective at high level, ADC12MEMI is temporary address of AD conversion A0 data. When heating temperature reaches 180 ℃, fans began to heat dissipation and measure. 194 Copyright ⓒ 2015 SERSC International Journal of u- and e- Service, Science and Technology Vol.8, No. 8 (2015) 3.3 The Data Processing Program When interrupt data acquisition reaches 64 group, processing program starts to average 64 data. Because the temperature difference control of the thermistor can affect on the fixing system control when it is more than 4 ℃ , the resistance of the temperature difference 4 ℃ is 500 Ω. Accuracy control functions: d 精度 3.3 (⊿ 0.5) 3.3⊿ d 精度 50.5 ⊿ 50 ⊿ , 82.5 ⊿ 100.5⊿ 2525 , 2 Here, ⊿ is the thermistor resistance under 50 ℃~180 ℃. The smaller d value, the higher control precision. When the voltage difference value is 0.006 v through calculation, the resistance is judged as NG, ⊿ NADC= 4095×0.006/2.5=9.8≈10=0XA. Procedures is follows: while(1){ if (nADC_Flag ) {nADC_Flag=0; for (i=0;i<64;i++) {pBuf_1[i]=ADC_BUF_Temp_1[i]; pBuf_2[i]=ADC_BUF_Temp_2[i]; } sum_1=0; sum_2=0; for(i=0;i<64;i++) {sum_1+=pBuf_1[i]; sum_2+=pBuf_2[i]; } sum_1 >>= 6; sum_2 >>= 6; fval=(float)(sum_1-sum_2); if (fval<0) fval = -fval; 4. Conclusions Before drawing PCB, all components encapsulation need to be added Some packaging can be directly found in Protel standards component library, but some components encapsulation need to be drawed, such as FSDM0565RB, PC817, TL431, T2834, ASM1117 and single chip microcomputer MSP430F5438 and so on. PCB can be drawed after encapsulation are added into schematic diagram. Circuit board adopts double, the size and shape of the circuit board should be considered. The automatic wiring easys to cause the interference of high frequency on signal lines, if the top and the bottom line are parallel, capacitive coupling is easiley conduced and lead to signal interference. Design uses manual wiring, and the simple circuit part adopts automatic wiring, PCB circuit board is shown in Figure 10. Figure 10. PCB Circuit Board In the design, thermal resistance tester is a kind of high precision, wide range high speed impedance measurement instrument. Thermal resistance tester based on single chip Copyright ⓒ 2015 SERSC 195 International Journal of u- and e- Service, Science and Technology Vol.8, No. 8 (2015) microcomputer reading is convenient and precision is high. The thermal resistance tester has high measurement precision, fast speed, wide range, etc. At any scale range, it has the same test speed and stable performance. ACKNOWLEDGEMENTS The authors wish to thank the National Engineering Research Center for Water-Saving Irrigation, which partially supported this research through the “ China Postdoctoral Science Foundation funded project ” (2014M552495) and the “ Twelfth Five-Year" National Science and Technology Support Program” (2011BAD29B08),The authors are also grateful to the anonymous reviewers for their valuable feedback. References X. J. Wang, “Design and application of thermistor type temperature control circuit”, Anhui Science & Technology, no. 5, (2007), pp. 43-44. [2] X. L. Song, “Thermal Assistance and Photosensitive Assistance”, Sci-Tech Information Development & Economy, vol. 16, no. 16, (2006), pp. 256-257. [3] H. B. Hua, “Application of MSP430F449 on Small-scale and Low-power Data Acquisition Module”, Modern Electronics Technique, vol. 30, no. 9, (2007), pp. 141-142. [4] C. Jin, Z. R. Kang, X. T. Li, et al., “Study on characteristic between resistance and temperature of negative temperature coefficient”, Metrology and Measurement Technique, vol. 36, no. 12, (2009), pp. 50-51. [5] X. H. Ni, L. L. Zhang and G. X. Ren, “Design of High Precision Thermistor Temperature Measurement Based on MSP430F2013”, Instrument Technique and Sensor, no. 3, (2009), pp. 100-101. [6] K. K. Tian, “Temperature Measurement Based on AVR Capture Interrupt and Thermistor”, Modern Electronics Technique, no. 3, (2008), pp. 138-140. [7] X. Y. Shen, X. N. Wang and W. J. Li, “Design of low-power consumption temperature collecting alarm system based on MSP430”, Industrial Instrumentation & Automation, no. 3, (2009), pp. 31- 33. [8] L. Wang, Z. X. Wang and H. Wang, “Multi-spots Wireless Temperature Detecting System Based on MSP430”, Modern Electronics Technique, vol. 34, no. 1, (2011), pp.125-127. [9] L. Chen, X. C. Den and Q. Sun, “Design of a Muti-channel Data Collecting System Based on MSP430 Single Chip Computer”, Modern Electronics Technique, vol. 29, no. 20, (2006), pp. 107-109. [10] L. J. Li, Y. T. Song and G. H. Feng, “Design of New Carbon Monoxide Alarm Apparatus Based on Low-Power MSP430 Single Chip”, Modern Electronics Technique, vol. 30, no. 24, (2007), pp. 67-68. [1] Authors Xiao Q. Yu, received the B.S. degree from Department of Information Engineering, Lanzhou University of Finance and Economics, Lanzhou, China in 2006. She received her M.S. degree and Ph.D. degree from Department of Mechanical and Electric Engineering and Department of Water Resources and Architectural Engineering, Northwest A & F University, Shaanxi, China in 2009 and 2013, respectively. Currently, she is pursuing postdoctor degree from Department of Water Resources and Architectural Engineering under the supervision of Prof. Wen T. Han. Her current research interests are in Agricultural Water-Soil Engineering and Wireless Sensor Networks. 196 Copyright ⓒ 2015 SERSC International Journal of u- and e- Service, Science and Technology Vol.8, No. 8 (2015) Wen T. Han, received his B.S. degree from Department of Mechanical and Electric Engineering, Northwest Agriculture University, Shaanxi, China in 1996. M.S. and Ph.D. degree from Department of Mechanical and Electric Engineering, Northwest A & F University, Shaanxi, China in 1999 and 2004, respectively. Working Experiences: 2005-present: researcher, Institute of Soil and Water Conservation of Chinese Academy of Sciences Northwest A & F University, National Engineering Research Center for Water Saving Irrigation at Yangling. 2004-2005: Assistant Professor, Department of Mechanical and Electric Engineering, Northwest A & F University. 2001-2004: A lecturer, Department of Mechanical and Electric Engineering, Northwest A & F University. Research Interests: Information monitoring of crop and environment; intelligent control for precise irrigation; water distribution Simulation of sprinkler irrigation; Development of nozzle Currently, he published academic papers more than 30, including SCI and EI articles 16; the national invention patent 6. Zeng L. Zhang, received his B.S. degree from Department of Mechanical and Electric Engineering, Harbin institute of Technology, Harbin, and M.S. degree from Department of Mechanical and Electric Engineering, Northwest A & F University, Shaanxi, China in 2000 and 2007, respectively. Currently, he is a teacher in Department of Mechanical and Electric Engineering, Northwest A & F University, Shaanxi. He is pursuing Ph.D. degree under the supervision of Prof. Pu T. Wu. His current research interests are in Agricultural Water-Soil Engineering and Wireless Sensor Networks. Copyright ⓒ 2015 SERSC 197 International Journal of u- and e- Service, Science and Technology Vol.8, No. 8 (2015) 198 Copyright ⓒ 2015 SERSC