Things used in this project

Parts & Materials:
Ard nano
Arduino Nano R3
×1
Adafruit PowerBoost 500c
×1
Adafruit Lithium Ion Polymer Battery - 3.7v 2500mAh
×1
HKBAYI 4M 5V 60Leds/M 240pixels programmable WS2812B RGB 5050 LED
×1
Software apps and online services:
Ide web
Arduino IDE
Blender
Hand tools and fabrication machines:
Makerbot Replicator

Custom parts and enclosures

Zip file of STL parts for 3d print
mN3nEnzJuwsMKuZnV76q.zip

Schematics

Fritzing Schematic
bdlN9J7g0K2O7WjOhofo.fzz
KdLERFsHcalSfPnEeEM0.png
Kdlerfshcalsfpneeem0

Code

Arduino CodeArduino
Arduino code to run the LED show. This uses the very easy to use FastLED library http://fastled.io/.
#include <FastLED.h>
#define DATA_PIN 6
#define NUM_LEDS 192
CRGB leds[NUM_LEDS];

int vane;
int ring;
int ringdir;
int count;
int mode;
int splatx;
int splaty;
int splatd;
int colorstep;
unsigned long color;
int icelevel[12];
unsigned long fade[16]={0xffffff,0xbfbfbf,0x7f7f7f,0x5f5f5f,0x3f3f3f,0x2f2f2f,0x1f1f1f,0x171717,0x0f0f0f,0x0b0b0b,0x070707,0x050505,0x030303,0x020202,0x010101,0};
void setxy(int x, int y, CRGB c)
{
  if (x<0) x+=12;
  if (x>11) x-=12;
  if (y<0)
  {
    y=-y;
    x+=6;
    if (x>11) x-=12;
  }
  if (y>15)
  {
    y=31-y;
    x+=6;
    if (x>11) x-=12;
  }  
  leds[y+x*16]=c;
}

void nextcolor()
{
  if (colorstep==1)
  {
    color=0x00ff00;
    colorstep++;
  }
  else if (colorstep==2)
  {
    color=0xff0000;
    colorstep++;
  }
  else if (colorstep==3)
  {
    color=0x0000ff;
    colorstep=1;
  }
}

void newsplat()
{
  splatx = random(3,9);
  splaty = random(0,16);
  splatd=0;
}

void iceinit()
{
  int i;
  for (i=0;i<12;i++)
    icelevel[i]=random(0,20)-20;
}

void setup()
{
  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  FastLED.clear();
  vane=0;
  ring=0;
  color=0x0000ff;
  mode=1;
  count=0;
  colorstep=1;
  ringdir=1;
  newsplat();
  iceinit();
}

void vanes()
{
  int v,i;
  if (vane>0)
  {
    v = (vane-1)<<4;
    for (i=0;i<16;i++)
      leds[v+i]=color&0x1f1f1f;
  }
  v = vane<<4;
  for (i=0;i<16;i++)
    leds[v+i]=color;
  vane++;
  if (vane==12)
  {
    vane=0;
    nextcolor();
  }
}

void rings()
{
  int i;
  for (i=0;i<12;i++)
    leds[i*16+ring]=color;
  ring+=ringdir;
  if (ring==15)
  {
    ringdir=-1;
  }
  if (ring==0)
  {
    ringdir=1;
    nextcolor();
  }
}

