Connecting Thermistor to microcontroller?

Hi there,

How to connect a smd Thermistor (see link) to a microcontroller? I could not find it in the data sheet. Thanks

Regards

http://www.alliedelec.com/Images/Produc … 860279.pdf

Greetings (No First Name Supplied),

smdFan:
How to connect a smd Thermistor (see link) to a microcontroller? I could not find it in the data sheet.

A thermistor is a temperature dependent resistor, in your

case it’s a PTC (positive temp coefficient). So "more temp gives

more ohms".

Your uC may have an ADC input, and with it you can read the

temperature of the thermistor, and use the data as you see

fit. If you just need an on-off condition you can use a

Schmitt trigger circuit to clean up the thermistor signal

and give a clean digital switch level to the uC. If the uC

has an analog comparator input you don’t need the

schmitt trigger circuit.

In any case you need to bias the thermistor with a

second resistor from a stable DC power supply.

The voltage divider will give an output voltage that

is Vout = vin(Rt/(R1 + Rt))

If your thermistor is 4k7 at, say, 75degC, and R1

is also 4k7, and the supply is 5V, the voltage will

be 2.5V. Your uC ADC may require a smaller

voltage for full scale, perhaps 1.024V. The voltage will

go up as the temperature goes up.

At room temp the same thermistor will be about 470R,

and the ADC input voltage becomes 454mV.

Note that the thermistor is non-linear. See the graphs in

the data sheet that you linked.

For a new design I’d choose R1 to give one half the

ADC range at room temp, but if you’re thinking of

a hotter (or cooler) application you might use that

temp as your centre value.

Comments Welcome!

bigglez:
Greetings (No First Name Supplied),

smdFan:
How to connect a smd Thermistor (see link) to a microcontroller? I could not find it in the data sheet.

A thermistor is a temperature dependent resistor, in your

case it’s a PTC (positive temp coefficient). So "more temp gives

more ohms".

Your uC may have an ADC input, and with it you can read the

temperature of the thermistor, and use the data as you see

fit. If you just need an on-off condition you can use a

Schmitt trigger circuit to clean up the thermistor signal

and give a clean digital switch level to the uC. If the uC

has an analog comparator input you don’t need the

schmitt trigger circuit.

In any case you need to bias the thermistor with a

second resistor from a stable DC power supply.

The voltage divider will give an output voltage that

is Vout = vin(Rt/(R1 + rt))

If your thermistor is 4k7 at, say, 75degC, and R1

is also 4k7, and the supply is 5V, the voltage will

be 2.5V. Your uC ADC may require a smaller

voltage for full scale, perhaps 1.024V. The voltage will

go up as the temperature goes up.

At room temp the same thermistor will be about 470R,

and the ADC input voltage becomes 454mV.

Note that the thermistor is non-linear. See the graphs in

the data sheet that you linked.

For a new design I’d choose R1 to give one half the

ADC range at room temp, but if you’re thinking of

a hotter (or cooler) application you might use that

temp as your centre value.

Comments Welcome!

Thanks a lot. That was very helpful.

Regard

Good advice overall.

However, one issue that I would put some thought into is noise. For a comparator and ADC, when the input value is right at the trigger point, electrical noise will cause it to “chatter”. A Schmitt Trigger is a good solution because it provides hysteresis and prevents chattering. In the wave forms below, U is the input signal, A is what you would see at the trigger level and B is what you will see with hysteresis.

http://upload.wikimedia.org/wikipedia/c … ph.svg.png

In some applications like controlling motors or other electromechanical devices, chattering can be really bad while in others like lighting control, it can be merely annoying.

You can simulate hysteresis in an ADC by changing the trigger point based on the last trigger action. With a comparator in a micro, you can do the same thing to gain hysteresis. In some applications, averaging the ADC input may be acceptable.