SURYATEJA
Published © Apache-2.0

Monitoring Temperature Using a Temperature Sensor

How to monitor temperature using a temperature sensor.

BeginnerFull instructions provided21,604
Monitoring Temperature Using a Temperature Sensor

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Temperature Sensor
Temperature Sensor
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Temperature computing and monitoring

Code

Temperature computing and monitoring

Arduino
const int sensor=A5; // Assigning analog pin A5 to variable 'sensor'

float tempc; //variable to store temperature in degree Celsius

float tempf; //variable to store temperature in Fahreinheit

float vout; //temporary variable to hold sensor reading

void setup() {

pinMode(sensor,INPUT); // Configuring sensor pin as input

Serial.begin(9600);

}

void loop() {

vout=analogRead(sensor); //Reading the value from sensor

vout=(vout*500)/1023;

tempc=vout; // Storing value in Degree Celsius

tempf=(vout*1.8)+32; // Converting to Fahrenheit

Serial.print("in DegreeC=");

Serial.print("\t");

Serial.print(tempc);

Serial.print(" ");

Serial.print("in Fahrenheit=");

Serial.print("\t");

Serial.print(tempf);

Serial.println();

delay(500); //Delay of 1 second for ease of viewing }

Credits

SURYATEJA

SURYATEJA

18 projects • 59 followers

Comments