49713 Designing for the Internet of Things
· 25 members
A hands-on introductory course exploring the Internet of Things and connected product experiences.
A plant that brings back users to their home country through scent
Problem Statement:
Students living abroad for the first time are often faced with many stresses as they try to learn a new culture and language as well as adapt to life without the comforts of their home and family. This can be a very isolating and sometimes lonely experience. This product is designed for students living abroad in an unfamiliar city who often feel homesick and long to experience the comforts of being home. This IoT appliance is designed to bring people closer to their home by activating their senses in a way that reminds them of their country, their home, and their family. This will benefit students by allowing them to feel connected to their life at home in an often stressful period of transition.
Goal:
Our solution will make the unfamiliar, familiar, by using the sense of smell to create a sensorial experience that reminds students living in a new space of their home. Many individuals associate a specific fragrance with a certain location. Our goal is to leverage the associations individuals make with certain smells to comfort them and remind them of their home.
Prototype 1
The initial prototype was assembled using two motors in the place of the USB humidifiers for proof of concept. The goal was to use a webhook to identify the weather based on the latitude and longitude of Chhatrapati Shivaji International Airport (India), the location closest to our subject's home. The information provided by the webhook came in four forms: a label of the current weather in the given location, the temperature, the probability of rain, and the intensity of rain. Challenges the team encountered when creating the web hook was determining which piece of information from the web hook to incorporate. The team decided to use the label of the current weather in the given location because we were most interested in knowing if it was 'raining' or 'not raining.' We determined that 'raining' would correspond to the release of scent 1 and 'not raining' would be the release of scent 2. In India, rain has a very specific smell, so we determined that it was most impactful to incorporate the sensory change from 'raining' to 'not raining' into our prototype.
// Demo to control motor using transistor
int motorPin1 = D1;
int motorPin2 = D2;
unsigned long timePassed;
unsigned long getTime;
unsigned int sample = 3000; //time in ms for desired duration
String weatherIcon = "";
double temperature = 0;
double precipProbability = 0;
double precipIntensity = 0;
void setup(){
Particle.subscribe("hook-response/forecast", handleForecastReceived, MY_DEVICES);
getData();
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
// test motors to make sure that they are working
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
delay(2000);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
delay(2000);
digitalWrite(motorPin2, LOW);
}
void loop(){
//getTime = millis();
//if (getTime - millis() == sample){
getData();
delay(5000);
if (weatherIcon == "rain"){
digitalWrite(motorPin1, HIGH);
delay(2000);
digitalWrite(motorPin1, LOW);
}else if(weatherIcon != "rain"){
digitalWrite(motorPin2, HIGH);
delay(2000);
digitalWrite(motorPin2, LOW);
}
//}
}
void getData()
{
// Publish an event to trigger the webhook
Particle.publish("forecast", "19.0896,72.8656", PRIVATE);
}
void handleForecastReceived(const char *event, const char *data) {
// Handle the integration response
String receivedStr = String( data );
int loc1 = 0;
int loc2 = 0;
int loc3 = 0;
int loc4 = 0;
loc1 = receivedStr.indexOf("~");
weatherIcon = receivedStr.substring(0,loc1);
loc2 = receivedStr.indexOf("~",loc1+1);
temperature = (double) String(receivedStr.substring(loc1+1,loc2)).toFloat();
loc3 = receivedStr.indexOf("~",loc2+1);
precipProbability = (double) String(receivedStr.substring(loc2+1,loc3)).toFloat();
loc4 = receivedStr.indexOf("~",loc3+1);
precipIntensity = (double) String(receivedStr.indexOf(loc3+1)).toFloat();
}
Click to Expand
The final outcome of this prototype employs two modified humidifiers situated beneath a circular foam cutout housed in a ceramic flowerpot . The stem of the humidifier was shortened in order for it to fit in the flowerpot. Aluminum cans were modified to function as the vessel for the humidifiers. Each humidifier was placed beneath the foam cutout with the humidifier fastened to the cans. Circular holes were punctured into the foam to allow for the humidifier to diffuse. Two scents were selected based on the two weather conditions the team wanted to portray, 'rain' and 'not rain.' The team selected a 'fresh cut grass' scent to represent rain and a 'citrus' scent to indicate 'not rain.' It was important to select scents with ample variation, so that the user could differentiate the two scents. The scents were selected based on the scents that remind our subject most of home.
The final outcome of our device was connected with the Sound Team's device to utilize the motion detector of their device to activate the release of the scent. This was a design choice because the team wanted to avoid the scent being diffused when the user was not present in the room. To finish the form of the device, The team also constructed a wood base to house the breadboard and the particle device, feeding the cords through the top of the wood base. A decorative plant was used to bring nature into the living place.
Further iterations of our device would employ three to four scents that would be customized to seasonal and temperature inputs in addition to a label of the current weather. We would like to incorporate decorative native plants in our device, so that the plants and visual experience of the device could further promote the familiarity of home. Trigger the scent that you want as opposed to the weather. and trigger it on your own command.
const int buttonPin1 = D1;
const int buttonPin2 = D2;
String weatherIcon = "";
double temperature = 0;
double precipProbability = 0;
double precipIntensity = 0;
long lastPublishedAt = 0;
// from this device
int publishAfter = 10000;
void setup(){
pinMode(buttonPin1, OUTPUT);
pinMode(buttonPin2, OUTPUT);
//digitalWrite(buttonPin1, HIGH);
//digitalWrite(buttonPin2, HIGH);
pressButton1();
delay(1000);
pressButton1();
pressButton2();
delay(1000);
pressButton2();
Particle.subscribe("hook-response/forecast", handleForecastReceived, MY_DEVICES);
Particle.subscribe( "diot/2018/connected/atHome" , handleSharedEvent );
getData();
}
void loop(){
//pressButton1(); //turn humidifier on
// getData();
// delay(2000);
// if (weatherIcon == "rain"){
// pressButton1();
// delay(500);
// pressButton1();
// }else if(weatherIcon != "rain"){
// pressButton2();
// delay(5000);
// pressButton2();
// }
}
void pressButton1(){
digitalWrite(buttonPin1, LOW);
delay(250);
digitalWrite(buttonPin1, HIGH);
}
void pressButton2(){
digitalWrite(buttonPin2, LOW);
delay(250);
digitalWrite(buttonPin2, HIGH);
}
void getData()
{
// Publish an event to trigger the webhook
Particle.publish("forecast", "19.0896,72.8656", PRIVATE);
}
void publishMyEvent()
{
// check that it's been 10 secondds since our last publish
if( lastPublishedAt + publishAfter < millis() )
{
String eventName = "diot/2018/connected/atHome" + System.deviceID();
// then we share it out
Particle.publish( eventName, "scentActive" );
lastPublishedAt = millis();
}
}
void handleSharedEvent(const char *event, const char *data)
{
// Now we're getting ALL events published using "diot/2018/connected/atHome"
// This includes events from this device.
// So we need to ignore any events that we sent.
// Let's check the event name
String eventName = String( event ); // convert to a string object
// This gives us access to a bunch of built in methods
// Like indexOf()
// Locates a character or String within another String.
// By default, searches from the beginning of the String,
// but can also start from a given index,
// allowing for the locating of all instances of the character or String.
// It Returns: The index of val within the String, or -1 if not found.
// We can use this to check if our event name contains the
// id of this device
String deviceID = System.deviceID();
weatherIcon = String(data);
//Particle.publish("motion activated");
//Particle.publish(eventName , weatherIcon);
if( eventName.indexOf( deviceID ) != -1 )
{
// if we get anything other than -1
// the event came from this device.
// so stop doing stuff
return;
}
// otherwise do your stuff to respond to
// the paired device here
//getData();
delay(250);
if (weatherIcon == "rain"){
pressButton1();
delay(8000);
pressButton1();
}else if(weatherIcon != "rain"){
pressButton2();
delay(8000);
pressButton2();
}
}
void handleForecastReceived(const char *event, const char *data) {
// Handle the integration response
String receivedStr = String( data );
int loc1 = 0;
int loc2 = 0;
int loc3 = 0;
int loc4 = 0;
loc1 = receivedStr.indexOf("~");
weatherIcon = receivedStr.substring(0,loc1);
loc2 = receivedStr.indexOf("~",loc1+1);
temperature = (double) String(receivedStr.substring(loc1+1,loc2)).toFloat();
loc3 = receivedStr.indexOf("~",loc2+1);
precipProbability = (double) String(receivedStr.substring(loc2+1,loc3)).toFloat();
loc4 = receivedStr.indexOf("~",loc3+1);
precipIntensity = (double) String(receivedStr.indexOf(loc3+1)).toFloat();
}
Click to Expand
The team had a clear understanding of the goals and intent of using scent to promote familiarity in the living space. In order to achieve this goal, the team learned how to integrate an off the shelf portable humidifiers. The team experienced some difficulty at first hacking the humidifiers to bypass the on/ off switch and the USB power. However, this was a learning process that the team overcame using the voltmeter to measure the flow of the current and breaks along the circuit. The team also experienced a few setbacks integrating the humidifiers into the housing. Due to the size limitation of the housing. Despite the difficulties, the team succeeded in accomplishing the goal of this project as set out in the initial problem statement. In order to take it to the next level, the team will need to further streamline the form factors of the humidifiers and then vessels to allow more components to fit inside the plant pot. In addition, a better mechanism for refilling the water and scent needs to be iterated in future prototypes. This would take custom components and a custom housing .
References:
https://docs.google.com/document/d/1EMb3VykHmYmpvb8CGJo3tlrwLGivwX57fsUb9fWeflY/edit
Circuit tutorial for transistor:
A hands-on introductory course exploring the Internet of Things and connected product experiences.
A plant that brings back users to their home country through scent
February 24th, 2018