Wearable Air Pollution Sensor by Amy Wu and Nga Nguyen

Wearable Air Pollution Sensor
Physical Computing Midterm Project
SVA Interaction Design MFA

Amy Wu and Nga Nguyen
Link to blog: http://bit.ly/19lalaQ

Babies and young children are more susceptible to the exposure of air pollution and UV rays. Due to their growing bodies, “children breathe a proportionately greater volume of air than adults. As a result, children inhale more pollutants per pound of body weight”. Since they are too young to know the dangers and effects of their environment, our device will help parents become more aware of their child’s surroundings.

The device will detect how much UV is emitted that day in the park, as well as dust and smoke particles in the air. This device will pulsate in a red color to alert the parent of the pollution in the air around their baby, as well as display the level of UV rays.

The device would be best suited to be worn by the baby, but also can be attached within the vicinity of the child, such as on the crib, baby car seat, or carriage. The device will be light-weight, pliable, and the size of the FLORA, led/glass, and the two sensors (dust particle sensor and the UV sensor). This device would also be useful for soon to be moms who would like to be made aware of their intake for two of air pollution. As well as for babysitters and grandparents.

Input: Dust particle sensor
Output: Buzzer and RGB LED lights

We followed this tutorial for our sensor reading: http://sensorapp.net/?p=479

We used the TONE tutorial from the arduino site: http://arduino.cc/en/Reference/Tone

And then we used Blink without delay in our working prototype (video to come): http://arduino.cc/en/Tutorial/BlinkWithoutDelay

Switched to the FLORA rgb led lights and used the code on adafruit by downloading the neopixel library: http://learn.adafruit.com/flora-rgb-smart-pixels?view=all

int dustPin=0;
int dustVal=0;

int ledPower=2;
int delayTime=280;
int delayTime2=40;
float offTime=9680;

#include "pitches.h"

//int melody[] = {
//  NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4};

// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
  4, 8, 8, 4,4,4,4,4 };

void setup() {
  Serial.begin(9600);
  pinMode(ledPower,OUTPUT);
  pinMode(4, OUTPUT);
  /*
 // iterate over the notes of the melody:
   for (int dustVal = 0; dustVal < 300; dustVal++) {

   // to calculate the note duration, take one second
   // divided by the note type.
   //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
   int noteDuration = 1000/noteDurations[dustVal];
   tone(8, melody[dustVal],noteDuration);

   // to distinguish the notes, set a minimum time between them.
   // the note's duration + 30% seems to work well:
   int pauseBetweenNotes = noteDuration * 1.30;
   delay(pauseBetweenNotes);
   // stop the tone playing:
   noTone(8);
   }
   */

}

void loop(){
  // ledPower is any digital pin on the arduino connected to Pin 3 on the sensor
  digitalWrite(ledPower,LOW); // power on the LED
  delayMicroseconds(delayTime);

  dustVal=analogRead(dustPin); // read the dust value via pin 5 on the sensor
  if(dustVal >=0 && dustVal<=200){
    tone(8, dustVal,100);
  }
  else if(dustVal >=201 && dustVal<=900){
    tone(8, dustVal*2,500);
  }
  //int noteDuration = 1000/noteDurations[dustVal];
  //tone(8, melody[dustVal],noteDuration);

  delayMicroseconds(delayTime2);
  digitalWrite(ledPower,HIGH); // turn the LED off
  delayMicroseconds(offTime);

  Serial.println(dustVal);
  delay(500);

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: