Flashy Steampunk Goggles

by deluges in Circuits > LEDs

6769 Views, 120 Favorites, 0 Comments

Flashy Steampunk Goggles

P1080749.JPG
P1050224.jpg
P1080751.JPG
P1050212.jpg
P1050206.jpg

Hey guys,

Here is a small project that includes a little bit of crafting and a little bit of coding. It's really accessible to anyone with basic soldering skills and should not take you more than a couple hours once you have all the parts you need.

Those goggles can display every imaginable colour and pattern for festive purposes or be lit in white at full brightness and used for precision crafting where optimal lighting is appreciated.

I'd like to thank my cousin for being so handsome with those on. (He's the one in the pictures. Ladies can line up on the left, business enquiries on the right.)

Let's get started !

Nota bene a.k.a. disclaimer : The LEDs in the Neopixel rings are WAAAY BRIGHT. Several studies warn against the exposure of eyes to bright (especially blue) light (1). Build this device (and put your head in it) at your own risk. And please do not expose other's eyes to those very bright lights. Use neurons and the dimming command provided with the Neopixel library.

(1) Hawse, P. “Blocking the Blue.” The British Journal of Ophthalmology 90.8 (2006): 939-940. PMC.. http://www.ncbi.nlm.nih.gov/pmc/articles/PMC185720...

Tools and Materials

IMG_20141231_195846.jpg
IMG_20141231_184946.jpg
IMG_20141231_185018.jpg
IMG_20141231_185023.jpg
IMG_20141231_185030.jpg
IMG_20141231_185041.jpg
IMG_20141231_184953.jpg
IMG_20141231_195859.jpg

Most of the materials for this project came from the Adafruit website (I already had the arduino)

You'll need :

