Temperature sensor schematic needed

Post Reply
bobgardner
Posts: 1
Joined: Tue Apr 03, 2012 9:34 am

Temperature sensor schematic needed

Post by bobgardner » Tue Apr 03, 2012 9:36 am

The Arduino analog temperature sensor doesn't have a thermistor on it, it has an LM35. Can you add a link to the schematic so I know how to read it? Or a link to a c routine to read it?

User avatar
jack
Posts: 77
Joined: Sat Mar 03, 2012 2:25 pm

Re: Temperature sensor schematic needed

Post by jack » Thu Apr 05, 2012 4:15 pm

Hi,there
Sorry friend, I don't have the schematic. The one standing on the board is thermistor,another IC on the board is LM358,Low Power Dual Operational Amplifiers,not LM35.

relating code:

Code: Select all

#include <math.h>

double Thermister(int RawADC) {
 double Temp;
 Temp = log(((10240000/RawADC) - 10000));
 Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
 Temp = Temp - 273.15;            // Convert Kelvin to Celcius
 Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
 return Temp;
}

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

void loop() {
 Serial.println(int(Thermister(analogRead(0))));  // display Fahrenheit
 delay(100);
}


Regards,
Jack

knut_ny
Posts: 8
Joined: Fri Mar 30, 2012 3:56 am

Re: Temperature sensor schematic needed

Post by knut_ny » Tue Apr 10, 2012 2:49 am

I guess thats easy.
The LM35 has three lines: Ucc, gnd and analog out.
Hold the TO92 facing you - pins down:
Ucc-> 5V (left pin)
gnd-> GND (right pin)
Uout ->analog X (middle pin) (X=0..5)

The voltage you get is 10mV / deg C (cannot measuser below freezing with this method)

int val= analogRead(X); // read LM35
float voltage=val*5.0/1023.0; //convert to actual voltage
float tempC=val*100; // scale to show deg C

This vil give you approx 1/5 deg resolution (want better..--> need an OP-amp!)

Its possible to read temp down to -6 degC if you add a diode and a resistor
This will take two analog inputs (using the difference to indicate temp)

Knut, Norway

User avatar
techsupport
Site Admin
Posts: 210
Joined: Sat Mar 03, 2012 2:32 pm

Re: Temperature sensor schematic needed

Post by techsupport » Wed Apr 11, 2012 3:59 pm

yeap, you make it works now? :roll:
Your real trustworthy partner in China!!
Email: forum@geeetech.com

Post Reply