Jump to content

Questions using a resistor-dividor to read a thermistor

Recommended Posts

Hi all,


I have a very simple setup where I connect a resistor of 56k from VCC to P1.2 (G2231 chip) and a thermistor (380k at 15degrees) from P1.2 to GND. Theory predicts that at 15 degrees I should read 380/(380+56)*1024 = 892 on the ADC of channel_2. However I am not reading this type of values at all, the values I read are 984. The readouts are stable and react when I touch the thermistor.


Here's the configuration of the ADC

/* Configure ADC Channel */

ADC10CTL1 = INCH_2 + ADC10DIV_3 ; // Channel 2, ADC10CLK/4

ADC10CTL0 = SREF_0 + ADC10SHT_3 + ADC10ON + ADC10IE; //Vcc & Vss as reference

ADC10AE0 |= BIT2;


The G2231 is running on DCO at 1 Mhz.


and this is inside a while (1) loop


__delay_cycles(1000); // Wait for ADC Ref to settle

ADC10CTL0 |= ENC + ADC10SC; // Sampling and conversion start

__bis_SR_register(CPUOFF + GIE); // LPM0 with interrupts enabled

ADC10CTL0 &= ~ENC;

value= ADC10MEM;


Any idea where I should look for a solution ?



Cor B

The Netherlands

Link to post
Share on other sites



Ive measured the Thermistor (NTC) using the DMM at 15 degrees disconnected and it was 380Kohms. The odd thing is that when I measure the V at P1.2 that does correspond to the reading of the ADC. So the ADC sees the right voltage (just over 3V and the lauchpad produces a Vcc of 3.55.

I could mount the NTC indeed between Vcc and P1.2 to get another type of reading but thats not a worry currently. I am just wondering why the reading is so far off what I expect it to be, the unit behaves next to that OK. Ive tested at 100 degrees using boiling water and the reading was a lot lower but not as low as I expected based on my readings of the Thermistore when connected to the DMM.


Thanks for the comments.



Link to post
Share on other sites



Indeed the 100 degree value is a lot lower but not as low as you would expect. The actual value of the thermistor measured using the DMM is about 13k at 100 degrees and the readout was 490. So with 56k above the P1.2 and 13k below (to GND) you would expect a far lower reading. Ive also checked if the reading can go to 0 at all by simply shorting the P1.2 to GND and ... it went to 0


I picked the 56k based on the colours and measured its value (wanted to be sure) with the DMM and ... it was 56k (give or take 100 ohms or so).



Link to post
Share on other sites

Hi Rusty,


The Thermistor is a probe that comes from an electronic kitchen temperaturement tool. Ive warmed water up to the boiling point and then measured the resistance. Then let the water cooldown (which goes slow) and I have then simply let the kitchen tool tell me when the temperature was for instance 80 degrees and at that moment I have done another measurement of the thermistor. The curve I got was as expected and could be described easily using a simple regression analysis.


BUT ... Ive found where the issue resides ... its in the port itself. If I move the setup with the thermistor at pin P1.0 and removing the LED0 jumper I get a real proper and good measurement over the full range which is close to expectation. Moving it to P1.1 or P1.3 gives comparable issues as P1.2

The reason I was using these pins is that I will have the P1.4 - P1.7 as the databit section to steer an LCD unit.

Probably the issues with P1.1,P1.2,P1.3 are due to the nature of these pins (TX,RD,S2). Ive read recently that S2 (P1.3) also is linked to a set of onboard resitors/capacitors.


At least this is a good lesson, I am now going to see how I can proceed !





Link to post
Share on other sites

OH! Duh! Yep, that LED will definitely affect your measurements!

P1.3 has an external pullup resistor and capacitor for the S2 switch.

With the v1.5 versions of the boards, it is said that these components

have been removed.


Naturally, you have the LEDs on P1.0 and P1.6.

Oh, while I'm thinking about it, you might also make sure that

the port's pullup and pulldown resistors (internal to the '430)

are not activated in your code! Off hand I don't know what the

defaults are for that functionality but it can looked up in the chip manual.


Can't imagine the problem with P1.1 and P1.2 though. Oh yes I can! Those

pins do TX/RX with the USB processor. That can be disconnected (after your

downloads) via J3. I need to look at all of the schematics more often. :-)


Good job, Cor!



Link to post
Share on other sites

Hi Rusty,


P1.1 and P1.2 TX/RX are also having onboard pullups of 47K it seems and without removing the jumpers they are off course connected to the USB-driver also ... another lesson !


I now got the system working with a display and showing degrees, thanks for chiming in.



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...