49713 Designing for the Internet of Things
· 18 members
A hands-on introductory course exploring the Internet of Things and connected product experiences.
Hmm, that smell of cookies coming out of the oven, fresh cut grass, or flowers in the garden. These are the smells that remind you vividly of specific memories relating to people you love.
Our creative project is one for family members to establish connection times between each other as well as create an olfactory signal. This device uses a scent to signal that the person on the other end is missing you, reminding you that you should probably call your mom and tell her you love her. It also has LEDs on the device to signal if the person is available or busy. A big problem from international families is that the time zones are so spread out, there is a small gap to connect with your loved ones without knowing exactly when they are available. Having these interactions be olfactory and at a glance gives you a sense of closeness to the other person and lets you know that they are thinking about you.
We would like to use lights to show family members' status. If they are free to answer a phone call, the light will turn green; if they are busy, the light will show red. Also, we would like to use smells to represent the feeling of missing. As well as you smell the scent, you know it's time to make a phone call and have a long chat with your beloved ones.
We would like to use the most simple and direct operation: pressing buttons as our input methods. We set three buttons, two for lights and one for smell.
Ideation
Considering most families members now live separately, it's hard for them to learn about what's the most optimal time to make a phone call to have a chat. Sometimes they missed the chances for having no idea of each others' status. We just too tired and forget to inform them. A devices with simple and intuitive interaction may help a family realize more effective communication.
Sketches & Prototype
In next phase, we drew some sketches to design the device. We would like to use peltier to heat the oil and use a fan to spread the scent out. So we chose to put the breadboard at the bottom of the device, the nexpixel part in the middle and the smell part on the top with some holes to let the scent come through.
// This #include statement was automatically added by the Particle IDE.
#include <neopixel.h>
#define PIXEL_PIN D2
#define PIXEL_COUNT 8
#define PIXEL_TYPE WS2812
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
uint32_t n = strip.Color(0, 0, 0);
uint32_t R = strip.Color(200, 0, 0);
uint32_t G = strip.Color(0, 200, 0);
//Set up pins for the items used
int x = 0;
int redPin = D3;
int greenPin = D4;
int fanPin = D7;
int heaterPin = D6;
int scentPin = D5;
//button state at begining is false
int pressed = 0;
//============publish
long lastPublishedAt = 0;
int publishAfter = 1000;
// was the scent button pressed
bool scentPressedDisplay = false;
// the time at which the button was pressed
long scentPressedAt = 0;
// how long it should be in the mode for
int scentPressedTimeout = 10 * 1000;
bool redlevel = false;
void setup()
{
strip.begin();
for( int i = 0; i < strip.numPixels(); i++ )
{
strip.setPixelColor(i, n);
}
strip.show();
pinMode(redPin, INPUT_PULLUP);
pinMode(greenPin, INPUT_PULLUP);
pinMode(fanPin, OUTPUT);
pinMode(heaterPin, OUTPUT);
pinMode(scentPin, INPUT_PULLUP);
Particle.subscribe( "diot2019/team9/redled/" , handleSharedEventRed );
Particle.subscribe( "diot2019/team9/greenled/" , handleSharedEventGreen );
Particle.subscribe( "diot2019/team9/scent/" , handleSharedEventBlink );
}
void loop()
{
if( scentPressedDisplay )
{
Blink();
unsigned long now = millis();
if( scentPressedAt + scentPressedTimeout < now ){
scentPressedDisplay = false;
if(redlevel == false)
{
for( int i = 0; i < strip.numPixels(); i++ )
{
strip.setPixelColor( i, G);
delay(50);
}
strip.show();
}
if(redlevel == true)
{
for( int i = 0; i < strip.numPixels(); i++ )
{
strip.setPixelColor( i, R);
delay(50);
}
strip.show();
}
}
}else{
int redState = digitalRead( redPin );
int greenState = digitalRead ( greenPin );
int scentState = digitalRead ( scentPin);
if(redState == LOW)
{
publishMyEventRed();
delay(100);
}
if(greenState == LOW)
{
publishMyEventGreen();
delay(100);
}
if(scentState == LOW)
{
publishMyEventScent();
delay(100);
}
}
delay(100);
if(pressed == 1){
digitalWrite(heaterPin, HIGH);
delay(40000);
digitalWrite(heaterPin, LOW);
}
if ((pressed == 1) && (scentPressedAt + 30000 < millis())){
digitalWrite(fanPin, HIGH);
delay(10000);
digitalWrite(fanPin, LOW);
pressed = 0;
}
else{
}
}
//=============myevent
void publishMyEventRed()
{
if( lastPublishedAt + publishAfter < millis() )
{
String eventName = "diot2019/team9/redled/" + System.deviceID();
Particle.publish( eventName, "data goes here" );
lastPublishedAt = millis();
}
}
void publishMyEventGreen()
{
if( lastPublishedAt + publishAfter < millis() )
{
String eventName = "diot2019/team9/greenled/" + System.deviceID();
Particle.publish( eventName, "data goes here" );
lastPublishedAt = millis();
}
}
void publishMyEventScent()
{
if( lastPublishedAt + publishAfter < millis() )
{
String eventName = "diot2019/team9/scent/" + System.deviceID();
Particle.publish( eventName, "data goes here" );
lastPublishedAt = millis();
}
}
void handleSharedEventRed(const char *event, const char *data)
{
String eventName = String( event ); // convert to a string object
String deviceID = System.deviceID();
if( eventName.indexOf( deviceID ) != -1 )
{
return;
}
for( int i = 0; i < strip.numPixels(); i++ )
{
strip.setPixelColor( i, R);
delay(100);
}
strip.show();
redlevel = true;
}
void handleSharedEventGreen(const char *event, const char *data)
{
String eventName = String( event ); // convert to a string object
String deviceID = System.deviceID();
if( eventName.indexOf( deviceID ) != -1 )
{
return;
}
for( int i = 0; i < strip.numPixels(); i++ )
{
strip.setPixelColor( i, G);
delay(100);
}
strip.show();
redlevel = false;
}
void handleSharedEventBlink(const char *event, const char *data)
{
String eventName = String( event ); // convert to a string object
String deviceID = System.deviceID();
if( eventName.indexOf( deviceID ) != -1 )
{
return;
}
scentPressedDisplay = true;
scentPressedAt = millis();
pressed = 1;
}
void Blink( )
{
x = n;
for( int i = 0; i <1000; i++ )
{
x = x + 500;
strip.setPixelColor( i % 8, x);
strip.show();
delay(40);
}
}
Click to Expand
A hands-on introductory course exploring the Internet of Things and connected product experiences.
~
February 17th, 2019