Cloth Clock

Made by Xiaolin Yang

Found in DIoT 2018 1- Home Hack

Create a connected system that could collect real-time climate data and offer customized advice on the comfortable clothes to wear for users.

0


0

Proposal

The initial intention of this project is to design for my parents, especially my father who enjoys outdoor cycling a lot. They always want to know the suitable clothes to wear before they headed out of the home. Currently, they need to check the weather on their phone or the TV, and maybe look out of the window to check with pedestrians outside. With this, check this can be as simple as checking the clock. The threshold can be customized so they can get the most suitable suggestion in an efficient and accurate way, and feel comfortable every day.


Components

  1. Particle Photon
  2. Breadboard (generic)
  3. Arduino Servo Motor
  4. Temperature & Humidity Sensor
  5. Battery pack or USB Micro B Cable
  6. Resistors
  7. Jumper wires
  8. Shadow box frame


Context

How do people decide what to wear every day to keep them comfortable with the weather? Check weather forecasts? It may not be that accurate. Go outside to feel it and decide? This is too burdened. What if we could have a clock to tell us what to wear based on the current weather.


The idea can be really simple. Use a servo to move the pointer with data feeding to the system and commands given based on that. To achieve this, the module needs to be able to use wifi to communicate, and powered by batteries and be efficient in using energy.


Process

Outline your approach to the project? What ideas did you generate and how did you refine or reject them? What did you research and explore? what were the design choices? What challenges were encountered and how did you resolve them?


Step 1.  Set up the sensor

Used: 
  • Temperature & Humidity Sensor
  • 1k Resistors
  • Photon
  • Breadboard
  • Jumper wires


The initial concept was to use data from forecast.io for weather information. However, this may have some little error considering different locations.  A sensor in the living area would be helpful to correct this error. 


Step 2: Set up servo and connect it to photon



Step 3: Wire all the parts together





Fritzing Final Circuit Diagram:




Code:


0
function forecastUrl(apiKey, location) {
  var apiUrl = "https://api.forecast.io/forecast";
  var excludeFields = "exclude=minutely,hourly";
  return apiUrl + "/" + apiKey + "/" + location + "?" + excludeFields;
}

function getForecast(url) {
  var got = require("got");
  return got(url)
  .then(function (response) {
    return JSON.parse(response.body);
  });
}

function forecastMapper(weather) {
  return {
    // Word weather summary for next 24 hours
    summary: weather.daily.data[0].summary,
    // Snow or rain?
    precipitation: weather.daily.data[0].precipType || "none",
    precipProbability: weather.daily.data[0].precipProbability || 0,
    // Current temperature
    temperature: weather.currently.apparentTemperature
  };
}

function clothesForWeather(weather) {
  if (weather.precipProbability > 0.4) {
  var precip = weather.precipitation;
    if(precip.match(/rain/i)) {
      return "umbrella";
    } else if(precip.match(/snow/i)) {
      return "shovel";
    }
  }
  
  var t = weather.temperature;
  if(t < 33) {
    return "hat";
  } else if(t < 55) {
    return "jacket";
  } else if(t < 70) {
    return "sweater";
  } else {
    return "tshirt";
  }
}

function outputMessage(hook, clothes, message) {
  if(hook.params.coreid) {
    console.log(message);
    hook.res.end(clothes);
  } else {
    hook.res.end(message + "\n");
  }
}

module['exports'] = function whatToWear (hook) {
  var location = hook.params.location || hook.env.DEFAULT_LOCATION;
  var url = forecastUrl(hook.env.FORECAST_IO_API_KEY, location);
  
  getForecast(url)
  .then(function (weather) {
    var simpleWeather = forecastMapper(weather);
    var clothes = clothesForWeather(simpleWeather);
    var message = "Wear " + clothes + " for forecast " + JSON.stringify(simpleWeather);
    outputMessage(hook, clothes, message);
  })
  .catch(function (error) {
    console.error("Error getting forecast: " + error);
    hook.res.end("error");
  });
};
Click to Expand
0


Reflection

I didn't realize the difficulty before I really start doing the project. When I first got this idea, I just thought about how to communicate data between different parts. However, when the project really starts, there are so many unexpected things that need to be stressed came out. And I don't have the experience to come up with a good solution immediately. I really hope I could have more time to work on this project. In that case, I would try to achieve the function to combine both the online local data and the nearby environment data. I would also build the box and the actual pointer, as well as try to customize the cloth option to make it specially designed that can suit the user's living environment as well as cloth style. However, this also made me wonder how customization should be achieved in real life setting with IoT techniques. Also, I hope I could get the chance to learn more about the use case of different electrical components to better understand how to utilize them in creating a smarter world.




References

https://particle.hackster.io/monkbroc/what-should-i-wear-outside-81b6e4?ref=channel&ref_id=286_trending___&offset=63

https://particle.hackster.io/shaiss/temperature-humidity-monitor-with-dweet-freeboard-3f6fba?ref=channel&ref_id=286_trending___&offset=87

0
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

Create a connected system that could collect real-time climate data and offer customized advice on the comfortable clothes to wear for users.

Created

January 24th, 2018