Thermistor in Arduino Sidekick Basic Kit

Arduino, Seeeduino Serials and mutants. Share your problems and experence on arduino compatible board such as seeeduino/stalker, etc.

Moderators: lily.li, violet, salmanfarisvp

Post Reply
arpeland
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Wed Jun 22, 2011 6:30 am

Thermistor in Arduino Sidekick Basic Kit

Post by arpeland » Wed Jun 22, 2011 6:33 am

Can you give me some info on this thermistor?

All I have is what is on the side 503.

simon su
Pre-kindergarten
Pre-kindergarten
Posts: 29
Joined: Fri May 27, 2011 9:04 am
Are you a staff member of seeedstudio?: yes
Which products/projects are your favorite?: Seeeduino V2.21 DSO Nano v2

Re: Thermistor in Arduino Sidekick Basic Kit

Post by simon su » Wed Jun 22, 2011 11:06 am

Hi, arpeland

You can referece here.

Regards,
Simon

cjay.martin
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Sat Feb 25, 2012 3:56 am

Re: Thermistor in Arduino Sidekick Basic Kit

Post by cjay.martin » Sat Feb 25, 2012 4:56 am

Thanks for that info.

I haven't tested it on the actual Thermistor yet, but for those who want S-H coefficients, I got:

S-H coefficient A = 9.6564E-04
S-H coefficient B = 2.1069E-04
S-H coefficient C = 8.5826E-08

The tool I used to grab the coefficients confirmed 10 random tests across the gamut of this pdf file. My final equation (I intend to load into the IDE and test today:


Ok...I'm tossing out what I had (there were some minor errors). This is what I'm using now. And it works, perfectly. I'm going to go into detail because it was surprisingly hard to find all the answers in one place, and this is certainly a great project for first-timers.

I've got my 503 thermistor in serial with a 10kOhm resistor (I don't have any 50's to make my math easier. Oh well). In the middle of the series is a jumper to an analog input.

All you have to do is #define SERIESRESISTOR to be the resistor in series to the thermistor

Code: Select all

#define SERIESRESISTOR 10000
.

Then call this.

Code: Select all

double getTemperature(int pin) {
  int v = analogRead(pin);   //voltage of the thermpin
  double res = (1023.0/v)-1;
  res = SERIESRESISTOR / res;
  double temp = (1/(0.00096564 +(0.00021068 * log(res) ) +(0.000000085826*( pow( log(res) ,3)))))-273.15;
  temp = (temp * 9.0/5.0)+32;
  return temp;
}

erbedo
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Fri Nov 02, 2012 2:47 am
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: GPRS

Re: Thermistor in Arduino Sidekick Basic Kit

Post by erbedo » Fri Nov 02, 2012 4:11 pm

Hi
I have the same thermistor as you, but I can't get your code working. I mean, the code itself is working, but the temperature from the sensor is read as nearly 100 degrees, while in my house I have about 23 degrees.

Did you ran into similar problems?

wired746
Pre-kindergarten
Pre-kindergarten
Posts: 5
Joined: Sat Nov 03, 2012 11:18 am

Re: Thermistor in Arduino Sidekick Basic Kit

Post by wired746 » Sun Nov 04, 2012 1:42 am

erbedo wrote:Hi
I have the same thermistor as you, but I can't get your code working. I mean, the code itself is working, but the temperature from the sensor is read as nearly 100 degrees, while in my house I have about 23 degrees.

Did you ran into similar problems?
the temp is being calculated in F i hope your house is C
which you would comment out the
temp * 9 / 5 + 32

wired746
Pre-kindergarten
Pre-kindergarten
Posts: 5
Joined: Sat Nov 03, 2012 11:18 am

Re: Thermistor in Arduino Sidekick Basic Kit

Post by wired746 » Sun Nov 04, 2012 1:48 am

/*
* Inputs ADC Value from Thermistor and outputs Temperature in Celsius
* requires: include <math.h>
* Utilizes the Steinhart-Hart Thermistor Equation:
* Temperature in Kelvin = 1 / {A + B[ln(R)] + C[ln(R)]3}
* where A = 0.001129148, B = 0.000234125 and C = 8.76741E-08
*
*
* Schematic:
* [Ground] -- [10k-pad-resistor] -- | -- [thermistor] --[Vcc (5 or 3.3v)]
************************************** |
* **********************************Analog Pin 0
*
*
* The resistance calculation uses the ratio of the two resistors, so the voltage
* specified above is really only required for the debugging that is commented out below
*
* Resistance = (1024 * PadResistance/ADC) - PadResistor
*
*/

#include <math.h>

#define ThermistorPIN 0 // Analog Pin 0

float vcc = 5.00; // only used for display purposes, if used
// set to the measured Vcc.
float pad = 10500; // balance/pad resistor value, set this to
// the measured resistance of your pad resistor
float thermr = 10000; // thermistor nominal resistance

float Thermistor(int RawADC) {
long Resistance;
float Temp; // Dual-Purpose variable to save space.

Resistance=((1024 * pad / RawADC) - pad);
Temp = log(Resistance); // Saving the Log(resistance) so not to calculate it 4 times later
Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
Temp = Temp - 273.15; // Convert Kelvin to Celsius
Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert to Fahrenheit comment out for Celsius
return Temp; // Return the Temperature
}

void setup() {
Serial.begin(115200);
}

void loop() {
float temp;
temp=Thermistor(analogRead(ThermistorPIN)); // read ADC and convert it
//Serial.print("Celsius: "); // comment and uncomment the desired reading
Serial.print("Fahrenheit: ");
Serial.print(temp,1); // display Temp
Serial.println("");
delay(5000); // Delay time to read
}

stonent
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Thu Jan 03, 2013 12:59 pm

Re: Thermistor in Arduino Sidekick Basic Kit

Post by stonent » Sun Jan 06, 2013 7:22 am

I tried the code example and tweaked the 10k because I was getting 9.740K and am getting temp readings of about 17F in my room. It almost seems like I'm reading C but outputting as F. I didn't want to truly assume that because I don't know if there was something else to tweak in the code.

Right now I've got the 503 "50k" thermistor from the kit and the only thing I tweaked in the code was the value of the 10k resistor.

jhonmarvi
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Tue Jan 22, 2013 7:26 pm

Re: Thermistor in Arduino Sidekick Basic Kit

Post by jhonmarvi » Tue Jan 22, 2013 7:31 pm

The tool I used to grab the coefficients confirmed 10 random tests across the gamut of this pdf file. My final equation I intend to load into the IDES and test today:
I'm tossing out what I had (there were some minor errors). This is what I'm using now. And it works, perfectly. I'm going to go into detail because it was surprisingly hard to find all the answers in one place.
Urge Tech

User avatar
Jacket Chen
Staff
Staff
Posts: 659
Joined: Thu Jun 21, 2012 4:25 pm
Are you a staff member of seeedstudio?: yes
Which products/projects are your favorite?: Seeeduino Shields
Location: China

Re: Thermistor in Arduino Sidekick Basic Kit

Post by Jacket Chen » Wed Jan 23, 2013 9:56 am

I have a new docu of this thermistor , maybe you can have a look.

:lol: And there are some chinese words within.
Love little, love long.

hanifnoor8877
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Tue Mar 08, 2016 2:11 pm

Re: Thermistor in Arduino Sidekick Basic Kit

Post by hanifnoor8877 » Tue Mar 08, 2016 2:13 pm

it works, perfectly. I'm going to go into detail because it was surprisingly hard to find all the answers in one place.
NOOR

Post Reply