Tuesday, October 24, 2017

Running list of hackers I've met

Nothing special implied.  Just folks I recognize and/or admire from a professional standpoint. 

Shook the hand of:


  • Jayson Street
  • Moxie Marlinspike
  • Deviant Ollam
  • Mikko Hypponen
  • Dual Core
  • ALT-F4

Saw from a distance but wasn't able to meet yet:
  • Katie Mossouris (k8emo)
  • Dark Tangeant
  • Dan Kaminsky


Monday, January 25, 2016

NeoBracelet by the Brain

I've been dreaming of a reasonable way to make a bracelet full of neopixels for a while now.  I finally realized a way to do it so I will share my process with the world.  I only made my own random blinking code so if anyone would like to write custom code for a nice animation or another neat idea, please send me a message on g+.

This project takes a normal bracelet and basically makes it "taller" by stacking items on top.  So the final product is going to look a tad more beefy compared to most bracelets.   But with the batteries I used, it should stay powered on for at least 8 hours.

This project was featured on Adafruit's blog

Obligatory Disclaimer:
While I shouldn't have to say this anyway....I am not responsible for anything you do.  I don't care if you burn your house down or worse.  This information is for educational purposes only and you are responsible for your own actions.
Physical Warning:
This task does involve some soldering.  If you have no desire to do that, then you can find someone that knows how to solder or just go do a different project.  You can always locate your nearest Hackerspace and there should be plenty of people there that can assist.
Copyright Warning:
This project is my intellectual property that I am giving to the open-source community for non-profit use only.

List of materials:
  • One meter Adafruit Neopixels (60/meter) with black backing.  If you want to go ultra bling then you can get the 120/meter strips. 
  • One plaint leather bracelet, dark in color, preferably with buttons or some easy and compact connection.  pay attention to the actual width of the bracelet.  the wider the bracelet the more rows of neopixels you can use.
  • One Adafruit Trinket Pro 3v.  Dont bother using gemma or normal trinket, you need a lot of ram and code space to run even basic programs and this project begs creative code.
    NOTE: in some images below, you will notice I used a gemma at first.  this is how I learned of the above need for extra code space, but a gemma technically will work with its own limitations if you still prefer to use it.
  • Low voltage wire, threaded.  Cat5 cable works great. 
  • Two Li-Po batteries, 650mAh each
    • Note: if you use lipo batteries, you will need a lipo charger.  I use this one because it has a handy "DONE" indicator light. 
  • One JST extension cable
  • Soldering iron & solder
  • One mini push button
  • Hot glue gun & hot glue
  • Gorilla Glue or some other strong adhesive for leather
  • Binder clips
  • Heat shrink and heat gun
  • Wooden dowels/sticks.  (can be found at any craft store)
  • Hair spray
  • Electrical tape (black)

 First put on your bracelet and find the best locations to place your batteries.    Use a marker to trace where they should go so you can glue them later.

 Before gluing anything, first you want to combine the batteries.  use low voltage cable to combine both red wires into one single wire, and the same for the two black wires.  this will make one large 1300mAh battery.  give the new wires enough slack to work with for positioning. 
 
Now glue the batteries to the bracelet and use the binder clips to hold them in place until fully dry.  Despite the images below, don't bother gluing the board to the bracelet yet.  you still need to solder.





 Now put on the bracelet again and use the neopixels to measure the required length for each strip of pixels.  you want to wear the bracelet for this because when the bracelet goes from flat to round, the strips of pixels will tighten.

Cut as many strips of pixels that your bracelet can handle based on the width.   Cut them in the center of the copper leads. 

Remove the pixels from the plastic sheathing.  then solder the pieces back together with a very small length of low voltage cable.  The length will depend on how you want to order the array of pixels.   My array goes back and forth, but you could have them all start on one end and end at the other side.  This method would require longer lengths of cable.  Either way you need to solder the leads where they were cut to once again make one long strip.   also make the initial 3 connections at the start of the strip to be connected to the board.

Note:  you could make multiple independent strips instead of combining them together, but I am not discussing that here.

Cut some wooden dowels that are the same thickness as the batteries.  Cut them to the length that matches the width of the bracelet.   these dowels are to be used as filler between the batteries so the pixels do not sink.   Glue the dowels to the bracelet in between the batteries but spaced apart evenly.

Cut the ends off the JST extension cable.   the female end needs to connect to the matching color wires of the battery and should be positioned so it can reach the male end at any time.   the male end needs to join the power wires on the neopixel strip. so connect the black wire to the neopixel GND wire, and the red wire to the neopixel 5v wire.   both of these new unisons will need one more single low voltage wire attached to them as this wire is needed to go directly to the board for soldering.  the neopixel data wire can go directly to the board if it's long enough.

Now solder the wires to the board.  the neopixel 5v wire combo goes to the BAT pin on the board (or for gemma use VBATT).    the neopixel GND combo wire goes to the GND pin on the board found next to the BAT pin.  the neopixel data pin goes to pin 8 on the board.   Solder the push button to pins 6 and 3.

Upload the code included below to the board.  Use this time to test and troubleshoot as needed.

Once the strip is fully connected, coat it with hair spray to give it a little waterproofing.  there are other things that can be used for the same purpose, but be careful not to obstruct the LEDs with too thick a coat of anything.

