TipsyTunes Festive Light Show

Table of contents

TipsyTunes Festive Light Show

Abstract

Introducing "TipsyTunes Festive Light Show"! Arduino magic meets holiday cheer with 25 LEDs in beer bottles and a buzzer belting out three Christmas tunes. Remote-controlled festive mayhem in every sip! Cheers to tipsy technology!

Introducing the "TipsyTunes Festive Light Show" – where Arduino wizardry meets the world of inebriated innovation! Ever found yourself yearning for a symphony of merriment emanating from your beer bottles? Look no further! Our concoction of technology and holiday cheer will leave you questioning if your brew has been secretly moonlighting as a musical maestro.

Picture this: 25 LEDs nestled snugly inside beer bottles, each gleaming with the potential to light up your world (and your spirits). But wait, there's more! A buzzer, ready to serenade you with the dulcet tones of not one, not two, but three Christmas classics. We're talking the kind of auditory bliss that will make your brewskies jealous.

Using the remote control, you can now handpick the anthem for your evening shenanigans, because who needs a DJ when your beer can orchestrate a festive fiesta? From the subtle glow of Santa Claus is Coming to Town to the spirited sparkle of Jingle Bells, our device is here to elevate your beer-drinking escapades to a whole new octave.

For this project, I have used an Arduino Mega 2560, a breadboard to connect all the grounds, and a lot (A LOT) of cables to connect all the LEDs and put them inside the bottles. I have provided the Arduino file as well as the pitches.h file. I inspired myself from a project I found online where they used only 5 LED lights and buttons to change songs. I added 20 more LEDs and added the function to use a remote controller. Plus there were some bugs in the original code that made all the LED lights to turn on at once. I can't find anymore the original code.

#include "pitches.h"

#define buzzerPin 6


// Jingle Bells

int melody[] = {
  _E5, _E5, _E5,
  _E5, _E5, _E5,
  _E5, _G5, _C5, _D5,
  _E5,
  _F5, _F5, _F5, _F5,
  _F5, _E5, _E5, _E5, _E5,
  _E5, _D5, _D5, _E5,
  _D5, _G5
};


int tempo[] = {
  8, 8, 4,
  8, 8, 4,
  8, 8, 8, 8,
  2,
  8, 8, 8, 8,
  8, 8, 8, 16, 16,
  8, 8, 8, 8,
  4, 4
};

// We wish you a merry Christmas

int wish_melody[] = {
  _B3, 
  _F4, _F4, _G4, _F4, _E4,
  _D4, _D4, _D4,
  _G4, _G4, _A4, _G4, _F4,
  _E4, _E4, _E4,
  _A4, _A4, _B4, _A4, _G4,
  _F4, _D4, _B3, _B3,
  _D4, _G4, _E4,
  _F4
};

int wish_tempo[] = {
  4,
  4, 8, 8, 8, 8,
  4, 4, 4,
  4, 8, 8, 8, 8,
  4, 4, 4,
  4, 8, 8, 8, 8,
  4, 4, 8, 8,
  4, 4, 4,
  2
};

// Santa Claus is coming to town

int santa_melody[] = {
  _G4,
  _E4, _F4, _G4, _G4, _G4,
  _A4, _B4, _C5, _C5, _C5,
  _E4, _F4, _G4, _G4, _G4,
  _A4, _G4, _F4, _F4,
  _E4, _G4, _C4, _E4,
  _D4, _F4, _B3,
  _C4
};

int santa_tempo[] = {
  8,
  8, 8, 4, 4, 4,
  8, 8, 4, 4, 4,
  8, 8, 4, 4, 4,
  8, 8, 4, 2,
  4, 4, 4, 4,
  4, 2, 4,
  1
};



#include <IRremote.h>
IRrecv irrecv(46);
decode_results results;
long lastPressTime = 0;
int state = LOW;
unsigned long int ir;

