Categories
TUTORIALS

How to change RGB color as temperature change

Introduction 

Our project is about helping and locating homeless people under extreme cold weather condition.  This tutorial aims to make the RGB light changes its color when the temperature changes. The RGB light is a warning signal for homeless people who sleep on the street. Blue indicates the weather is very cold and may threaten their health. and the purple means the weather is extremely cold, and to an extent that is emergent for them to find a shelter or a warm place.

Parts List

  1. Arduino Uno Board
  2. Temperature Sensor TMP 36 GZ
  3. RGB light
  4. 3 330 ohm resistors
  5. wires

The circuit

The circuit is pretty straightforward. The 5v pin is supplying power to the temperature sensor. For the temperature sensor, the pin on row 7 is the input of the power, and the pin on row 5 is the output of the power. A0 is the analog read pin to read the temperature detected by the temperature sensor. As for the RGB, the digital pin is responsible for controlling it. The pin 9, 10, and 11 is responsible for the input of blue, green and red pin. The pin on row 16 is the common pin for the output of the electricity that is connected to the ground.

When the temperate is above 40 degrees, the digital pins will send signals to turn off the RGB. When the temperature is between 20 and 40 degrees, the digital pins 9 will send the “high” signal to the blue pin, so that the RGB will show a blue color.  When the temperature dropped below 20 degrees, the digital pin 9 and 11 is “high”, and the RGB will show a purple color.

Video

For the sake of the video, I set the threshold of the temperatures for changing the light at 75, 70 and 68 degrees. Because it is very hard to have a temperature below 40 degrees indoor.

The code

 

Leave a Reply

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