Arduino LED Temperature Indicator

Arduino LED Temperature Indicator

Give this the parameters you want and the LEDs will light up according to the temperature cold blue, green fine, red hot

  • 18,070 views
  • 2 comments
  • 11 respects

Components and supplies

About this project

Step 1: Get Parts

  • Arduino Uno/Genuino
  • Breadboard
  • Jumper wires (generic)
  • 3 220Ω resistors
  • 3 LEDs (any color)
  • A temperature sensor (mine is an LM35, but most should work)

Step 2: Put Parts in Place

Step 3: Wire It Up

Wire it up:

>Red LED goes to digital pin 4 through one of the resistors, and ground

>Green LED goes to digital pin 3 though a resistor, and ground

>Blue LED goes to digital pin 2 through a resistor, and ground

>Pin one (the pin on the left) of the temperature sensor goes to 5v

>Pin two (the pin in the middle) of the temperature sensor goes to analog pin A2

>pin three (the pin on the right) of the temperature sensor goes to ground

Step 4 : Put Code

Code

CodeArduino
Upload code into Arduino
const int hot = 87; //set hot parameter
const int cold = 75; //set cold parameter
void setup() {
pinMode(A2, INPUT); //sensor
pinMode(2, OUTPUT); //blue
pinMode(3, OUTPUT); //green
pinMode(4, OUTPUT); //red
Serial.begin(9600);
}
void loop() {
int sensor = analogRead(A2);
float voltage = (sensor / 1024.0) * 5.0;
float tempC = (voltage - .5) * 100;
float tempF = (tempC * 1.8) + 32;
Serial.print("temp: ");
Serial.print(tempF);
if (tempF < cold) { //cold
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
Serial.println(" It's Cold.");
}
else if (tempF >= hot) { //hot
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
Serial.println(" It's Hot.");
}
else { //fine
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
Serial.println(" It's Fine.");
}
delay(10);
}

Schematics

Wire Drawing
Flbi575in35nss9 fjl98ii0ns

Comments

Similar projects you might like

Flashing LED Light and Temperature Data Logger

Project tutorial by pipparichter

  • 6,031 views
  • 2 comments
  • 9 respects

Temperature Indicator with Arduino

Project tutorial by PCBWay and Silícios Lab

  • 5,254 views
  • 1 comment
  • 20 respects

Bluetooth control led with lcd led status display real time.

Project tutorial by Youssef Sabaa

  • 28,511 views
  • 6 comments
  • 54 respects

Color-changing Lamp Via Temperature Input

by mattcurrentjr

  • 3,401 views
  • 2 comments
  • 15 respects

LED Emergency Lights using WS2812 RGB LED Module

Project tutorial by bigboystoys13

  • 15,538 views
  • 7 comments
  • 34 respects

LED Cube

Project tutorial by Praditha Alwis

  • 11,415 views
  • 0 comments
  • 18 respects
Add projectSign up / Login