Interactive Light Object

Creating an interactive light object I immediately thought of signage. 

Exploring ideas around the commodity of information and information fatigue, I wanted to create a "neon" sign using RBG 5v LED's controlled by an Arduino Nano knockoff. The effects will be based on an ultrasonic sensor's use of distance to strobe and turn off the letter S in NEWS, so it flashes NEW instead. This strobe makes the signage hard to look at exploring the fatigue aspect of the concept. 
Using Tip122's This allows me to control the RGB values of the strip because without the circuit controller the LED's do not function. 

I ran into issues of the S being in sequence with the NEW letters that is due to the fact I now have to duplicate the circuit and to create a separate function for the letter S. To revise it just requires futher working with the materials i have now. 

Referenced Materials for code and Cuircit

https://howtomechatronics.com/tutorials/arduino/ultrasonic-sensor-hc-sr04/
https://makezine.com/projects/android-arduino-led-strip-lights/

Code

const int RED = 9;
const int BLUE = 10;
const int GREEN = 11;
const int NEW = 12;

const int trigPin = 6;
const int echoPin = 7;

int brightness = 255;

int gBright = 0;
int rBright = 0;
int bBright = 0;
int NEWS = 0;

long duration;
int distance;

void setup() {
  pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
  pinMode(echoPin, INPUT); // Sets the echoPin as an Input

  pinMode(GREEN, OUTPUT);
  pinMode(RED, OUTPUT);
  pinMode(BLUE, OUTPUT);
  pinMode(NEW, OUTPUT);

  Serial.begin(9600);
}


void loop() {
  // Clears the trigPin
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  // Sets the trigPin on HIGH state for 10 micro seconds
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  // Reads the echoPin, returns the sound wave travel time in microseconds
  duration = pulseIn(echoPin, HIGH);
  // Calculating the distance
  distance = duration * 0.034 / 2;
  // Prints the distance on the Serial Monitor
  Serial.print("Distance: ");
  Serial.println(distance);

  if (distance < 400){ 
    //If distance is less than 400 turn S off and strobe 
  for (int i = 0; i < 256; i++) {
    analogWrite(RED, rBright);
    rBright += 10;
 
  }

  for (int i = 0; i < 256; i++) {
    analogWrite(BLUE, bBright);
    bBright += 10;
  }

  for (int i = 0; i < 256; i++) {
    analogWrite(GREEN, gBright);
    gBright += 10;
  }
  }else{ //keep S on and lightly fade
    for (int i = 0; i < 256; i++) {
    analogWrite(RED, rBright);
    rBright += 1;
 
  }

  for (int i = 0; i < 256; i++) {
    analogWrite(BLUE, bBright);
    bBright += 1;
  }

  for (int i = 0; i < 256; i++) {
    analogWrite(GREEN, gBright);
    gBright += 1;
  }
    for (int i = 0; i < 256; i++) {
    analogWrite(NEW, NEWS);
    NEWS += 1;
  } 
  }
}


Comments

Popular Posts