Lantern Fish – Halloween Costume

P2290595new

Here is my Halloween Costume. I was so excited after finishing it. It is really an unforgettable experience. Not only the challenging process of making the hood but also walking at the amazing parade wearing the hood.

Materials:

  • 1 RGB Neopixel LEDs
  • 1 HC-SR04 Ultrasonic Sonar Distance Sensor
  • 1 GEMMA  – Wearable Microcontroller
  • 1 Lithium Ion Polymer Battery

  • Fleece
  • Felt
  • Stuffing
  • Velcro
  • Iron wire

Initial proposal:

IMG_8503

I really like this hood initially. But the sewing was a very intricate task and harder then I had expected. I was trying to find what the other people did and learned how to make this hood. It is really tough and I tried to make the hood again and again. Finally, I made it even though it is not perfect. I also use the velcro to make this hood more suitable for the head. I added the detail to the fish like eyes, teeth, fins, and etc.

IMG_8895

Besides making the whole hood, another challenge is to connect the light with hood. I have tried different ways like tied it on the breadboard. But finally I used the iron wire to make it like a headband which is much more stable.

IMG_90391.jpg

For the circuit board. At first, I didn’t realize the distance sensor cannot be hidden in the hood. It must be at outside the hood without anything in front of it. Then I tried to tie it with the neopixel, making them like a little fish.

Below are more pictures and the code:

IMG_3744IMG_6679

#include <Adafruit_NeoPixel.h>

#define PIN 1

#define NUM_LEDS 1

#define BRIGHTNESS 200

#define Trig 0 
#define Echo 2 
 
float cm; 
float temp; // 
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_RGB     Pixels are wired for RGB bitstream
//   NEO_GRB     Pixels are wired for GRB bitstream, correct if colors are swapped upon testing
//   NEO_RGBW    Pixels are wired for RGBW bitstream
//   NEO_KHZ400  400 KHz bitstream (e.g. FLORA pixels)
//   NEO_KHZ800  800 KHz bitstream (e.g. High Density LED strip), correct for neopixel stick
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_RGB + NEO_KHZ800);

int inches = 0;

long readUltrasonicDistance(int pin)
{
  pinMode(pin, OUTPUT);  // Clear the trigger
  digitalWrite(pin, LOW);
  delayMicroseconds(2);
  // Sets the pin on HIGH state for 10 micro seconds
  digitalWrite(pin, HIGH);
  delayMicroseconds(10);
  digitalWrite(pin, LOW);
  pinMode(pin, INPUT);
  // Reads the pin, and returns the sound wave travel time in microseconds
  return pulseIn(pin, HIGH);
}

void setup()
{
//  Serial.begin(9600);
  pinMode(Trig, OUTPUT);
  pinMode(Echo, INPUT);
  pinMode(1, INPUT);
  strip.setBrightness(BRIGHTNESS);
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'

}

void loop()
{
  digitalWrite(Trig, LOW); 
  delayMicroseconds(2); 
  digitalWrite(Trig,HIGH); 
  delayMicroseconds(10); 
  digitalWrite(Trig, LOW); 
  
  temp = float(pulseIn(Echo, HIGH)); 
  cm = (temp * 17 )/1000; 


if (cm < 30){
    colorWipe(strip.Color(0, 255, 0), 50); // Red
  } else if (cm >=30 && cm < 500){
  colorWipe(strip.Color(100, 100, 100), 50); 
  }
}

void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, c);
    strip.show();
    delay(wait);
  }
}

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s