0% found this document useful (0 votes)
7 views2 pages

Document 60

The document outlines a program to detect temperature using a temperature sensor and Arduino. It includes an algorithm with steps for initializing the sensor, reading the temperature, and displaying it on the serial monitor. The program successfully reads the temperature and outputs the result, confirming the successful development of the project.

Uploaded by

puhazh03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Document 60

The document outlines a program to detect temperature using a temperature sensor and Arduino. It includes an algorithm with steps for initializing the sensor, reading the temperature, and displaying it on the serial monitor. The program successfully reads the temperature and outputs the result, confirming the successful development of the project.

Uploaded by

puhazh03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

EX NO:5D TEMPERATURE SENSOR

Aim:
To write a program to detect temperature using temperature sensor and

Arduino.

Algorithm:
Step 1: Start.

Step 2: Initialize the digital pin.

Step 3: Read the analog value to the sensor.

Step 4: Read the temperature.

Step 5: Display the temperature using serial monitor.

Step 6: Stop.

Program:
Int val;

Int temppin=2;

Void setup()

Serial.begin(9600);

Void loop()

Val = analogread (temppin);

Float mv = (val/1024.0) *5000;

Float cel = mv/10;

Serial.print("temprature = ");

Serial.print(cel);

Serial.print("*c");
Serial.println();

Delay(1000);
}

OUTPUT:

Result:
Thus the program to detect temperature using temperature sensor and Arduino

was developed successfully.

You might also like