Wednesday, October 15, 2008

"I am a prototype, not a smiley face."

Here is  a prototype possibility for a barometer that is portable, novel and easy to decipher.  It would have a simple hook device at the back, with which it could be attached to a bicycle, bag, jacket etc. I used a glue on the "meter" (smiley-face) part to diffuse the light a little bit, but I think further diffusion is necessary to get a sort of continuity with the light, so i think i'll try cotton.  

Friday, September 26, 2008

A schematic...device pictures will follow

  








Here's a preliminary schematic...a better one may follow, when I figure out the "conventions"

Thursday, September 25, 2008

HOW IT WORKS



Six LEDs glow when the air pressure is high, depicting bright and sunny weather...




Four LEDs glow when the air pressure is comparatively lower, depicting moderate weather...
   



When only one LED is glowing, the air pressure is at a very low level, and stormy weather is likely.

HERE'S THE CODE...

this is the code we used to generate random numerical inputs that represent different pressure levels (since the pressure sensor is flying here and will arrive at a later date).  So, in this case, the number 0 represents the atmospheric lowest pressure level, and the number 5 represents the highest.  


int blueoneLED=12;   //Pin12 = Blue LED (lowest)
int bluetwoLED=11;   //Pin11 = blue LED (higher)
int greenoneLED=10;    //Pin10 = green LED (lower)
int greentwoLED=9;                                  //Pin9 = green LED (higher)
int yellowoneLED=8;                                 //Pin8 = yellow LED (lower)
int yellowtwoLED=7;                                 //Pin7 = yelow LED (higher) 
//long val=0;    //variable o store the value coming from the sensor
long randNumber;

void setup()
{
  pinMode(blueoneLED, OUTPUT);  //LED set to output
  pinMode(bluetwoLED, OUTPUT);  //LED set to output
  pinMode(greenoneLED, OUTPUT);  //LED set to output
  pinMode(greentwoLED, OUTPUT);                   //LED set to output
  pinMode(yellowoneLED, OUTPUT);                  //LED set to output
  pinMode(yellowtwoLED, OUTPUT);                  //LED set to output
  Serial.begin(9600);

void loop ()  //loop below process
{

  randNumber = random(6);        //select random number from 0 to 6 
  Serial.println (randNumber); //print random value on serial screen

  if (randNumber == 0)    //Check if selected number is 0 (lowest air pressure)
  {
    digitalWrite (blueoneLED, HIGH); //If so... turn LED on
    digitalWrite (bluetwoLED, LOW);    
    digitalWrite (greenoneLED, LOW);     
    digitalWrite (greentwoLED, LOW);
    digitalWrite (yellowoneLED, LOW);
    digitalWrite (yellowtwoLED, LOW);  
  }
  else if (randNumber == 1)  //if selected number is 1 (low air pressure)
  {
    digitalWrite (blueoneLED, HIGH); //turn LED on
    digitalWrite (bluetwoLED, HIGH);  //turn LED on
    digitalWrite (greenoneLED, LOW);    
    digitalWrite (greentwoLED, LOW);
    digitalWrite (yellowoneLED, LOW);
    digitalWrite (yellowtwoLED, LOW);  
  }
  else if (randNumber == 2)      //if selected number is 2 (medium-low air pressure)
  {
    digitalWrite (blueoneLED, HIGH); //turn LED off
    digitalWrite (bluetwoLED, HIGH);   //turn LED off
    digitalWrite (greenoneLED, HIGH);   //turn LED on
    digitalWrite (greentwoLED, LOW);
    digitalWrite (yellowoneLED, LOW);
    digitalWrite (yellowtwoLED, LOW);
  }
  else if (randNumber == 3)
  {
     digitalWrite (blueoneLED, HIGH); //turn LED off
    digitalWrite (bluetwoLED, HIGH);   //turn LED off
    digitalWrite (greenoneLED, HIGH);   //turn LED on
    digitalWrite (greentwoLED, HIGH);
    digitalWrite (yellowoneLED, LOW);
    digitalWrite (yellowtwoLED, LOW);
  }
  else if  (randNumber == 4)
  {
   digitalWrite (blueoneLED, HIGH); //turn LED off
    digitalWrite (bluetwoLED, HIGH);   //turn LED off
    digitalWrite (greenoneLED, HIGH);   //turn LED on
    digitalWrite (greentwoLED, HIGH);
    digitalWrite (yellowoneLED, HIGH);
    digitalWrite (yellowtwoLED, LOW);
  }
  else if (randNumber == 5)
  {
    digitalWrite (blueoneLED, HIGH); //turn LED off
    digitalWrite (bluetwoLED, HIGH);   //turn LED off
    digitalWrite (greenoneLED, HIGH);   //turn LED on
    digitalWrite (greentwoLED, HIGH);
    digitalWrite (yellowoneLED, HIGH);
    digitalWrite (yellowtwoLED, HIGH);
  }
  
  delay(5000); //wait for 10 seconds

}  //End of process, go back to start of loop