Created: February 10th, 2015

0
Project Description

Happi Cup is the best reminder of your upcoming Friday! Every morning at 9:00 a.m. during the weekdays, the Pixel Ring lights up showing yellow color similating the beer, and the pump pours a certain amount of water into the cup, it will stop automatically after reach the required amount (approximately 2 minutes). The amount of the water indicates which day you are in according to the whole week and also how far away you are from the Friday Night! When Friday Night finally comes, the glass will be full of water, which indicates you are free! Go out join the party and grab a beer! This device can also show notification on some important things. The pixel ring outside shows blue color when his girlfriend updated on Instagram; Pink for his boss's email; And cyan for important calendar events.

0
Function

To enable the water pouring into the cup, we used a pump powered by 2 sets of battery cradle in total of 18V, by control the time of how long it runs to get the certain amount of water we want. And also to simulate the beer and enable its notifying functions; we used 2 sets of pixel rings to light up the glass, the one inside showing beer-like color, the outside one shows its functions of notification integrated with Gmail, Google calender and Instagram.

0


0
Process

Circuit Components

● Spark Micro-controller X 1

● Connecting Wire X 1

● Breadboard X 1

● Jumper Wires X n

● 1kΩ Resistor X 1

● 9V Battery Cradle X 2

● Pixel Ring 24 LED X 1

● Pixel Ring 12 LED X 1

● Peristaltic Liquid Pump with Silicone Tubing X 1

● Resistor X 1

0

Brainstorming 

0

Prototyping

0
Coding
1
/*******************************Reference:
DC motor: http://www.goodliffe.org.uk/arduino/dcmotor.php
Pixel Ring: https://github.com/technobly/SparkCore-NeoPixel/blob/master/firmware/examples/extra-examples.cpp
***************************************/

#include "application.h"
#include "neopixel.h"

/*******************setting time variables*****************/
int timeH = 0;
int timeM = 0;
int timeW = 0;

/**********************setting LED lines********************/
#define PIXEL_TYPE WS2812B
int pixelCount = 24;
int pixelPin = D0;
int pixelCount2 = 12;
int pixelPin2 = D1;

/*********************Ring 1 and Ring 2**********************/
Adafruit_NeoPixel strip = Adafruit_NeoPixel(pixelCount, pixelPin, PIXEL_TYPE);
Adafruit_NeoPixel strip2 = Adafruit_NeoPixel(pixelCount2, pixelPin2, PIXEL_TYPE);

/*******************setting LED colors for different functions*****************/
uint32_t beerColor = strip.Color(158,93,9);
int calendarColor = strip.Color(37, 167, 57);
int instagramColor = strip.Color(0, 130, 250);
int emailColor = strip.Color(255, 51, 98);
int offColor = strip.Color(0, 0, 0);

/*******************setting pump lines*****************/
int pumpPin = A1;
int delayTime = 30;

/*******************main functions*****************/
void setup()
{
  Time.zone(-5);

  //set the ring
  strip.begin();
  strip.show();

  pinMode(pumpPin, OUTPUT);
  //report time details for debug
  Spark.variable("H", &timeH, INT);
  Spark.variable("M", &timeM, INT);
  Spark.variable("W", &timeW, INT);

  Spark.function("emailC",colorForEmail);
  Spark.function("calendar",colorForCalendar);
  Spark.function("instagram",colorForInstagram);
}

void loop()
{
  //get the time any time
  timeH = Time.hour();
  timeM = Time.minute();
  timeW = Time.weekday();

   //set daily activity
  if(timeW >= 0 && timeW <= 5)
  {
     
      if(timeW == 2 && timeH == 16 && timeM >= 0)
      {
        clubLight();
      }
      else
        colorWipe(beerColor, 800);
 

      if(timeH == 8)
      {
        drivePump();  
      } 
  }
}

/*******************setting Pump (DC motor)*****************/
void drivePump()
{
  if(timeM >= 30 && timeM <= 32)
    {
         analogWrite(pumpPin, 255);
    }
    else
    {
        analogWrite(pumpPin, 0);
    }
}

/*******************setting light function*****************/
void colorWipe(int c, int wait)
{
  for(uint16_t i=0; i<strip.numPixels(); i++)
  {

    strip.setPixelColor(i, c);
    strip2.setPixelColor(i, c);
    strip.show();
    strip2.show();
    delay(wait);
  }
}

//friday night light
void clubLight()
{
  int i, j;
  
  for(j=0; j<256; j++) 
  {
    for(i=0; i<strip.numPixels(); i++) 
    {
      strip.setPixelColor(i, Wheel((i+j) & 255));
    }
    for(i=0; i<strip2.numPixels(); i++) 
    {
      strip2.setPixelColor(i, Wheel((i+j) & 255));
    }
    
    strip.show();
    strip2.show();
    delay(delayTime);
  }
}

int 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);
  }
}
/*******************setting website function*****************/
//email color
int colorForEmail(String command)
{
  int i;
  int j;
  int z = 3;
  for(j = 0; j< 5; j++)
  {
  for(i=0; i<strip.numPixels(); i=i+z)
  {
    strip.setPixelColor(i, emailColor);
  }

  strip.show();

  int w = command.toInt();
  delay(w);
  z--;
  }
  colorWipe(beerColor, 800);
  return 1;
}

//calendarColor
int colorForCalendar(String command)
{
  int i;
  int j;
  for(j = 0; j< 5; j++)
  {
  for(i=0; i<strip.numPixels(); i++)
  {
    strip.setPixelColor(i, calendarColor);
  }
  strip.show();
  int w = command.toInt();
  delay(w);
  }
 
  colorWipe(beerColor, 800);
   return 1;
}

//instagram
int colorForInstagram(String command)
{
  int i;
  for(i=0; i<strip.numPixels(); i++)
  {
    strip.setPixelColor(i, instagramColor);
  }
  strip.show();
  
  for(i=0; i<strip2.numPixels(); i++)
  {
    strip2.setPixelColor(i, strip2.Color(0, 50, 200));
  }
  strip2.show();
  
  int w = command.toInt();
  
  delay(w);
  
  colorWipe(beerColor, 800);
  return 1;
}
Click to Expand
0
Final Video
0
Product Demonstration


0
About Our Team

We are the team of HAPPI BEER FRIENDS!

We are a group of people who are CREATIVE & HARD WORKING!

0
Video Resources

The non-profitable video used the following resources:

● ZABRA - by FAUX CANADA

● Palm Beer

● SaBo-FX - Party Time

0
Special Thanks

Special thanks to T.J. Berry -- our copy writer and voice over.

x