# Thermostat Lamp

3,244

77

1

Thermostat lamp is a wall lamp designed for outdoor use. This one is able to change color according to the temperature.

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: Assemble Materials

Material required are:

(x1) arduino uno

(x1) Temperature sensor

(x12) Jumper wires

(x1) LED strip RGB

(x1) Current transformer

(x1) LED’s connector with arduino (cable)

## Step 2: Program

The program will measure the temperature and if the temperature is less or equal than the Minimum Temperature, the LED will turn blue, if the temperature is higher than the Temperature_Minimum value but lower than the Maximum_ Temperature value, the LED will turn green last if the temperature is greater than the Maximum_ Temperature value, the LED will turn red. The temperature value will be displayed on the Serial monitor.

Now is time to code the arduino. For this project this code has been used.

const int LM35 = A0;
const int R=4;

const int G=3;

const int B=2;

const int Temperatura_Minima=65;

const int Temperatura_Maxima=75;

float Temperatura;

void setup () { Serial.begin(9600); //Inicializar puerto serial

pinMode(R,OUTPUT);//Inicializar el pin 4 como salida

pinMode(G,OUTPUT);//Inicializar el pin 3 como salida

pinMode(B,OUTPUT);//Inicializar el pin 2 como salida

digitalWrite(R,LOW);

digitalWrite(G,LOW);

digitalWrite(B,LOW);

}

//Calcular la temperatura

Temperatura = 5.0*Temperatura*100.0/1024.0;

//Mostrar la temperatura en el monitor Serial

Serial.print(Temperatura);

Serial.println(" ºF");

//Codicion para que encienda el led de color Verde

if(Temperatura>Temperatura_Minima&&Temperatura<Temperatura_Maxima) {

Serial.println("Deberia encender verde");

digitalWrite(R,HIGH);

digitalWrite(G,LOW);

digitalWrite(B,HIGH); }

//Condicion para que encienda el led de color Azul

if(Temperatura<=Temperatura_Minima) {

Serial.println("Deberia encender azul");

digitalWrite(R,HIGH);

digitalWrite(G,HIGH);

digitalWrite(B,LOW); }

//Condicion para que encienda el led de color Rojo

if(Temperatura>=Temperatura_Maxima) {

Serial.println("RED");

digitalWrite(R,LOW);

digitalWrite(G,HIGH);

digitalWrite(B,HIGH);

}

delay(500);

## Step 3: Final Product

Participated in the
Arduino Contest 2017

Participated in the
LED Contest 2017

158 7.7K
1 355 32K
15 1.1K

## Discussions

That's a fun unique way to display the temperature :) I like the sleek simple design!