Use a small amount of hot glue on the ends of the strips of neopixels where the wires are connected.  This will better secure the wires from being pulled apart accidentally.
Now place the strips over the bracelet and hide any cabling as best you can.  Glue the strips across the batteries and dowel pieces making a nice upper coat of pixels.  glue the board somewhere under the pixels and be sure the usb connection is easily accessible at all times.  I placed my board at the end.  As shown below, you can see the usb port. 


 Once the strips are in place and secured, cut long strips of electrical tape in half-width pieces.  Place the electrical tape over the copper leads and wrap it around the bracelet.

Connect the JST ends together and verify the unit works as expected. Enjoy your bracelet.

The push button runs the same program but changes between a fully illuminated grid versus a partially illuminated grid.  For example, the code is running a random color generation program.  If the random color matches the target color (RED) then that pixel stays that color.  This will continue until all pixels are red.  Then a new random color is chosen as the target color and the program tries again to fill the pixels with that matching color.

If the button is pushed, the program changes to on/off mode where if the random color does not match the RGB value, then there is a 50% chance that instead of filling the random pixel with that random color, it will instead just turn off the pixel and move onto the next random pixel.   The less illuminated pattern is a tad easier on the eyes in some situations and gives more of an impression that the cpu is working.

Also, the odds of the color matching the target value is quite low, so you can run this code all day and maybe you will match one or two pixels. 

CODE:

#include <Adafruit_NeoPixel.h>
#define PIN 8
#define BUTTON 3
#define Pixels 40
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);

int alpha;int dir = 1; int flip;
int minAlpha = 25;int maxAlpha = 100;int alphaDelta = 5;
int cycle = 1; int tgtx=0;int tgty=0; int tgtz=0;
int x=0;int y=0;int z=0;int spot=0;
int pause = 0;int start=0;int mode=1;
int temp = 0; int listsize = 40;int state = 0;
int list[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};

void setup() {
Serial.begin(9600);

digitalWrite(BUTTON, LOW);
digitalWrite(6, HIGH);
strip.begin();
randomSeed(1);
    tgtx = 254;
    tgty = 0;
    tgtz = 0;
for(int a=0;a<5;a++){
      strip.setPixelColor(a, 0,0,0);}
    strip.show();
}

