Mechatronics LAB
Published © MIT

Serial Temperature Sensor– Arduino Workshop

This project we know about Serial Temperature Sensor Arduino uses the LM35 analog temperature sensor

BeginnerFull instructions provided1 hour11,813
Serial Temperature Sensor– Arduino Workshop

Things used in this project

Hardware components

Arduino uno
×1
Resistors
×1
5K ohm Trim Pot
×1
connecting wire
×1
Breadboard
×1
6×2 LCD Display Module
×1
LM35
×1

Story

Read more

Schematics

Serial Temperature Sensor– Arduino Workshop

Code

Code

Arduino
#define sensorPin A0
float Celsius, Fahrenheit, Kelvin;
int sensorValue;

void setup() {
  Serial.begin(9600);
  Serial.println("Initializing...");
}

void loop() {
  GetTemp();
  Serial.print("Celsius: ");
  Serial.println(Celsius);
  Serial.print("Fahrenheit: ");
  Serial.println(Fahrenheit);
  Serial.println();
  delay(2000);
}

void GetTemp() {
  sensorValue = analogRead(sensorPin); // Read the sensor value
  Kelvin = (((float(sensorValue) / 1023) * 5) * 100); // Convert to Kelvin
  Celsius = Kelvin - 273.15; // Convert to Celsius
  Fahrenheit = (Celsius * 1.8) + 32; // Convert to Fahrenheit
}

Credits

Mechatronics LAB
75 projects • 47 followers
I am Sarful , I am a Mechatronics Engineer & also a teacher I am Interested in the evolution of technology in the automation industry .
Contact

Comments

Please log in or sign up to comment.