Air Quality Headphones Update

Our team met this week to prototype the air-sensor to audio interaction. In this example we are using an optical dust sensor to sense the amount of particulate matter in the air. We are mapping these values to an audio output.

Due to complications with GPS and data logging we have decided to limit the scope of our initial prototype to the interaction between dust, sound, and the wearer of the headphones. For our next steps we plan to miniaturize the prototype, and work on the manipulation of the sound. We will also begin designing the headphones themselves.

Demo

Code

//Dust Sensor

int dustPin=0;

int dustVal=0;

int ledPower=2;

int delayTime=280;

int delayTime2=40;

float offTime=9680;

//Piezo

const int buzzerPin = 8;

//Setup

void setup(){

Serial.begin(9600);

pinMode(ledPower,OUTPUT);

pinMode(4, OUTPUT);

pinMode(buzzerPin, OUTPUT);

}

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

delayMicroseconds(delayTime2);

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

delayMicroseconds(offTime);

Serial.println(dustVal);

dustVal = map(dustVal, 100, 1000, 31, 3000);

tone(buzzerPin, dustVal);

Serial.println(dustVal);

delay(1000/16);

noTone(buzzerPin);

}

72 thoughts on “Air Quality Headphones Update”

  1. Hi! I’m at work surfing around your blog from my new iphone 3gs! Just wanted to say I love reading your blog and look forward to all your posts! Carry on the outstanding work!|

  2. What’s up i am kavin, its my first occasion to commenting anywhere, when i read this piece of writing i thought i could also make comment due to this sensible piece of writing.|

  3. I do not know if it’s just me or if perhaps everybody else experiencing issues with your site. It appears like some of the written text on your content are running off the screen. Can somebody else please provide feedback and let me know if this is happening to them as well? This might be a issue with my browser because I’ve had this happen before. Many thanks|

  4. certainly like your web site however you need to check the spelling on several of your posts. A number of them are rife with spelling problems and I find it very bothersome to inform the reality then again I’ll certainly come again again.|

  5. Thanks for the good writeup. It actually was once a leisure account it. Glance advanced to far delivered agreeable from you! By the way, how could we keep up a correspondence?|

  6. I’m impressed, I must say. Seldom do I encounter a blog that’s both equally educative and engaging, and without a doubt, you’ve hit the nail on the head. The problem is something that too few folks are speaking intelligently about. Now i’m very happy I stumbled across this in my search for something concerning this.|

  7. I know this if off topic but I’m looking into starting my own weblog and was wondering what all is required to get set up? I’m assuming having a blog like yours would cost a pretty penny? I’m not very internet smart so I’m not 100 sure. Any tips or advice would be greatly appreciated. Kudos|

Leave a Reply

Your email address will not be published.