edge lab LIVE! starts Tuesday in Munich. Grab a workshop seat and take home the board you build on. Code FRIEND-HACKSTER saves 20%. () Learn more!
이하늘gledel임동교
Published © LGPL

InoLab: Reading a Temperature Sensor

This project was made by Innovation Lab at Bongilcheon High School.

BeginnerShowcase (no instructions)30 minutes570
InoLab: Reading 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

s_UcKv1hUYjy.PNG

Code

Untitled file

Arduino
const int tempPin = 0;
int tempVal;
float volts;
float tempC;
float tempF;
void setup()
{
Serial.begin(9600);
}
void loop()
{
tempVal = analogRead(tempPin);
Serial.print("TempVal = ");
Serial.print(tempVal);
Serial.print(" **** ");
volts = tempVal * 3.3;
volts /= 1023.0;t
Serial.print("volts: ");
Serial.print(volts, 3);
Serial.print(" **** ");
tempC = (volts - 0.5) * 100 ;
Serial.print(" degrees C: ");
Serial.print(tempC);
Serial.print(" **** ");
tempF = (tempC * 9.0 / 5.0) + 32.0;
Serial.print(" degrees F: ");
Serial.println(tempF);
delay(1000);
}

Credits

이하늘
5 projects • 3 followers
gledel
100 projects • 117 followers
Looking back on my childhood, I was happy when I was making something and I was proud of myself. "Making is instinct!"
임동교
0 projects • 12 followers

Comments