void setup(void) {
  
  pinMode(6, OUTPUT); // Buzzer
  pinMode(5, OUTPUT); // Active Buzzer
  
  pinMode(50, OUTPUT);// Led indicator for _B3
  pinMode(53, OUTPUT);// Led indicator for _C4
  pinMode(52, OUTPUT);// Led indicator for _D4
  pinMode(50, OUTPUT);// Led indicator for _E4
  pinMode(48, OUTPUT);// Led indicator for _F4
  pinMode(47, OUTPUT);// Led indicator for _G4
  pinMode(45, OUTPUT);// Led indicator for _A4
  pinMode(44, OUTPUT);// Led indicator for _B4
  pinMode(42, OUTPUT);// Led indicator for _C5
  pinMode(40, OUTPUT);// Led indicator for _D5
  pinMode(38, OUTPUT);// Led indicator for _E5
  pinMode(34, OUTPUT);// Led indicator for _F5
  pinMode(30, OUTPUT);// Led indicator for _G5
  pinMode(28, OUTPUT);
  pinMode(26, OUTPUT);
  pinMode(24, OUTPUT);
  pinMode(22, OUTPUT);
  pinMode(23, OUTPUT);
  pinMode(25, OUTPUT);
  pinMode(27, OUTPUT);
  pinMode(33, OUTPUT);
  pinMode(35, OUTPUT);
  pinMode(37, OUTPUT);
  pinMode(39, OUTPUT);
  pinMode(41, OUTPUT);
  randomSeed(analogRead(0));
  Serial.begin(9600);
  irrecv.enableIRIn();

}

void loop() {

  if (irrecv.decode(&results)) {
        
        ir = results.value;
        Serial.println(ir);
        if (ir == 2534850111|| ir == 16724175){
          sing(1);
          }
        if (ir == 1033561079 || ir == 16718055){
          sing(2);
          }
        if (ir == 1635910171 || ir == 16743045){
          sing(3);
          }        
        irrecv.resume();
        }
  
}

void ledOn(int t){
  //turns an LED indicator ON when a certain note is played
  if(t==_B3){
    digitalWrite(50,HIGH); //All red
    digitalWrite(42,HIGH);
    digitalWrite(41,HIGH);
    digitalWrite(23,HIGH);
    digitalWrite(30,HIGH);

    digitalWrite(48,HIGH); //All whites
    digitalWrite(45,HIGH);
    digitalWrite(39,HIGH);
    digitalWrite(25,HIGH);
    digitalWrite(22,HIGH);

    Serial.println("B3");
  }
  if(t==_C4){
    digitalWrite(50,HIGH); //All red
    digitalWrite(42,HIGH);
    digitalWrite(41,HIGH);
    digitalWrite(23,HIGH);
    digitalWrite(30,HIGH);

    digitalWrite(53,HIGH); //All greens
    digitalWrite(38,HIGH);
    digitalWrite(35,HIGH);
    digitalWrite(37,HIGH);
    digitalWrite(27,HIGH);

    Serial.println("C4");
  }
  if(t==_D4){
    digitalWrite(51,HIGH); //All yellows
    digitalWrite(47,HIGH);
    digitalWrite(34,HIGH);
    digitalWrite(24,HIGH);
    digitalWrite(28,HIGH);

     digitalWrite(48,HIGH); //All whites
    digitalWrite(45,HIGH);
    digitalWrite(39,HIGH);
    digitalWrite(25,HIGH);
    digitalWrite(22,HIGH);
    Serial.println("D4");
  }
  if(t==_E4){
     digitalWrite(48,HIGH); //All whites
    digitalWrite(45,HIGH);
    digitalWrite(39,HIGH);
    digitalWrite(25,HIGH);
    digitalWrite(22,HIGH);
    Serial.println("E4");
  }
  if(t==_F4){
    digitalWrite(50,HIGH); //All red
    digitalWrite(42,HIGH);
    digitalWrite(41,HIGH);
    digitalWrite(23,HIGH);
    digitalWrite(30,HIGH);
    Serial.println("F4");
  }
  if(t==_G4){
    digitalWrite(53,HIGH); //All greens
    digitalWrite(38,HIGH);
    digitalWrite(35,HIGH);
    digitalWrite(37,HIGH);
    digitalWrite(27,HIGH);
    Serial.println("G4");
  }
  if(t==_A4){
    digitalWrite(50,HIGH); //All red
    digitalWrite(42,HIGH);
    digitalWrite(41,HIGH);
    digitalWrite(23,HIGH);
    digitalWrite(30,HIGH);

    digitalWrite(53,HIGH); //All greens
    digitalWrite(38,HIGH);
    digitalWrite(35,HIGH);
    digitalWrite(37,HIGH);
    digitalWrite(27,HIGH);

    digitalWrite(48,HIGH); //All whites
    digitalWrite(45,HIGH);
    digitalWrite(39,HIGH);
    digitalWrite(25,HIGH);
    digitalWrite(22,HIGH);

    digitalWrite(52,HIGH); //All blues
    digitalWrite(44,HIGH);
    digitalWrite(40,HIGH);
    digitalWrite(33,HIGH);
    digitalWrite(26,HIGH);

    digitalWrite(51,HIGH); //All yellows
    digitalWrite(47,HIGH);
    digitalWrite(34,HIGH);
    digitalWrite(24,HIGH);
    digitalWrite(28,HIGH);

    Serial.println("A4");
  }
  if(t==_B4){
     digitalWrite(48,HIGH); //All whites
    digitalWrite(45,HIGH);
    digitalWrite(39,HIGH);
    digitalWrite(25,HIGH);
    digitalWrite(22,HIGH);
    
    digitalWrite(52,HIGH); //All blues
    digitalWrite(44,HIGH);
    digitalWrite(40,HIGH);
    digitalWrite(33,HIGH);
    digitalWrite(26,HIGH);

    digitalWrite(51,HIGH); //All yellows
    digitalWrite(47,HIGH);
    digitalWrite(34,HIGH);
    digitalWrite(24,HIGH);
    digitalWrite(28,HIGH);


    Serial.println("B4");
  }
  if(t==_C5){
    digitalWrite(48,HIGH); //All whites
    digitalWrite(45,HIGH);
    digitalWrite(39,HIGH);
    digitalWrite(25,HIGH);
    digitalWrite(22,HIGH);
    Serial.println("C5");
  }
  if(t==_D5){
    digitalWrite(52,HIGH); //All blues
    digitalWrite(44,HIGH);
    digitalWrite(40,HIGH);
    digitalWrite(33,HIGH);
    digitalWrite(26,HIGH);
    Serial.println("D5");
  }
  if(t==_E5){
    digitalWrite(53,HIGH); //All greens
    digitalWrite(38,HIGH);
    digitalWrite(35,HIGH);
    digitalWrite(37,HIGH);
    digitalWrite(27,HIGH);
    Serial.println("E5");
  }
  if(t==_F5){
    digitalWrite(51,HIGH); //All yellows
    digitalWrite(47,HIGH);
    digitalWrite(34,HIGH);
    digitalWrite(24,HIGH);
    digitalWrite(28,HIGH);
    Serial.println("F5");
  }
  if(t==_G5){
   digitalWrite(50,HIGH); //All red
    digitalWrite(42,HIGH);
    digitalWrite(41,HIGH);
    digitalWrite(23,HIGH);
    digitalWrite(30,HIGH);
    Serial.println("G5");
  }
}


