LM35 SETUP

LM35

int val;

int tempPin = 1;

void setup()

{

temperature = (5.0 * reading * 100.0) / 1024;

}

void loop()

{

val = analogRead(tempPin);

float mv = ( val/1024.0)*5000;

float cel = mv/10;

float farh = (cel*9)/5 + 32;

Serial.print(“TEMPRATURE = “);

Serial.print(cel);

Serial.print(“*C”);

Serial.println();

delay(1000);

}

OTHER SKET

float temperature;

int reading;

int lm35Pin = 1;

void setup()

{

analogReference(INTERNAL);

Serial.begin(9600);

}

void loop()

{

reading = analogRead(lm35Pin);

temperature = reading / 9.31;

Serial.println(temperature);

delay(100);

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s