Thermistor Interfacing with ARM MBED

Overview of NTC Thermistor

NTC Thermistor Picture
NTC Thermistor

 

Thermistor is a variable resistance element, whose resistance varies with changes in temperature. The change in resistance value is a measure of the temperature.

Thermistors are classified as PTC (Positive Temperature Coefficient) or NTC (Negative Temperature Coefficient).

They can be used as current limiters, temperature sensors, overcurrent protectors, etc.

For more information about thermistor and how to use it, refer the topic NTC Thermistor in the sensors and modules section.

 

Connection Diagram of NTC Thermistor with ARM MBED (LPC1768)

Interfacing Thermistor With ARM MBED

 

Measure temperature using NTC thermistor and LPC1768 ARM MBED

Here, an NTC type thermistor of 10kΩ is used. NTC of 10kΩ means that this thermistor has a resistance of 10kΩ at 25°C.

Voltage across the 10kΩ resistor is given to the ADC of your mbed board.

The thermistor resistance is found out using simple voltage divider network formula.

Rth + 10k = (3.3k * 10k)/Vout

Rth is the resistance of thermistor

Vout = 3.3 *  10k / (10k + Rth)

Vout is the voltage measured by the ADC

Vout = (3.3 * ADC_Value) / 4095

The temperature can be found out from thermistor resistance using the Steinhart-Hart equation.

Temperature in Kelvin = 1 / (A + B[ln(R)] + C[ln(R)]^3) 

where A = 0.001129148, B = 0.000234125 and C = 8.76741*10^-8 and R is the thermistor resistance.

 

NTC Thermistor Code for LPC1768 ARM MBED

#include "mbed.h"
AnalogIn thr(p15);

int main() {
	float thr_val=0, thr_res=0, temperature=0;
    while(1) {
		thr_val = (thr.read()*4095);
		thr_val = ((thr_val*3.3)/4095);
		thr_res = log(((3.3*(10/thr_val))-10)*1000);
		temperature = ((1/(0.001129148+(0.000234125*thr_res)+(0.0000000876741*thr_res*thr_res*thr_res)))-273.15);
		printf("Temperature = %3.3f\r\n", temperature);
		printf("Resistance = %3.3f\r\n", thr_res);
		wait(1);
    }
}

 

Output of ARM MBED


Components Used

ARM mbed 1768 LPC1768 Board
ARM mbed 1768 Board
1
Thermistor
Thermistor is a type of resistor whose resistance changes in accordance with change in temperature. It is used to measure the temperature over small range typically -100 °C to 300 °C.
1

Downloads

Thermistor_mbed_uvision5_lpc1768 Download
Ad