An old pair of goggles (found mine in my granddad's attic)

1 x Lithium Ion Polymer Battery - 3.7v 2500mAh[ID:328]

1 x Adafruit PowerBoost 500 Shield - Rechargeable 5V Power Shield[ID:2078]

2 x NeoPixel Ring - 12 x WS2812 5050 RGB LED with IntegratedDrivers[ID:1643]

Soldering iron and wire

Usb cable to charge the battery

Cyanoacrylate (super glue) (or any other kind of glue)

A bit of thin scrap wood

Thin electric wire

Electrical tape and/or heat shrink

Coping saw

Sawing and Sewing

IMG_20141231_195944.jpg
IMG_20141231_200103.jpg
IMG_20150118_162511.jpg

First, I removed the glass panes from the goggles and traced them on wood. I cut it on the scroll saw and drilled a hole in the middle the same diameter of the inside of the Neopixel ring. Easy peasy.

I then sewed the strap to the right fit for my head.

Electronics (Soldering/Arduino)

IMG_20150117_201758.jpg
IMG_20141231_184936.jpg
IMG_20141231_195906.jpg
IMG_20150118_161754.jpg
P1050209.jpg

I soldered three wires on the + / - and signal legs of the Neopixel ring and connected them to three of the wires in a male USB outlet.I then connected a female USB plug to the arduino on the 5V / Gnd and one signal output pin, so that I could plug this project or any other three-wire project in the Arduino easily.

I don't like having an Arduino stuck in a project forever so I designed this plugging mechanism to be able to use the arduino for another project.

I then supeglued the LEDs to the wood after drilling holes for the wires. A bit of hot glue held the wires together inside the goggles (see pictures).

Arduino Box

P1050210.jpg
IMG_20150117_225147.jpg
IMG_20150117_224004.jpg
IMG_20150117_225830.jpg
IMG_20150117_224034.jpg
P1050211.jpg

I then made, out of Plexiglass and wood, a small box to enclose the Arduino, shield and battery so that I could fit all of it in a small pocket.

Future improvements would include an arduino mini for a more portable device.

Code

I used a slightly modified version of the code I used in my infinity table with casual tools project. I put it here for download and plug and play purposes but it's easy to find inspiration (and all the required libraries) either at adafruit, or here on the Instructables website. My code is pretty basic and cycles different displays of unique colors, rainbow, spins etc.

The next step (when I have time) will be to add a small piezo or microphone and make the display react to music like a physical equalizer animation (where notes would change the color and volume the light intensity for instance).

Updates on this sometime in the future.

CODE :

#include

#define PINdroite 1 #define STRIPSIZE 12

// Parameter 1 = number of pixels in strip // Parameter 2 = pin number (most are valid) // Parameter 3 = pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIPSIZE, PINdroite, NEO_GRB + NEO_KHZ800);

void setup() { strip.begin(); strip.setBrightness(60); // Lower brightness and save eyeballs! strip.show(); // Initialize all pixels to 'off' }

void loop() { // Some example procedures showing how to display to the pixels: colorWipe(strip.Color(0,0,0), 25); // Black colorWipe(strip.Color(64, 0, 0), 100); // Red colorWipe(strip.Color(0, 64, 0), 100); // Green colorWipe(strip.Color(0, 0, 64), 100); // Blue colorWave(75); colorWipe(strip.Color(0,0,0), 100); // Black rainbow(15); colorWipe(strip.Color(0,0,0), 100); // Black rainbowCycle(15); colorWipe(strip.Color(0,0,0), 100); // Black colorWave(30); }

// Fill the dots one after the other with a color void colorWipe(uint32_t c, uint8_t wait) { for(uint16_t i=0; i

void rainbow(uint8_t wait) { uint16_t i, j;

for(j=0; j<256; j++) { for(i=0; i

// Slightly different, this makes the rainbow equally distributed throughout void rainbowCycle(uint8_t wait) { uint16_t i, j;

for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel for(i=0; i< strip.numPixels(); i++) { strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255)); } strip.show(); delay(wait); } }

// Input a value 0 to 255 to get a color value. // The colours are a transition r - g - b - back to r. uint32_t Wheel(byte WheelPos) { if(WheelPos < 85) { return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); } else if(WheelPos < 170) { WheelPos -= 85; return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); } else { WheelPos -= 170; return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); } }

/** * ^ ^ ^ * ~~~~~ ColorWave ~~~~~ * V V V */ void colorWave(uint8_t wait) { int i, j, stripsize, cycle; float ang, rsin, gsin, bsin, offset;

static int tick = 0; stripsize = strip.numPixels(); cycle = stripsize * 25; // times around the circle...

while (++tick % cycle) { offset = map2PI(tick);

for (i = 0; i < stripsize; i++) { ang = map2PI(i) - offset; rsin = sin(ang); gsin = sin(2.0 * ang / 3.0 + map2PI(int(stripsize/6))); bsin = sin(4.0 * ang / 5.0 + map2PI(int(stripsize/3))); strip.setPixelColor(i, strip.Color(trigScale(rsin), trigScale(gsin), trigScale(bsin))); }

strip.show(); delay(wait); }

}

/** * Scale a value returned from a trig function to a byte value. * [-1, +1] -> [0, 254] * Note that we ignore the possible value of 255, for efficiency, * and because nobody will be able to differentiate between the * brightness levels of 254 and 255. */ byte trigScale(float val) { val += 1.0; // move range to [0.0, 2.0] val *= 127.0; // move range to [0.0, 254.0]

return int(val) & 255; }

/** * Map an integer so that [0, striplength] -> [0, 2PI] */ float map2PI(int i) { return PI*2.0*float(i) / float(strip.numPixels()); }

/CODE

Downloads

Done !

P1050207.jpg
P1050223.jpg
P1080756.JPG
P1080755.JPG
P1050208.jpg

Upload the code to the 'duino, plug everything in and there you go ! Fancy, VERY BRIGHT, flashy party goggles.

Be careful not to look people directly in the eye and maybe do not use full brightness. I use 20 to 30% and find that it is way more than enough

The wire goes easily behind the ear and down the neck and back to the pocket, and is quite discreet. With a smaller microcontroller, I think one could fit everything inside the glasses themselves.

Here they are pictured on my infinity table, which makes for a nice match !

Thanks for reading! I'd be glad to answer any questions

Deluges