Help w/ thermistor

Hi; Trying to get some generic thermistor working I picked up at my local electronics shop and not having much luck. No apparent part number or ID on it.

The package was labeled as 200R @ 25C, which I verified with my multimeter. I started with this hooked up like:

+5v-----thermistor-----analog pin 0

And programmed like:

int sensorPin=0;
int sensorValue;
sensorValue=analogRead(sensorPin);
//then code to display this value on 7seg display

When I run this, I was always getting a readout of 1023…the max. I thought maybe I need to add in a series resistor. After that the value was in the 500’s range, but now warming/cooling the sensor has no affect!

I think this is due to a lack of understanding of the proper electronic connection that needs to be made, but have not been able to find the answer anywhere. Most solutions here or on the playground refer to hook ups of specific hardware.

Also, I read that pin14 corresponds to analog pin0…is that true? should I refer to the pin as:

pinMode(14,INPUT); or pinMode(0,INPUT); or just call an analogRead(0) without any initialization?

The examples on the “learning” page and other info I have searched out seem to be conflicting.

MUCH thanks to anyone that can help!

Any analog device needs to be part of a voltage divider circuit:

+5V --> sensor -+-> resistor --> Gnd

Where the + is is where the connection to the analog pin is made. Since the thermistor is a 200 Ohm device, I'd use a 200 Ohm resistor, too.

Also, I read that pin14 corresponds to analog pin0...is that true?

Yes, it is, when referring to digital pins. You are using it as an analog pin, though, so you need to refer to it as pin 0.

The pinMode command affects digital pins, only, so, it is not required.

Thanks Paul

I'll try the divider circuit and post my results.

Do you have an explanation as to why the divider circuit is necessary? Does this have something to do with the 1023 range the pin can sense?

Again, much thanks.

With the setup you had, the changing resistance was changing the current flowing into the pin, not the voltage. Since the voltage was constant, the readings of the voltage on the pin, relative to VRef were going to be constant.

With the voltage divider circuit, as the resistance of the thermistor changes, the voltage at the midpoint will change.

Implemented your changes and works beautifully.

Further, thanks for the impromptu electronics lesson.

Your reputation for a gentleman is only surpassed by your skill with electronic equations.

Good day to you sir!

the changing resistance was changing the current flowing into the pin, not the voltage.

Never knew that, thanks! :)

@ianC

Your reputation for a gentleman is only surpassed by your skill with electronic equations.

I think I've been insulted. My skill with electronic equations is not all that great.

+5V --> sensor -+-> resistor --> Gnd

I have one set up like this using a 2kohm resistor and thermistor but am not getting proper results. It always reads about about 200 celsius and the resistor gets really hot. It's a 1/8 watt resistor, is this enough?