void ledOff(){

    digitalWrite(48,LOW); //All whites
    digitalWrite(45,LOW);
    digitalWrite(39,LOW);
    digitalWrite(25,LOW);
    digitalWrite(22,LOW);
    
    digitalWrite(52,LOW); //All blues
    digitalWrite(44,LOW);
    digitalWrite(40,LOW);
    digitalWrite(33,LOW);
    digitalWrite(26,LOW);
 
    digitalWrite(53,LOW); //All greens
    digitalWrite(38,LOW);
    digitalWrite(35,LOW);
    digitalWrite(37,LOW);
    digitalWrite(27,LOW);

    digitalWrite(51,LOW); //All yellows
    digitalWrite(47,LOW);
    digitalWrite(34,LOW);
    digitalWrite(24,LOW);
    digitalWrite(28,LOW);

    digitalWrite(50,LOW); //All red
    digitalWrite(42,LOW);
    digitalWrite(41,LOW);
    digitalWrite(23,LOW);
    digitalWrite(30,LOW);
}

int song = 0;
void sing(int s) {
  // iterate over the notes of the melody:
  song = s;
  if (song == 3) {
    Serial.println(" 'We wish you a Merry Christmas'");
    int size = sizeof(wish_melody) / sizeof(int);
    for (int thisNote = 0; thisNote < size; thisNote++) {

      // to calculate the note duration, take one second
      // divided by the note type.
      //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
      int noteDuration = 1000 / wish_tempo[thisNote];
      buzz(buzzerPin, wish_melody[thisNote], noteDuration);

      // to distinguish the notes, set a minimum time between them.
      // the note's duration + 30% seems to work well:
      int pauseBetweenNotes = noteDuration * 1.30;
      delay(pauseBetweenNotes);
      // stop the tone playing:
      buzz(buzzerPin, 0, noteDuration);

    }
  } else if (song == 2) {
    Serial.println(" 'Santa Claus is coming to town'");
    int size = sizeof(santa_melody) / sizeof(int);
    for (int thisNote = 0; thisNote < size; thisNote++) {

      // to calculate the note duration, take one second
      // divided by the note type.
      //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
      int noteDuration = 900 / santa_tempo[thisNote];
      buzz(buzzerPin, santa_melody[thisNote], noteDuration);

      // to distinguish the notes, set a minimum time between them.
      // the note's duration + 30% seems to work well:
      int pauseBetweenNotes = noteDuration * 1.30;
      delay(pauseBetweenNotes);
      // stop the tone playing:
      buzz(buzzerPin, 0, noteDuration);

    }
  } else {

    Serial.println(" 'Jingle Bells'");
    int size = sizeof(melody) / sizeof(int);
    for (int thisNote = 0; thisNote < size; thisNote++) {

      // to calculate the note duration, take one second
      // divided by the note type.
      //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
      
      int noteDuration = 1000 / tempo[thisNote];
      buzz(buzzerPin, melody[thisNote], noteDuration);
      
      // to distinguish the notes, set a minimum time between them.
      // the note's duration + 30% seems to work well:
      
      int pauseBetweenNotes = noteDuration * 1.30;
      delay(pauseBetweenNotes);
      // stop the tone playing:
      buzz(buzzerPin, 0, noteDuration);
    }
  }
}

