49-713 Designing for the Internet of Things
· 26 members
A hands-on introductory course exploring the Internet of Things and connected product experiences.
Smoke Sense is a smart solution that helps individuals smoke while being sensitive to non-smokers who live with them.
My flatmate and I get along really well, except, he smokes quite a few cigarettes in a day and I am allergic to smoke.
Smokers and non-smokers often share spaces they live in. In a home scenario, the lifestyle of one or more members in the house can quickly become a cause for discomfort for the non-smokers.
Smoke Sense is a smart device solution to help individual smoke while being sensitive to the non-smokers. Placed in a common living space inside a house, Smoke Sense can detect when the odor caused by smoke is beyond tolerable for the non-smokers and notifies the smoker(s) to open windows, use a room freshener or take other actions.
An advanced version of this could synchronize with schedules on google calendar to notify individuals if the air in the house is too smoke filled when smoke-averse flatmates are about to return home.
SmokeSense is a connected home device that monitors Cabon Monoxide levels inside a house. Smokers often do not realize that the room or house they are in is very smoky. Smoke Sense aims to notify the smoker in the house if there is too much smoke in their home and nudges them to take actions like open the window, spray a room freshener or go out and smoke. It does this through multiple channels like audio, light-based and SMS based notifications.
Smoke Sense uses a Carbon Monoxide Sensor , a LED, a peizo (for a buzzer), two resistors, a Particle Atom and some code for its functions. It also connects with ifttt.com to be able to send SMSes when a high smoke is detected.
Here's how the notifications works:
If the levels are higher than the threshold sensed by the CO Sensor , it gives the following feedback:
Here's the schematic circuit board diagram and code:
//sensor pin variables
int speakerPin = D0;
int coSensorPin = A0;
int ledPin = D1;
//time calculating variables
int warningnumber = 0;
long instancetime;
bool counterRunnning = false;
long delaybetweenwarnings = 30*1000;
//sensor readings and output variables
int coValue = 0;
int buzzertone[] = {2551,2273,2551,2273};
void setup()
{
Serial.begin( 9600 );
pinMode( coSensorPin, INPUT );
pinMode( speakerPin, OUTPUT );
pinMode( ledPin, OUTPUT );
Particle.variable("CO level", &coValue, INT );
Particle.variable("Warning number", &coValue, INT );
Particle.function("Reset Particle", resetParticle);
Particle.function("Stop Notifying", stopNotifying);
}
void loop()
{
readFromSensor();
if (coValue > 4 && warningnumber == 0)
{
startCounter();
activatewarning();
warningnumber = 1;
}
else if (coValue > 11 & warningnumber == 1)
{
if (counterRunnning == false)
{
startCounter();
activatewarning();
warningnumber = 2;
//Particle.publish("COdetected","second");
}
}
else if (coValue > 11 & warningnumber == 2 )
{
if (counterRunnning == false)
{
startCounter();
activatewarning();
activatewarning();
warningnumber++;
//Particle.publish("COdetected","third");
}
}
else if (coValue > 11 & warningnumber > 3)
{
if (counterRunnning == false)
{
startCounter();
activatewarning();
activatewarning();
warningnumber = 3;
//Particle.publish("COdetected","fourth");
}
}
if( checkIfCounterIsFinished() )
{
digitalWrite(ledPin, LOW);
counterRunnning = false;
}
//checking if warningnumber needs to be reset to 1
if( instancetime + 5*60*1000 < millis() )
{
warningnumber =1;
}
delay( 100 );
}
void readFromSensor()
{
coValue = analogRead(coSensorPin);
Serial.println( coValue );
}
void activatewarning()
{
digitalWrite(ledPin, HIGH);
for(int i=0; i<4; i++)
{
tone(speakerPin, buzzertone[i]);
delay(1000);
}
noTone(speakerPin);
}
void startCounter()
{
counterRunnning = true;
instancetime = millis() ;
}
bool checkIfCounterIsFinished()
{
if( counterRunnning == false )
{
return false;
}
if( instancetime + delaybetweenwarnings < millis() )
{
return true;
}
return false;
}
int resetParticle(String command)
{
if(command == "YES")
{
warningnumber = 1;
instancetime = 0;
counterRunnning = false;
coValue = 0;
for(int i=0; i<3;i++)
{
digitalWrite(ledPin, HIGH);
delay (500);
digitalWrite(ledPin, LOW);
delay (500);
}
return 1;
}
return 0;
}
int stopNotifying(String command)
{
if(command == "YES")
{
warningnumber = -1;
instancetime = 0;
counterRunnning = false;
coValue = 0;
for(int i=0; i<3;i++)
{
digitalWrite(ledPin, HIGH);
delay (500);
digitalWrite(ledPin, LOW);
delay (500);
}
tone(speakerPin, buzzertone[1],8);
return 1;
}
return 0;
}
Click to Expand
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?
For this project, I spoke to my flatmate to discuss features in the product and what would be helpful to maintain a smoke-free environment at home without being intrusive.
Apart from that, the following were used as resources for Smoke Sense:
The key design choices involved using a notification system that allowed the smoker to take action to reduce smoke in the house while being forgiving if he or she does not take action the very first time.
A hands-on introductory course exploring the Internet of Things and connected product experiences.
Smoke Sense is a smart solution that helps individuals smoke while being sensitive to non-smokers who live with them.
January 25th, 2017