Smoke Sense

Made by Swarna Srimal

Found in Home Hack

Smoke Sense is a smart solution that helps individuals smoke while being sensitive to non-smokers who live with them.

0

Inspiration

My flatmate and I get along really well, except, he smokes quite a few cigarettes in a day and I am allergic to smoke.

0

Project Proposal

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.

0

Goal

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.

0

Product

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.

0

Here's how the notifications works:

If the levels are higher than the threshold sensed by the CO Sensor , it gives the following feedback:

  • The first time: gives audio tone and light indications as warning
  • 10 minutes after the first: if the levels are still high, it gives longer audio tone, a light indication and sends a friendly message asking the smoker to open windows.
  • 20 minutes after the first: if the levels are still high, it gives longer audio tone, a light indication and sends a message asking the smoker to open windows and spray room freshener.
  • 30 minutes after the first: if the levels are still high, it gives longer audio tone, a light indication and sends a message which warns the smoker to go outside the house and smoke.

Here's the schematic circuit board diagram and code:

0
//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
0

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?

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:

  1. Bluk DK IoT Smoke Detector
  2. DIY WiFi Gas Detector
  3. Sparkfun MQ-7 CO Sensor Guides

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.

0

Reflection

  • The most challenging part of this project was using the CO gas sensor and calibrating its readings in an ever changing environment.
  • Apart from that this project required connecting of resources such as IFTTT which were new and truly opened up a whole universe of possibilities that I hope to explore.
  • Looking at IoT devices as non-intrusive ambient devices that help build healthy habits  was interesting and helped build a friend-like personality for Smoke
  • An interesting addition to this project could be the added functionality of tracking google calendar to estimate when the non-smoker is going to reach home to better tailor smoke sensing notifications.

0

See it in action

Please switch to full screen mode before watching the video:

0
x
Share this Project

Found In
Courses

49-713 Designing for the Internet of Things

· 26 members

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


About

Smoke Sense is a smart solution that helps individuals smoke while being sensitive to non-smokers who live with them.

Created

January 25th, 2017