Temperature Monitoring Light
The lamp can change color according to the temperature. If the weather is cold, blue light can be displayed, it is hot, and it is replaced with a red light. When the weather is nice, it's a green light.
Downloads
Supplies
6 foamcore Board(30x30cm)
1 RGB LED strip
Some dupont lines
1 cylinder (anyone)
1 Arduino Leonardo
1 Breadboard
1 motor adapter
Arduino Code
const int hot = 180; //set hot parameter
const int cold = 110;
; //set cold parameter
void setup() {
pinMode(13, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10,OUTPUT);
pinMode(9, OUTPUT);
Serial.begin(9600);
}
void loop() {
unsigned int sensor = analogRead(A2);
unsigned int tempC = (125 * sensor) >> 8;
Serial.print("temp: ");
Serial.print(tempC);
if (tempC < cold) { //cold
digitalWrite(13, HIGH) ;
digitalWrite(10, HIGH) ;
digitalWrite(9, LOW);
digitalWrite(11, HIGH);
Serial.println(" It's Cold.");
}
else if (tempC >= hot) { //hot
digitalWrite(13, HIGH) ;
digitalWrite(10, LOW) ;
digitalWrite(9, HIGH);
digitalWrite(11, HIGH);
Serial.println(" It's Hot.");
}
else { //fine
digitalWrite(13, HIGH) ;
digitalWrite(10, HIGH) ;
digitalWrite(9, HIGH);
digitalWrite(11, LOW);
Serial.println(" It's Fine.");
}
delay(100);
}