[Project 8] – Temperature Control With NTC Using 5 LED

You are here:
Estimated reading time: 1 min

In this project we will make [Project 8] – Temperature Control With NTC Using 5 LED. ( NTC : Negative Temperature Coefficient ) I will use arduino uno in the circuit design program. I use usually arduino mega 2560.  You can use the other arduino cards.

Schema:

 

Materials:

  • Arduino UNO / Other Arduino Cards    x 1
  • Breadboard     x 1
  • 470 ohm resistor    x 5
  • 1 kohm resistor     x 1
  • NTC (1K)    x 1
  • LED    x 5
  • Jumper Cable

Program:

// [Project 8] - Temperature Control With NTC Using 5 LED
int sensorTemp=0;
int firstLed=12;
int secondLed=11;
int thirdLed=10;
int forthLed=9;
int fifthLed=8;

void setup()
{
 Serial.begin(9600);
 
 pinMode(firstLed,OUTPUT);
 pinMode(secondLed,OUTPUT);
 pinMode(thirdLed,OUTPUT);
 pinMode(forthLed,OUTPUT);
 pinMode(fifthLed,OUTPUT);

}
void loop()
{
 sensorTemp=analogRead(0);
 if(sensorTemp<=440 )
 {
 digitalWrite(firstLed,LOW);
 digitalWrite(secondLed,LOW);
 digitalWrite(thirdLed,LOW);
 digitalWrite(forthLed,LOW);
 digitalWrite(fifthLed,LOW);
 Serial.println("5 LED ON");
 }
 else if(sensorTemp>=440 && sensorTemp<450)
 {
 digitalWrite(firstLed,HIGH);
 digitalWrite(secondLed,LOW);
 digitalWrite(thirdLed,LOW);
 digitalWrite(forthLed,LOW);
 digitalWrite(fifthLed,LOW);
 Serial.println("4 LED ON");
 }
 else if(sensorTemp>=450 && sensorTemp<460)
 {
 digitalWrite(firstLed,HIGH);
 digitalWrite(secondLed,HIGH);
 digitalWrite(thirdLed,LOW);
 digitalWrite(forthLed,LOW);
 digitalWrite(fifthLed,LOW);
 Serial.println("3 LED ON");
 }
 else if(sensorTemp>=460 && sensorTemp<470 )
 {
 digitalWrite(firstLed,HIGH);
 digitalWrite(secondLed,HIGH);
 digitalWrite(thirdLed,HIGH);
 digitalWrite(forthLed,LOW);
 digitalWrite(fifthLed,LOW);
 Serial.println("2 LED ON");
 }
 else if(sensorTemp>=470 && sensorTemp<480)
 {
 digitalWrite(firstLed,HIGH);
 digitalWrite(secondLed,HIGH);
 digitalWrite(thirdLed,HIGH);
 digitalWrite(forthLed,HIGH);
 digitalWrite(fifthLed,LOW);
 Serial.println("1 LED ON");
 }
 else if(sensorTemp>=480 )
 {
 digitalWrite(firstLed,HIGH);
 digitalWrite(secondLed,HIGH);
 digitalWrite(thirdLed,HIGH);
 digitalWrite(forthLed,HIGH);
 digitalWrite(fifthLed,HIGH);
 Serial.println("ALL LED OFF");
 }
 delay(100);
}

Serial Monitor Image

Serial Monitor: Ctrl+Shift+M

Project Related Images:

 

Tags:
Was this article helpful?
Dislike 0
Views: 193

Leave a Reply

Your email address will not be published. Required fields are marked *