void splat()
{
  if (splatd==0)
  {
    setxy(splatx,splaty,color);
    splatd++;
  }
  else if (splatd==1)
  {
    setxy(splatx,splaty,color&0x7f7f7f);
    setxy(splatx+splatd,splaty,color);
    setxy(splatx-splatd,splaty,color);
    setxy(splatx,splaty+splatd,color);
    setxy(splatx,splaty-splatd,color);
    splatd++;
  }
  else if (splatd==2)
  {
    setxy(splatx,splaty,color&0x3f3f3f);
    setxy(splatx+1,splaty,color&0x7f7f7f);
    setxy(splatx-1,splaty,color&0x7f7f7f);
    setxy(splatx,splaty+1,color&0x7f7f7f);
    setxy(splatx,splaty-1,color&0x7f7f7f);
    setxy(splatx+splatd,splaty,color);
    setxy(splatx-splatd,splaty,color);
    setxy(splatx,splaty+splatd,color);
    setxy(splatx,splaty-splatd,color);
    splatd++;
  }
  else if (splatd==3)
  {
    setxy(splatx,splaty,color&0x1f1f1f);
    setxy(splatx+1,splaty,color&0x3f3f3f);
    setxy(splatx-1,splaty,color&0x3f3f3f);
    setxy(splatx,splaty+1,color&0x3f3f3f);
    setxy(splatx,splaty-1,color&0x3f3f3f);
    setxy(splatx+splatd,splaty,color&0x7f7f7f);
    setxy(splatx-splatd,splaty,color&0x7f7f7f);
    setxy(splatx,splaty+splatd,color&0x7f7f7f);
    setxy(splatx,splaty-splatd,color&0x7f7f7f);
    splatd++;
  }
  else if (splatd==4)
  {
    setxy(splatx,splaty,color&0x0f0f0f);
    setxy(splatx+1,splaty,color&0x1f1f1f);
    setxy(splatx-1,splaty,color&0x1f1f1f);
    setxy(splatx,splaty+1,color&0x1f1f1f);
    setxy(splatx,splaty-1,color&0x1f1f1f);
    setxy(splatx+splatd,splaty,color&0x3f3f3f);
    setxy(splatx-splatd,splaty,color&0x3f3f3f);
    setxy(splatx,splaty+splatd,color&0x3f3f3f);
    setxy(splatx,splaty-splatd,color&0x3f3f3f);
    splatd++;
  }
  else if (splatd==5)
  {
    setxy(splatx+1,splaty,color&0x0f0f0f);
    setxy(splatx-1,splaty,color&0x0f0f0f);
    setxy(splatx,splaty+1,color&0x0f0f0f);
    setxy(splatx,splaty-1,color&0x0f0f0f);
    setxy(splatx+splatd,splaty,color&0x1f1f1f);
    setxy(splatx-splatd,splaty,color&0x1f1f1f);
    setxy(splatx,splaty+splatd,color&0x1f1f1f);
    setxy(splatx,splaty-splatd,color&0x1f1f1f);
    splatd++;
  }
  else if (splatd==6)
  {
    setxy(splatx+splatd,splaty,color&0x0f0f0f);
    setxy(splatx-splatd,splaty,color&0x0f0f0f);
    setxy(splatx,splaty+splatd,color&0x0f0f0f);
    setxy(splatx,splaty-splatd,color&0x0f0f0f);
    splatd++;
  }
}

void ice()
{
  int i,j,k;
  FastLED.clear();
  for (i=0;i<12;i++)
  {
    if (icelevel[i]>-1)
    {
      k=0;
      for (j=icelevel[i];j>=0;j--)
      {
        if (j<16 && k<16)
          setxy(i,15-j,fade[k]);
        k++;
      }
    }
    icelevel[i]++;
    if (icelevel[i]==32)
      icelevel[i]=random(0,20)-20;
  }
  FastLED.show();
}

void loop()
{
  if (mode==1)
  {
    FastLED.clear();
    vanes();
    FastLED.show();
    count++;
    if (count==72)
    {
      count=0;
      mode++;
    }
    delay(100);
  }
  else if (mode==2)
  {
    FastLED.clear();
    rings();
    FastLED.show();
    count++;
    if (count==186)
    {
      count=0;
      mode=3;
    }
    delay(30);
  }
  else if (mode==3)
  {
    FastLED.clear();
    splat();
    FastLED.show();
    if (splatd==7)
    {
      newsplat();
      nextcolor();
      count++;
    }
    if (count==30)
    {
      count=0;
      mode=4;
      iceinit();
    }
    delay(50);
  }
  else if (mode==4)
  {
    ice();
    count++;
    if (count==500)
    {
      count=0;
      mode=1;
    }
    delay(100);
  }
}

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / Login
Community Projects Magazine Maker Faire Shop Share
Respect project