void buzz(int targetPin, long frequency, long length) {
  ledOn(frequency);
  long delayValue = 1000000 / frequency / 2; // calculate the delay value between transitions
  //// 1 second's worth of microseconds, divided by the frequency, then split in half since
  //// there are two phases to each cycle
  long numCycles = frequency * length / 1000; // calculate the number of cycles for proper timing
  //// multiply frequency, which is really cycles per second, by the number of seconds to
  //// get the total number of cycles to produce
  for (long i = 0; i < numCycles; i++) { // for the calculated length of time...
    digitalWrite(targetPin, HIGH); // write the buzzer pin high to push out the diaphram
    delayMicroseconds(delayValue); // wait for the calculated delay value
    digitalWrite(targetPin, LOW); // write the buzzer pin low to pull back the diaphram
    delayMicroseconds(delayValue); // wait again or the calculated delay value
  }
  ledOff();
}

/*************************************************
 * pitches.h - Public _Constants
 *************************************************/

#define _B0  31
#define _C1  33
#define _CS1 35
#define _D1  37
#define _DS1 39
#define _E1  41
#define _F1  44
#define _FS1 46
#define _G1  49
#define _GS1 52
#define _A1  55
#define _AS1 58
#define _B1  62
#define _C2  65
#define _CS2 69
#define _D2  73
#define _DS2 78
#define _E2  82
#define _F2  87
#define _FS2 93
#define _G2  98
#define _GS2 104
#define _A2  110
#define _AS2 117
#define _B2  123
#define _C3  131
#define _CS3 139
#define _D3  147
#define _DS3 156
#define _E3  165
#define _F3  175
#define _FS3 185
#define _G3  196
#define _GS3 208
#define _A3  220
#define _AS3 233
#define _B3  247
#define _C4  262
#define _CS4 277
#define _D4  294
#define _DS4 311
#define _E4  330
#define _F4  349
#define _FS4 370
#define _G4  392
#define _GS4 415
#define _A4  440
#define _AS4 466
#define _B4  494
#define _C5  523
#define _CS5 554
#define _D5  587
#define _DS5 622
#define _E5  659
#define _F5  698
#define _FS5 740
#define _G5  784
#define _GS5 831
#define _A5  880
#define _AS5 932
#define _B5  988
#define _C6  1047
#define _CS6 1109
#define _D6  1175
#define _DS6 1245
#define _E6  1319
#define _F6  1397
#define _FS6 1480
#define _G6  1568
#define _GS6 1661
#define _A6  1760
#define _AS6 1865
#define _B6  1976
#define _C7  2093
#define _CS7 2217
#define _D7  2349
#define _DS7 2489
#define _E7  2637
#define _F7  2794
#define _FS7 2960
#define _G7  3136
#define _GS7 3322
#define _A7  3520
#define _AS7 3729
#define _B7  3951
#define _C8  4186
#define _CS8 4435
#define _D8  4699
#define _DS8 4978

So, whether you're dreaming of a white Christmas or simply dreaming after a few sips, the TipsyTunes Festive Light Show promises to be the life of the party. Just be warned – your beverages might start requesting encore performances! Cheers to a symphony of suds, lights, and a touch of tipsy technology!

Category : Holiday Projects