Thursday, February 7, 2013

My project is an LED wall in a hallway or tunnel.  I've given up on the motion sensors because not only are they more difficult to use than light sensors, but they aren't as cost effective either.  That's a lose-lose.  So, my design is still essentially the same, but instead of using passive IR to detect motion it will detect whether or not the light sensitive diode is covered up.  Of course, the diode will have to be encased in a sort of tube to prevent the leds around it from interfering, but the motion sensor would have needed the same thing.


 Here is a conceptual drawing of what I am imagining.  The colors will fade as the person moves, leaving a trail of light behind them.  If another person walks by, they will trail a different, random color.  If one person's trail overtakes another's, then the colors would mix.  The setup would include a wall of LEDs (in this diagram, the blue dots), and at the four foot vertical mark, a line of light sensors.  These would be encased in small tubes shielding them from the light of the surrounding LEDs.


Here is a diagram for how the LDR will be hooked up:


The LED will be hooked up as usual.  The code is as follows:

int lightPin = A0;
int ledPin = 10;

int lightVal;
int ledVal;

void setup()                    // run once, when the sketch starts
{
  Serial.begin(9600);
  pinMode(lightPin, INPUT);
 
  pinMode(ledPin, OUTPUT);
}

void loop()                     // run over and over again
{
  lightVal = analogRead(lightPin);
 
  while(lightPin >= 250)  //would have to be calibrated to the hallway
  {
    ledVal -= 10;
    delay(10);
    analogWrite(ledPin, ledVal);
    Serial.print(ledVal);
    Serial.print('\n');
    lightVal = analogRead(lightPin);
    if(ledVal < 0)
      ledVal = 0;
  }
 
    ledVal = 255;
    analogWrite(ledPin, ledVal);
}


http://dobpler.com/photo.html  - led wall in sweden

http://www.youtube.com/watch?v=6xriYUzJ9Ls - movement tracking led wall in Montreal

No comments:

Post a Comment