void loop() {

if(digitalRead(BUTTON) == HIGH){ state++;delay(500);  }
if(state > 1){ state=0; }
 
int count=0;int loop=0;
for(int a=0;a<40;a++){
count += list[a];
}

if(count == 0){
    //reset when full
    tgtx = random(254);
    tgty = random(199);
    tgtz = random(199);
    int list[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
do{
    for(int a=0;a<5;a++){
          strip.setPixelColor(a, 0,0,0);}
        strip.show();delay(200);
    for(int a=0;a<5;a++){
          strip.setPixelColor(a, 0,0,254);}
        strip.show();delay(200);
        loop++;
}while(loop<10);
    for(int a=0;a<5;a++){
      strip.setPixelColor(a, 0,0,0);}
    strip.show();delay(200);
}
strip.setBrightness(15);
mode = random(2);
int rand = 0;int spot=0;
do{
  spot = random(listsize);
  //Serial.print("spotA=");  Serial.println(spot);
  rand = list[spot];
}while(rand == 0);
pause = random(10);
x = random(255);
y = random(200);
z = random(200);
Serial.println("");
Serial.print("state = ");  Serial.println(state);

if(x==tgtx && y==tgty && z==tgtz){  
    //delay(5000);
    //remove element from array
    list[spot] = 0; Serial.print("list-");Serial.print(spot);  Serial.print(" = 0");
    strip.setPixelColor(spot, x, y, z);
}
else{
    if(mode==0 && state==0){   // turn off
        strip.setPixelColor(spot, 0,0,0);}
    else{    // or change random color
        strip.setPixelColor(spot, x, y, z); }
    strip.show(); 
    //delay(pause);
} // end if else

} // end void   

Monday, January 4, 2016

Studying for CCSA or CCSE

Short answer: don't.

Talk to people who have taken the test lately before you do.  Checkpoint publicly states their exams consist of 70% book material and 30% off-book material.  The off-book material are simply things you should somehow know before taking the test after having learned about it being a full time Checkpoint firewall administrator.

Checkpoint, in their infinite wisdom, has decided that their certification exams should test the applicant on common knowledge of the operating system that is not included in the study material.  This common knowledge is determined by a panel of highly experienced Checkpoint system administrators. So the topics this particular group of admins feel you should know is what you are expected to know for the exam.  

But the 30% of innate experience they expect you to have is completely subjective but still assumes everyone has the same network environment and firewall policies.  This simply is not the case.   Smaller organizations are likely to have much similar environments and thus their policies will be somewhat similar as well.  But larger organizations get far more complicated and are far less likely to have the same policies as a smaller organization.

Furthermore, a larger organization tends to avoid single-solution products.  While Checkpoint firewalls can be a single-solution device with all the fancy blades and new toys, larger companies with exponential networks tend to avoid the one-size-fits-all solution.   While you can do this, there are always drawbacks at some level that make a more targeted solution the more attractive idea.  

Checkpoint does IDS, and endpoint protection, Antivirus, Identity Management, Data Loss Prevention, and more.  But larger companies are still going to buy the products that specialize in each because you get far more control and better logs in return.   So anyone working for a large company is not going to get the kind of experience as the administrators working for smaller organizations.

If that is your situation, then you will likely fail the exam and wast a lot of money and time.  There is no legitimate way to study for that 30% if you simply cannot get the real-world experience to use and manage all of the blades that Checkpoint products have to offer.

So the best solution....cheat.   Well, not during the test anyway.   All you can do is find the most recent CCSA/CCSE example test on the internet and memorize all of the answers.  In doing so you will see that a good 70% of the questions are straight from the book and you should already know them.  The rest are questions about command line nonsense of which you have never heard and other stuff that makes you wonder if this is the correct test at all.

After failing my test and others in my team having the same issue we began to wonder how we could pass the CISSP but fail the CCSA?  After expressing our concerns to Checkpoint, they revealed the above information and told us there was nothing they could do (which we knew was a lie, they just don't want to pay for any changes to be made to a really bad system).

So if you haven't worked with most of the blades for at least one year, then you are likely to fail as you won't know the little things the book won't tell you.   There's not much more you can do.  Read the book, practice on a VM, and then memorize the latest test.  If you have been working with most of the blades enabled for more than a year, then you should be ok.

Sunday, November 22, 2015

NeoMickey: Mickey/Minnie Mouse ears using Adafruit's Neopixels by the Brain

This article will show you how to make my NeoMickey ears.  I made a set of ears for both my girlfriend and I to use at Disneyland.  The ears were a huge success and a lot of people wanted to know where to get them.  So this is my best attempt to answer that question.

If anyone makes these and takes them to Disneyland, I would love to see a picture of them in use.  Please post a comment or you can post to my G+ page. 

The cost breakdown is included below.  The ears should run off of 3 Duracell AAA batteries for approximately 3 hours.   Rechargeable batteries have far less life, so test them before you invest in batteries.  There are other battery options for more experienced arduino makers.

I would like to add an IR receiver to this project to integrate the colors into the Glow with the Show hats sold at Disneyland.  If anyone has made significant progress with the IR coding for arduino compatible boards, please leave a comment or contact me on google+.

This article was mistakenly deleted so I am re-writing the entire thing and thus pieces may be incomplete.  Leave a comment if something is not clear and I will update asap.

This guide assumes you already know how to upload a sketch to an arduino compatible board.  If you don't you will need to learn that first.  Also, uploading to a Trinket Pro board requires you to press the reset button just before uploading.  The Flora boards don't needs this as they work just like Arduino Uno boards.

The twinkle code I used for the inner neopixel strips was written by Balázs Suhajda found on Github



Obligatory Disclaimer:
While I shouldn't have to say this anyway....I am not responsible for anything you do.  I don't care if you burn your house down or worse.  This information is for educational purposes only and you are responsible for your own actions.
Physical Warning:
This task does involve some soldering.  If you have no desire to do that, then you can find someone that knows how to solder or just go do a different project.  You can always locate your nearest Hackerspace and there should be plenty of people there that can assist.
Copyright Warning:
This project is my intellectual property that I am giving to the open-source community for non-profit use only.  

Cost estimate:
This project is not exactly cheap.  The average mickey themed illuminated head piece sold at Disneyland costs at least $20 and costs $3-5 to mass produce.   This project is not designed for mass production and thus it's going to be more expensive.  Plus this project is intended to be heavy on the bling compared to most Disney junk.  So in general, this project is going to cost some cake.  Here is a basic breakdown of costs for this project.  See the end of this tutorial for potential cost saving alternatives ideas. 

So the cheapy, not-so-great version of this project is at least $61(after shipping) while the good version is $100 (after shipping).   It may not be cheap, but if you wanna turn some heads at Disneyland/Disney World, they are very much worth the effort and money.  

List of required/optional materials:
  • One 3v microcontroller board. For this tutorial I mainly refer to the Adafruit Flora but a Trinket Pro board will also work.  A Trinket Pro board is technically the best shape to fit on the alice band, but more difficult to use for inexperienced soldering.  You cannot use the smaller Trinket boards as there is not enough memory/flash.  Do NOT use 5v boards.  (see notes below)
  • Two sets of embroidery rings, 4-inch size, one set per ear (I recommend the wood versions, the plastic versions are harder to work with)
  • Silicone or super glue, clear in color
  • Wire strippers
  • Gorilla glue
  • Hot glue & hot glue gun (technically optional)
  • 2 meters of Adafruit Neopixels (60 pixels/meter)
  • Mini push button (optional)
  • One AAA battery pack
  • Exacto knife (or razor blade)
  • Minnie Mouse bow (only needed for the Minnie version.  either buy one or make one)
  • Flat packing material (for diffusion)
  • Bubble wrap material (or a clear plastic bag, the produce bags at grocery stores works great)
  • low voltage wire (cat5 cable works great, but always use threaded core, not solid core)
  • Alice Band
  • Binder clips
  • White and black zip ties, smallest size
  • Solder and soldering iron
  • Heat shrink and heat gun

First grab the embroidery rings and take them apart. You will be using the inner rings for the main project, and the outer rings will be used later for stencilling.  The inner rings will be referred to as "the rings" from this point.

Now take the neopixels and wrap them around the rings to measure the length of neopixels required for this project.   You need to cut two strips for each ring, one for the outside of the ring and one for the inside of the ring.  You should be able to get at least 18 pixels on the inner ring, and 20 pixels on the outer ring.

Cut the strips to their measured length.  The inner strip (the shorter one) should be unsheathed, so remove it from the plastic sheathing.  It's easier to just cut off the plastic cover but dont cut the strip.  The outer strip, however, needs that plastic sheathing so don't remove it unless you know what you are doing.


The neopixel strips have tiny arrows that point the direction of travel for the data signal.  So the first pixel points to the next.  Before the first pixel is the copper contact point to where the wires must be soldered.  See the image below as the strips are cut in the middle of the contact points.  This is where you must cut the strip.  The strips always come with a set of thick wires to connect to other devices.  These wires are too thick to work with here, and the sheathing is too thick at the very start.  So follow the example above and cut the strip starting after the first pixel or two. 

(image from Adafruit's site)

Take the strips and solder a low voltage wire to each contact point.  I advise you make the lengths of each wire at least 2 feet to start with.  This will give you lots of wiggle room later on.   You may need to cut away some of the plastic sheathing for the outer strip in order to attach the wires.

I recommend you use the same color wires for all the 5v (positive) contact points and another color for all the ground (negative) contact points on all four neopixel strips.   The data cables, however, should be all different colors as the program calls for 3 different software strips.   So two of the data cables will join together as one, and the other two cables are independent.  the coordinated use of cable colors will greatly help you later on.  

Once the wires are attached, first test them on your arduino if possible.  If you don't deal with neopixels a lot, then you will want to test them before you start gluing things.   

Test code: (adjust the pin assignments as needed.  refer to the NeoPixel uber guide for basic testing instructions.  you can use their test code or the code included below)
#include <Adafruit_NeoPixel.h>  // load the needed library
#define INPINLEFT 9    // pin for inner right ring 
#define INPINRIGHT 11  // pin for inner left ring 
#define OUTPIN 13      // pin for outer ring 
// 
#define Pixels 10      // # of pixels on inner ring 
#define OUTPixels 10   // # of pixels on outer ring 
Adafruit_NeoPixel stripL = Adafruit_NeoPixel(Pixels, INPINLEFT, NEO_GRB + NEO_KHZ800); 
Adafruit_NeoPixel stripR = Adafruit_NeoPixel(Pixels, INPINRIGHT, NEO_GRB + NEO_KHZ800); 
Adafruit_NeoPixel stripOUT = Adafruit_NeoPixel(OUTPixels, OUTPIN, NEO_GRB + NEO_KHZ800)
float redStatesL[Pixels]; float blueStatesL[Pixels]; float greenStatesL[Pixels]; float redStatesR[Pixels]; 
float blueStatesR[Pixels]; float greenStatesR[Pixels]; float fadeRate = 0.96; 
float a = 0; int f = 0; int state = 1; int count = 0; int loopcount = 0; int masterloop = 0; 
float b = 0; int g= 0; int h= 0; int i = 0; int x = 0; int y = 0; int z = 0; int wait = 5; 
int pause = 5; int count3 = 0; 

void setup() { 
  stripL.begin();  stripL.show(); // Initialize all pixels to 'off' 
  stripR.begin();  stripR.show(); // Initialize all pixels to 'off' 
  stripOUT.begin();  stripOUT.setBrightness(50); 
  stripOUT.show(); // Initialize all pixels to 'off' 
}  
void loop () 
{ stripL.setBrightness(255); 
stripR.setBrightness(255); 
      loopcount++; 
 if(loopcount == 4){ 
    b+=.5;   
    for(float f=0; f<OUTPixels; f++){ 
      stripOUT.setPixelColor(f, stripOUT.Color(170,0,170));   } 
      
      if(b==0){stripOUT.setPixelColor(b, stripOUT.Color(0,0,0));  
    stripOUT.setPixelColor(OUTPixels, stripOUT.Color(5,0,5));  
    stripOUT.setPixelColor(OUTPixels-1, stripOUT.Color(10,0,10));  
    stripOUT.setPixelColor(OUTPixels-2, stripOUT.Color(20,0,20));  
    stripOUT.setPixelColor(OUTPixels-3, stripOUT.Color(170,0,170));  // 
    }else if(b==1){stripOUT.setPixelColor(b, stripOUT.Color(0,0,0));  
    stripOUT.setPixelColor(b-1, stripOUT.Color(5,0,5));  
    stripOUT.setPixelColor(OUTPixels, stripOUT.Color(10,0,10));  
    stripOUT.setPixelColor(OUTPixels-1, stripOUT.Color(20,0,20));  
    stripOUT.setPixelColor(OUTPixels-2, stripOUT.Color(170,0,170));  // 
    }else if(b==2){stripOUT.setPixelColor(b, stripOUT.Color(0,0,0));  
    stripOUT.setPixelColor(b-1, stripOUT.Color(5,0,5));  
    stripOUT.setPixelColor(b-2, stripOUT.Color(10,0,10));  
    stripOUT.setPixelColor(OUTPixels, stripOUT.Color(20,0,20));  
    stripOUT.setPixelColor(OUTPixels-1, stripOUT.Color(170,0,170));  // 
    }else if(b==3){stripOUT.setPixelColor(b, stripOUT.Color(0,0,0));  
    stripOUT.setPixelColor(b-1, stripOUT.Color(5,0,5));  
    stripOUT.setPixelColor(b-2, stripOUT.Color(10,0,10));  
    stripOUT.setPixelColor(b-3, stripOUT.Color(20,0,20));  
    stripOUT.setPixelColor(OUTPixels, stripOUT.Color(170,0,170));  // 
    }else{ 
      stripOUT.setPixelColor(b, stripOUT.Color(0,0,0));   
      stripOUT.setPixelColor(b-1, stripOUT.Color(5,0,5)); 
      stripOUT.setPixelColor(b-2, stripOUT.Color(10,0,10)); 
      stripOUT.setPixelColor(b-3, stripOUT.Color(20,0,20)); 
      stripOUT.setPixelColor(b-4, stripOUT.Color(170,0,170));  } //                     
  loopcount=0; 
  } 
  if(b==OUTPixels){b=0;}   
} // end void loop

After a successful test, use the hot glue gun to glue together the contact points you just soldered on each strip.  This will both waterproof the contact points and also provide additional strength to keep the wires from coming loose.

Now use the hot glue gun and place glue around the inside of the ring.  Then quickly place the inner strip on that path of glue till it cools.   Next, add some gorilla glue to the outer face of the ring all the way around.  This glue won't dry fast so go slowly here and have the binder clips ready.  You want to position the outer strip so that the wires begin at the same place as the inner strip (see image below)

Once the outer strip is placed, use the binder clips to hold it in place.  Give it about an hour to fully dry.   Don't get the glue on the face of the outer strip because once it's dry it will block the light from the LEDs.
  

Do another test if possible to ensure the wires didn't come loose.

Now it's time to cut out some diffusion material.  The diffusion material I used is the packing material used for new monitors but you can also use the flat packing material found at walmart next to the bubble wrap.  If it's very thin, you'll want more than one layer.

Use the outer ring of the embroidery rings as a stencil for this material.  Use an exacto knife to cut out the stencils.

Once you have enough stencils cut, glue on one side using the silicone glue (super glue may not stick well to the plastic sheathing).  While it dries, put some weight on it to ensure all 360 degrees of glue is firmly attached.   After about 40 minutes, the glue should be plenty dry.   Before you attach the other side, first cut up some bubble wrap and place it inside the ring.  You really don't need much here.  The bubble wrap really goes a long way to help carry the light across the center of the ring.  Be careful using hot glue here as it may just melt the material.  So test it first. 
 
(left: no bubble wrap inserted yet.  right: bubble wrap inserted)

Once the bubble wrap has been placed, go ahead and add the other side of the diffusion material.   If you don't have any bubble wrap, you can use a clear plastic bag from the grocery store.

(both sides of diffusion material attached with bubble wrap inside)

Give the ears another test when fully dry. 


Now you need to decide on the positioning of the ears on the alice band.  Too high towards the center and it will look like round antennae while too low and you will look like Deamau5 instead of Mickey Mouse.  Once you find the ideal location, mark the alice band.

A note on the Alice Band:  You can technically use any alice band you want.  The band I am recommending above was the best for this project for two reasons.  1) it has a weave pattern which allowed me to just loop through the zip ties so I didnt have to drill any holes myself.  and 2) the band has a comb built into band which keeps the band firmly attached to your hair/head.  Keep in mind with the ears attached, the project will become somewhat top heavy, and the flat panels will easily catch a gust of wind.  So ensuring they stay affixed to your head is critical.  You don't want them them fall off and break .

Once you find the vertical positions, you need to decide exactly what part of the rings are going to make contact with the alice band.  Using the test code above, you will notice the rotating pattern of the outer strips of LEDs.   Both strips have a starting point, so you will need to make sure the starting point of each strip is identical on both sides.  After that, you need to ensure the direction of rotation pattern is going around clockwise on one ear and counter clockwise on the other ear.

Once you have that all figured out, you will see the point where the rings make contact with the alice band.  From there, you can use the white zip tie to poke a hole through the diffusion material just above the contact point of the ring.  Be careful here as neither the glue or diffusion material is very strong so don't let the zip tie pull off the diffusion material.  Zip tie the ring to the band where you marked it earlier and tighten the zip tie all the way.

Now let's extend the battery pack wires.  If you intend to use the JST connector as shown in the image below, then you will need to make the wire longer in order to reach the board on the other side of the alice band.  You can also buy a JST extension cable from Adafruit or other places. 

Per the image below, the Flora boards have an on/off switch as well.  This can be a more convenient switch compared to the battery pack.  However, if you are using the Trinket Pro board, it will not have an on/off switch (only a reset switch).   Another Flora advantage is you can connect the battery pack's JST cable directly into the JST jack on the Flora board as shown below.  This will allow you to use the on/off switch on the Flora.  However, if you connect the battery pack directly to the BATT and GND pins on the Flora board, you will not be able to use the on/off switch on the Flora.  It will simply always be ON while power is being fed to the board.



If you are not using the JST connector, or if you are using a Trinket Pro board instead, then just cut off the JST end and splice on an extension to the wires.   Once the battery pack has a long enough wire, you can attach the pack to the alice band.  Hot glue works very well here, but if you want room to change your mind, you can use gorilla glue instead. In any case, I suggest attaching it with a rubber band temporarily so you can test and adjust the positioning as needed.  If you glue the pack too low, you won't be able to reach the on/off switch.  I've made that mistake so be careful.  Also, too high and it could make contact with the ear above it, which could put stress on the pack's wires.

(This battery pack was glued too low so the on/off switch is hard to reach)


Now comes the very hard part...organizing the wires.

For a full set of ears, you will have 4 five-volt positive wires, 4 five-volt ground wires, 4 data wires, one positive battery wire, and one ground battery wire.

Between the Trinket Pro and Flora boards, their GPIO pin holes are small and can only fit one small wire.  So you will need to first splice together all the five-volt positive wires and join then to one new low voltage cable that will fit into the holes of the Trinket board.  Same will apply to the data wires for ONLY the outer strips.  The ground wires also need to be spliced into one wire, but you also need to add the ground wire for the battery pack into the group of ground wires.  From there you have all the single wires you will need to connect to the board.  Fyi, cat5 inner wires work perfectly for most boards.

Per the code below, here is how you need to connect the wires.
  • The ground wire goes to the GND pin
  • The 5v power wire (+5v) goes to the 3v pin
  • The wire for the outer strips go to pin 13 for Trinket Pro, or D10 on Flora
  • The wire for the left inner strip goes to pin 11 for Trinket Pro, or D6 for Flora
  • The wire for the right inner strip goes to pin 9 for Trinket Pro, or D12 for Flora
  • (optional) If you want to change programs with a push button, then solder in the push button on pins 6 and 3 on the Trinket Pro.  For Flora boards, use D9 and the adjacent GND pin, and change the code's INbutton to 9. 
You will need to adjust the below code (at the very top) to change the pin numbers depending on your board.  For the Flora boards, leave out the D in the pin number.  So for pin D9, just use 9.  Once the pin numbers have been adjusted to fit your board, you can upload the code to your board.

If you are making both Minnie and Mickey ears, then you will want to change the color of the outer LEDs.  The Minnie code below is set to pink.  So I used blue for the Mickey ears, but you can use whatever color you want.  To adjust the code, locate and change all the text that reads Color(10,0,10) .  From here, change the numbers to match the correct RGB values.

Blue = 0,0,255
Pink = 170,0,170
Red = 255,0,0
Green = 0,255,0
##include <Adafruit_NeoPixel.h>  
#define INPINLEFT 9    // GPIO pin for inner right strip 
#define INPINRIGHT 11  // GPIO pin for inner left strip 
#define OUTPIN 13      // GPIO pin for BOTH outer strips 
int bright = 255      // brightness assignment 0-255 
// 
#define Pixels 18      // # of pixels on the inner stripas
#define OUTPixels 20   // # of pixels on the outer strips
#define INbutton 6   // # input button (detects the button press)  
#define lowButton 3   // # LOW button  (aka ground), leave as is for Flora (ie not needed)
Adafruit_NeoPixel stripL = Adafruit_NeoPixel(Pixels, INPINLEFT, NEO_GRB + NEO_KHZ800); 
Adafruit_NeoPixel stripR = Adafruit_NeoPixel(Pixels, INPINRIGHT, NEO_GRB + NEO_KHZ800); 
Adafruit_NeoPixel stripOUT = Adafruit_NeoPixel(OUTPixels, OUTPIN, NEO_GRB + NEO_KHZ800); 
  
float redStatesL[Pixels]; float blueStatesL[Pixels]; float greenStatesL[Pixels]; 
float redStatesR[Pixels]; float blueStatesR[Pixels]; float greenStatesR[Pixels]; 
float fadeRate = 0.96; float a = 0; int f = 0; int state = 1; int count = 0; 
int loopcount = 0; int masterloop = 0; int cycle = 1; float b = 0; 
int g= 0; int h= 0; int i = 0; int x = 0; int y = 0; int z = 0; int wait = 5; 
int pause = 5; int count3 = 0; 

void setup() {
  stripL.begin();  stripL.show(); // Initialize all pixels to 'off' 
  stripR.begin();  stripR.show(); // Initialize all pixels to 'off' 
  stripOUT.begin();  stripOUT.setBrightness(50); 
  stripOUT.show(); // Initialize all pixels to 'off' 
 digitalWrite(INbutton, HIGH); 
   
  for(uint16_t l = 0; l < Pixels; l++)  
  { 
    redStatesL[l] = 0; 
    greenStatesL[l] = 0; 
    blueStatesL[l] = 0; 
  } 
void loop ()  { 
if(cycle>3){cycle=1;}  
  int sensor = digitalRead(INbutton); 
if(sensor == LOW){ delay(500); cycle++; }  
  
if(cycle==1){ 
stripL.setBrightness(bright ); 
stripR.setBrightness(bright ); 
      loopcount++; 
 if(loopcount == 3){ 
    b+=.5;    
    for(float f=0; f<OUTPixels; f++){ 
      stripOUT.setPixelColor(f, stripOUT.Color(170,0,170));  } 
      if(b==0){stripOUT.setPixelColor(b, stripOUT.Color(0,0,0));  
    stripOUT.setPixelColor(OUTPixels, stripOUT.Color(5,0,5));  
    stripOUT.setPixelColor(OUTPixels-1, stripOUT.Color(10,0,10));  
    stripOUT.setPixelColor(OUTPixels-2, stripOUT.Color(20,0,20));  
    stripOUT.setPixelColor(OUTPixels-3, stripOUT.Color(170,0,170));  // 
    }else if(b==1){stripOUT.setPixelColor(b, stripOUT.Color(0,0,0));  
    stripOUT.setPixelColor(b-1, stripOUT.Color(5,0,5));  
    stripOUT.setPixelColor(OUTPixels, stripOUT.Color(10,0,10));  
    stripOUT.setPixelColor(OUTPixels-1, stripOUT.Color(20,0,20));  
    stripOUT.setPixelColor(OUTPixels-2, stripOUT.Color(170,0,170));  // 
    }else if(b==2){stripOUT.setPixelColor(b, stripOUT.Color(0,0,0));  
    stripOUT.setPixelColor(b-1, stripOUT.Color(5,0,5));  
    stripOUT.setPixelColor(b-2, stripOUT.Color(10,0,10));  
    stripOUT.setPixelColor(OUTPixels, stripOUT.Color(20,0,20));  
    stripOUT.setPixelColor(OUTPixels-1, stripOUT.Color(170,0,170));  // 
    }else if(b==3){stripOUT.setPixelColor(b, stripOUT.Color(0,0,0));  
    stripOUT.setPixelColor(b-1, stripOUT.Color(5,0,5));  
    stripOUT.setPixelColor(b-2, stripOUT.Color(10,0,10));  
    stripOUT.setPixelColor(b-3, stripOUT.Color(20,0,20));  
    stripOUT.setPixelColor(OUTPixels, stripOUT.Color(170,0,170));  // 
    }else{ 
      stripOUT.setPixelColor(b, stripOUT.Color(0,0,0));   
      stripOUT.setPixelColor(b-1, stripOUT.Color(5,0,5)); 
      stripOUT.setPixelColor(b-2, stripOUT.Color(10,0,10)); 
      stripOUT.setPixelColor(b-3, stripOUT.Color(20,0,20)); 
      stripOUT.setPixelColor(b-4, stripOUT.Color(170,0,170));  } // 
                    
  loopcount=0; 
  } 
  if(b==OUTPixels){b=0;}        
/////////////////////////////////////////////////////   
// begin Balázs Suhajda code https://gist.github.com/suhajdab/9716028
   if (random(20) == 1)  
   { 
      uint16_t i = random(Pixels); 
      uint16_t H = random(Pixels); 
      if (redStatesL[i] < 1 && greenStatesL[i] < 1 && blueStatesL[i] < 1)  
      { 
        redStatesL[i] = random(256); 
        greenStatesL[i] = random(256); 
        blueStatesL[i] = random(256); 
      } 
      if (redStatesR[H] < 1 && greenStatesR[H] < 1 && blueStatesR[H] < 1)  
      { 
        redStatesR[H] = random(256); 
        greenStatesR[H] = random(256); 
        blueStatesR[H] = random(256); 
      } 
  } 
/////////////////////     
    for(uint16_t l = 0; l < Pixels; l++)  
    { 
      if (redStatesL[l] > 1 || greenStatesL[l] > 1 || blueStatesL[l] > 1) { 
        stripL.setPixelColor(l, redStatesL[l], greenStatesL[l], blueStatesL[l]);    
        if (redStatesL[l] > 1) { 
          redStatesL[l] = redStatesL[l] * fadeRate; 
        } else { 
          redStatesL[l] = 0; 
        }         
        if (greenStatesL[l] > 1) { 
          greenStatesL[l] = greenStatesL[l] * fadeRate; 
        } else { 
          greenStatesL[l] = 0; 
        }         
        if (blueStatesL[l] > 1) { 
          blueStatesL[l] = blueStatesL[l] * fadeRate; 
        } else { 
          blueStatesL[l] = 0; 
        }         
      } else { 
        stripL.setPixelColor(l, 0, 0, 0); 
      } 
    } 
/////////////////////     
    for(uint16_t g = 0; g < Pixels; g++)  
    { 
      if (redStatesR[g] > 1 || greenStatesR[g] > 1 || blueStatesR[g] > 1) { 
        stripR.setPixelColor(g, redStatesR[g], greenStatesR[g], blueStatesR[g]);    
        if (redStatesR[g] > 1) { 
          redStatesR[g] = redStatesR[g] * fadeRate; 
        } else { 
          redStatesR[g] = 0; 
        }         
        if (greenStatesR[g] > 1) { 
          greenStatesR[g] = greenStatesR[g] * fadeRate; 
        } else { 
          greenStatesR[g] = 0; 
        }         
        if (blueStatesR[g] > 1) { 
          blueStatesR[g] = blueStatesR[g] * fadeRate; 
        } else { 
          blueStatesR[g] = 0; 
        }         
      } else { 
        stripR.setPixelColor(g, 0, 0, 0); 
      } 
    } 
//////////////////////////////////    
    stripL.show();  
    stripR.show();  
    stripOUT.show(); 
    delay(10); 
// end Balázs Suhajda code https://gist.github.com/suhajdab/9716028
} //end cycle =1   
//////////////////////////////////////////////////////////////////////////////////////////////////////// 
//////////////////////////////////////////////////////////////////////////////////////////////////////// 
//////////////////////////////////////////////////////////////////////////////////////////////////////// 
if(cycle == 2) 
stripL.setBrightness(bright); 
stripR.setBrightness(bright); 
      float jump = 0.25; 
      if(a>100){state = 0;} 
      if(a<3){state = 1;} 
      if(state==0)   /////////////////////////////////// 
      {    
        for(float f=OUTPixels; f>-1; f--){ 
          stripOUT.setPixelColor(f, stripOUT.Color(a,0,a));    
          stripL.setPixelColor(f, stripOUT.Color(a,0,a));    
          stripR.setPixelColor(f, stripOUT.Color(a,0,a));   }  
     a-=jump;            
      } 
      if(state==1)  /////////////////////////////////// 
      { 
        count = 0; 
        for(float f=0; f<OUTPixels; f++){ 
          stripOUT.setPixelColor(f, stripOUT.Color(a,0,a));   
          stripL.setPixelColor(f, stripOUT.Color(a,0,a));   
          stripR.setPixelColor(f, stripOUT.Color(a,0,a));  } 
     a+=jump;      
      } 
    stripL.show();  
    stripR.show();  
    stripOUT.show(); 
} // end cycle == 2 
//////////////////////////////////////////////////////////////////////////////////////////////////////// 
//////////////////////////////////////////////////////////////////////////////////////////////////////// 
//////////////////////////////////////////////////////////////////////////////////////////////////////// 
if(cycle==3){ 

count3++; 
stripR.setBrightness(50); 
stripL.setBrightness(50); 
stripOUT.setBrightness(50); 
g = random(255); 
h = random(255); 
i = random(255); 
x = random(255); 
y = random(255); 
z = random(255); 
if(count3==1500){ 
    for(byte f=0;f<OUTPixels;f++){ 
    stripR.setPixelColor(f, stripR.Color(g,h,i)); 
    stripL.setPixelColor(f, stripL.Color(g,h,i)); 
    stripOUT.setPixelColor(f, stripOUT.Color(x,y,z) );       
    stripOUT.setPixelColor(f-1, stripOUT.Color(x,y,z)); }  
    stripOUT.show();stripL.show();stripR.show();delay(wait);delay(pause);count3=0; 
    } 
}    // end cycle3 
} // end void loop
Once the code is uploaded and all is working, take some time to waterproof any exposed contact points.  You don't have to do this, but Disney parks tend to have water here and there, so it's not a bad idea to waterproof.  If any water comes in contact with any metal on the board while powered on, the whole thing will be ruined forever.  Additionally, this will also provide additional strength to the wires to keep them from ripping out and also prevent them from touching each other and this shorting out the board.   To cover the wires running atop the alice band, you could use some electrical tape and glue to keep it in place.

If you're doing the Minnie version, you can now add the red bow to the alice band. I've not found a good glue that works on the outside of the diffusion material to hold the bow in place.  I used the gorilla glue but it eventually came loose.  The sides won't matter as much.  Just focus on gluing it to the top of the alice band.  Hot glue works quit well here.  

Also be sure to stress test the ears before taking them out for a production run.  Test the alice band's movement and ensure the wires aren't too tight and ripping out of the solder points.  Also ensure the wires aren't causing the ears to move.   Make sure the ears are tightly connected to the alice band.  If they wiggle at all, they are too loose.  Watch for any signs of electrical problems.  If the LED animation freezes on a full battery, then chances are some wires are touching but they shouldn't be.




Adafruit featured my project on their wearable wednesdays episode.  My project begins at 4:36. 

Above all the ears were a huge success.  We heard lots of comments from people such as "look at those" and "where did they get those ears."  But the employees loved them the most.  We had a a few employees come right up to us and ask us all about them.   And Mickey himself was impressed as well.  




Alternative & Cost Saving Options:
  • Instead of using the 60 pixels per meter strips of neopixels, you could settle for the cheaper strips of 30 per meter.  In my opinion, it really doesn't look as good and you would have to adjust the code to make it look decent. 
  • On that note, you could save some  money by buying one 60 pixels/meter strip and one 30 pixels/meter strip, and use the 30/m strip for the inner ear lights.  The ears look best with the 60/m strip on the outside and with the diffusion material covering the inner strip, the fewer pixels won't be as noticeable.
  • Instead of using a Flora board for $20, you could use a Trinket Pro for $10.  Technically this is a more size efficient board, but harder to work with for the inexperienced.  The Flora is bigger and kinda looks odd when placed on the alice band, but it's way easier to solder on wires.   If you are experienced with arduino and soldering, go with Trinket Pro 3v.  Whatever you do, make sure it's 3v and not 5v boards. 
  • Instead of two strips per ear, you could just do one outer strip per ear and ignore the inner strips to save $$ on neopixels. 
  • If you want to spend the extra $$ and go ultra bling, you can get the neopixel strips that are 120 per meter.  The animation of the LEDs will be much smoother, but beware more pixels will eat more battery life.  
  • This project references Adafruit parts which may not be the cheapest but Adafruit is my favorite.  You could find something similar for a better price and use those parts instead.  But you had best know what you are doing because I am not going to help you figure it out.  
  • Some people don't like the looks of the AAA battery pack.  I can't say I blame them but this guide is for somewhat novice users.  So anyone with a deep desire to make it look a tad prettier could switch to a LiPo battery instead. But keep in mind you will also need to buy some kind of a charger and you will want to get at least two batteries so you have a full battery on standby. 
  • UPDATE:  I have recently found what appears to be a cheap knock off version of the neopixels on Amazon.  They appear to be the same thing at 1/4 the price.  So if you need to make multiple sets of ears, this could be a good way to save money.  But I have not tried it so I cannot guarantee anything. 
  • UPDATE 9/2017 - I decided to take another dland trip so I went back to upgrade my ears.  Per the video below, I first changed the code to add a 2nd trail on the outer edge of each ear.  I used a 144 pixels per meter strip so there are 2x the amount of pixels, which does make for a smoother trail animation, but costs more $$.   After that, I removed the AAA battery case and added a 2200mAH lithium ion battery, and connected that to a USB lipo battery charger so I have a way to recharge it (like a phone).  I also added a small on/off toggle switch between the battery and board since the battery pack was the original on/off switch.    With this battery, it lasts well over 12 hours on a single charge.