Runners or joggers are sensitive to temperature. If it is cold outside, there's higher chance we might get injured or catch a cold after running. So, how can we tell whether it is good day to run or not? This project provides answer to that question in an indirect, but in a clear way.

0

Intention

I love to run outside when the temperature and sunlight is just right. Every time I want to run outside, I am afraid of being frozen or, catching a cold. Without frequently checking the phone to check the temperature, we thought of a more ambient way to get the information. Without putting much effort into moving your arm, hands, and fingers, can there be a way to check the weather in a more convenient way?

0

Context

Traffic light inspired me. What device can tell us when to stop or go other than traffic light? I guess not many. I wanted to depict the idea that we encounter in our daily lives. Moreover, as a huge fan of sunny days, the bright, clear sky makes my heart beat faster and adrenaline rush, just like Pavlov's dog reaction. So I have thought of a domain where I can integrate two of these conditions into one. Lighting up just when it is right time to run outside.

0

Process

The considerations of the project included: 

  - The temperature sensing has to keep on monitoring  in order to have the information ready to the user whenever desired 

  - The user had to be notified in an ambient (non-intrusive) way 

Our research included: 

  - a comprehensive survey and understanding of the different temperature sensors and the corresponding resistors that need to be used with it. 

 The code and circuit diagram for this project are sourced from this place: https://www.hackster.io/maxeust/temperature-sensitive-led-2f1635 


0

Materials List:

1x Breadboard

1x Particle Photon

1x RGB LED

1x TMP 36 Temperature Sensor

1x 0.01 uF Capacitor

1x Push-button

1x 10k Ohm Resistor

3x 330 Ohm Resistor
13x Wire

0
0
/*



  templight.ino

  

  Adjusts the color of an RGB LED to changes in temperature with tempHigh (Celcius) being full red and tempLow (Celcius) being full blue.

  Also uses a push-button for on/off functionality.



  Written for the Spark Core



*/



// LED leads connected to PWM pins

const int RED_LED_PIN = A4;

const int GREEN_LED_PIN = A1;

const int BLUE_LED_PIN = A0;

int temperaturePin = A7; //temperature sensor pin

int inputPin = D1; //push-button pin

int val = 0; //variable for push-button status

int state = 1; //variable for on/off state of the LED

int tempHigh = 28; //top value in range of temperature values (mess with me!)

int tempLow = 24; //bottom value in range of temperature values (mess with me!) --make sure tempHigh stays above tempLow

// and the current temperature is within the range for optimum performance.









// Used to store the intensity level of the individual LEDs, intitialized to full brightness (0)

int redIntensity = 0;

int greenIntensity = 0;

int blueIntensity = 0;





void setup() {

    //set LED pins to outputs



    pinMode(RED_LED_PIN, OUTPUT);

    pinMode(GREEN_LED_PIN, OUTPUT);

    pinMode(BLUE_LED_PIN, OUTPUT);

    

    //set temperature and push-button pins as inputs

    pinMode(temperaturePin, INPUT);

    pinMode(inputPin, INPUT);

    

    //open serial connection for debugging

    Serial.begin(9600);

}



void loop() {

    val = digitalRead(inputPin); //read the state of the push-button

    double temperature = (analogRead(temperaturePin) * 3.3) / 4095;  //getting the voltage reading from the temperature sensor

    temperature = (temperature - 0.5) * 100; //turn the voltage into a Celcius reading

    Serial.println(temperature); //print temperature to serial for debugging

    int adjRed = (int) (255 - redVal(temperature)); // turn temperature into integer adjusted red value (0 is full red, 255 is min)

    int adjBlue = (int) (255 - blueVal(temperature)); // turn temperature into integer adjusted blue value (0 is full blue, 255 is min)

    

    if (val == LOW) { //if push-button pressed

        state = !state; //reverse on/off state

        delay(250); //primitive button debounce

        

    }

    

    if (!state) { //if light-state off, set Red and Blue vals to minimum (255)

        adjRed = 255;

        adjBlue = 255;

    }

    

    

    analogWrite(GREEN_LED_PIN, 255);  //set GREEN LED value to minimum

    

    //write red and blue values to respective pins

    analogWrite(BLUE_LED_PIN, adjBlue);

    analogWrite(RED_LED_PIN, adjRed);

    

    //print red and blue adjusted values alongside light state (on/off as 1/0)

    Serial.println("red: " + String(adjRed));

    Serial.println("blue: " + String(adjBlue));

    Serial.println(state);

    

}



 /*

 redVal is a function that adjusts a celcius reading into a red value from 0 to 255. 38 corresponds to 255 while -26 corresponds to 0.

 */

 

double redVal(double temp){

    if (temp >= tempHigh){ //return red as max as temp at 38 or higher

        return 255;

    } else if (temp  0){ //adjust as 255 max-val, not 256

        retVal = retVal - 1;

    }

    

    return retVal;

}



/*

 blueVal is a function that adjusts a celcius reading into a blue value from 0 to 255. 38 corresponds to 255 while -26 corresponds to 0.

 */

double blueVal(double temp){

    

    double retVal = redVal(temp); //find temperature adjusted red value

    retVal = 255 - retVal; //invert the red value to find the blue value

    return retVal;

}
Click to Expand
0

Reflection

The biggest gains out of the project were to find a way to get the information to the user in an ambient way and learning about the temperature sensors. Working with cross-functional team resulted in a varied kind of ideas to particular problems encountered while doing the project. Finally, we think the temperature sensor could be replaced by extracting data from online resources which could simplify the product. Also, our idea for the output was to integrate it with say a table lamp or any other light source that is already available in the user's setting and developing it as a product aimed at end-customers could be next steps. 

x
Share this Project

Courses

49713 Designing for the Internet of Things

· 25 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


Focused on
About

Runners or joggers are sensitive to temperature. If it is cold outside, there's higher chance we might get injured or catch a cold after running. So, how can we tell whether it is good day to run or not? This project provides answer to that question in an indirect, but in a clear way.

Created

February 6th, 2018