Project 1: LED Lights TradeShow 2ND Documentation | “CAW CAW” Means I like you

Standard

So <“CAW CAW” Means I Like You> ended up becoming a beta project instead of its main version.

As previously explained in my 1st Documentation of this project, <“CAW CAW” Means I Like You> is supposed to be a visual representation of how someone likes to have their friends around them, emulating a Peacock’s Mating Dance. This project utilizes Arduino, and makes use of Servo Motors to change the wing directions, ultrasonic sensor to detect distances, and LED Strips W2818.

When one is alone, the LED Strips would be facing upwards and will emit a red light indicating animosity. When someone approaches the first person, the ultrasonic sensor will detect the presence of the second person and set the LED Stripped wearable off. In response, the “tail” of LED Strips will move outwards, 90 degrees in opposite angles and the color of the tail will be wiped to green for approval. This indicates that the person hates being lonely, and likes to have his friends around them.

Creating this in view of the brief, it is supposed to be a flashy presentation of the LED Strips that the tradeshow is trying to promote. With its interactivity, people would be more inclined to try out the wearable technology and it would ideally create more fascination with the LED effects it provides.

Source Code for Arduino:

#include <Adafruit_NeoPixel.h>
#include <Servo.h>
#include <NewPing.h>

//Declarations
const int ServoPin1 = 13;
const int ServoPin2 = 12;
const int TriggerPin = 3;
const int EchoPin = 2;
long distance;
long duration;
//LED
const int ledPIN1 = 8;
const int ledPIN2 = 9;

const int numOfLeds = 30; // Number of leds

//Adafruit_NeoPixel pixels = Adafruit_NeoPixel(numOfLeds, ledPin, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(numOfLeds, ledPIN1, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2 = Adafruit_NeoPixel(numOfLeds, ledPIN2, NEO_GRB + NEO_KHZ800);

//Create a servo object
Servo Servo1; //LEFT
Servo Servo2; //RIGHT

//100 = maxDistance
NewPing sonar(TriggerPin, EchoPin, 100);

void setup(){
Serial.begin(9600);
pinMode(TriggerPin, OUTPUT);
pinMode(EchoPin, INPUT);
Servo1.attach(ServoPin1);
Servo2.attach(ServoPin2);
strip1.begin(); // Initializes the NeoPixel library
strip2.begin();
strip1.show();
strip2.show();

}

void loop(){
//delayMicroseconds(1000);
//int cm = sonar.ping_cm();
ultra();
//int angle1 = (map, 2, 40, 0, 128);
//int angle2 = (map, 2, 40, 0, 218);

if (distance <=150){
//Spread wings
Servo1.write(180);
Servo2.write(0);
//strip1.show();
//strip2,show();
//rainbow(10);
colorWipe(strip1.Color( 0, 255, 0), 50); // Green
colorWipe(strip2.Color( 0, 255, 0), 50); // Green
delay(1000);
}
else{
//Go back home
Servo1.write(90);
Servo2.write(90);
strip2.show();
colorWipe(strip1.Color(255, 0, 0), 50); // Red
colorWipe(strip2.Color(255, 0, 0), 50); // Green
delay(1000);
}

}

void colorWipe(uint32_t color, int wait) {
for(int i=0; i<strip1.numPixels(); i++) { // For each pixel in strip…
strip1.setPixelColor(i, color); // Set pixel’s color (in RAM)
strip1.show(); // Update strip to match
delay(wait); // Pause for a moment
}

for(int i=0; i<strip2.numPixels(); i++){
strip2.setPixelColor(i, color);
strip2.show();
delay(wait);
}
}

void ultra(){
digitalWrite(TriggerPin, LOW);
delayMicroseconds(2);
digitalWrite(TriggerPin, HIGH);
delayMicroseconds(10);
digitalWrite(TriggerPin, LOW);
duration = pulseIn(EchoPin, HIGH);
distance = duration*0.034/2;
Serial.print(“Distance: “);
Serial.println(distance);
}

void rainbow(int wait) {
for(long firstPixelHue = 0; firstPixelHue < 5*65536; firstPixelHue += 256) {
for(int i=0; i<strip1.numPixels(); i++) { // For each pixel in strip…
for(int i=0; i<strip2.numPixels(); i++) {
int pixelHue = firstPixelHue + (i * 65536L / strip1.numPixels());
int pixelHue2 = firstPixelHue + (i * 65536L / strip2.numPixels());

strip1.setPixelColor(i, strip1.gamma32(strip1.ColorHSV(pixelHue)));
strip2.setPixelColor(i, strip2.gamma32(strip2.ColorHSV(pixelHue2)));
}
}
strip1.show(); // Update strip with new contents
strip2.show();
delay(wait); // Pause for a moment
}
}

Initially, I had big ideas about having it be a audio visualizer slash music visualizer and having one more static LED Strip in the middle against the back. But I faced multiple issues along the way and had to compromise:

  1. Not enough power to supply 3 LED Strips worth 30 bulbs each. I didn’t know how to increase the power at then, so I had to make do with 3 LED Strips instead.
  2. Problem with Flashy LED Colours; Because of silly me utilizing delays in my code, the flashier light effects I originally intended for did not seem to work. In the end, I had to make do with simpler light effects (Colorwipe instead) to represent what I was trying to do. I made use of red to indicate indifference, and green light for approval.
  3. The circuit kept bloody falling off. I did not have the right materials at then to create a proper pouch and I wasn’t adept enough to solder my wires confidently on a breadboard meant for soldering too. In the end, I was just taping and taping even more onto a piece of cardboard and to the belt I attached the wings to. It fell off right before presentation….
  4. IT WAS SUPPOSED TO BE LIKE A PEACOCK TAIL. But I didn’t procure fabrics in time and made use of white crepe paper instead. While it certainly gave off the right effect, but I had to make the tail two tails instead (because the wrong measurement would tear the paper if my circuit went wonky) and it ended up looking like insect wings.
  5. The color wipe turned out to be a bit laggy. I don’t know why still…

My wonderful cardboard apparatus

Testing it out. Thank you Shah for modelling and Bryan for snapping this pic!

“Is everything ok”

Overall, I was a little proud of myself for being able to make my wearable work somewhat given that it was my first time dealing with these components but I was also disappointed that I didn’t have enough time to make it optimal.

Leave a Reply