Project tutorial
National Anthem Tank

National Anthem Tank

I created a tank that plays the US National Anthem upon pressing a button (eagle eye). It is meant to be a fun way of being patriotic.

  • 519 views
  • 1 comment
  • 1 respect

Components and supplies

Ard lilusb
Arduino LilyPad USB
This is where the code for the tune is stored, and must connect with the buzzer and button to be able to play.
×1
08463 01
SparkFun LilyPad Buzzer
This is where the actual sound of the tune is emitted, upon pressing the button.
×1
08776 01
SparkFun LilyPad Button Board
When pressed, this allows for the buzzer to make sound.
×1
Adafruit industries ada640 image 75px
Sewable Conductive Thread
Conductive thread connects each of the components to each other in the circuit.
×1

Apps and online services

Ide web
Arduino IDE
I referenced the "Play a Tune" tutorial in Arduino to learn how sound is emitted from the buzzer. I then coded the tune myself in Arduino, working with different note frequencies and lengths.

About this project

My project is a patriotic tank top of an eagle with an embedded tune buzzer. When the user presses the button, located on the eye of the eagle, the US national anthem plays. I found this tank top at a thrift store, and thought it would be fun to recreate it into something more exciting. With components from the LilyPad Protosnap Plus and conductive thread, I created a circuit that allows a user to press a button and thus play the tune. The tune must complete before it can be restarted.

Embedding Circuit Instructions:

1. Gather an article of clothing, preferably something patriotic.

2. Optional: Cut a hole in the eagle eye (this is where the button will be positioned).

3. Gather supplies for circuit (LilyPad USB, LilyPad Buzzer, LilyPad Button, conductive thread, regular thread).

4. Sew in LilyPad USB with regular thread. Sew in all USB ports, except –, A4, and A9. This will secure the USB to the fabric, while allowing room for the conductive thread in the other ports.

5. Position button onto eagle eye, with button aligned to the hole. Using conductive thread, connect one end of button to port A9. Connect the other end of the button to the – port, nearest to port A4.

6. Position buzzer close to ports – and port A4. Using conductive thread, connect + on buzzer to port A4. Then, connect – on buzzer to port –.

7. With code for tune uploaded into USB, insert lithium battery into compartment.

8. Press the button, and it's time for fireworks and hotdogs.


Code

National AnthemArduino
I declared the frequencies for every note and coded the melody to the National Anthem. I made it so the user must press a button for the tune to begin playing. The entire tune must play through before the user can start from the beginning again.
int buzzer = A4;

int buttonTune = A9;


int NOTE_B0 = 31;
int NOTE_C1 = 33;
int NOTE_CS1 = 35;
int NOTE_D1 = 37;
int NOTE_DS1 = 39;
int NOTE_E1 = 41;
int NOTE_F1 = 44;
int NOTE_FS1 = 46;
int NOTE_G1 = 49;
int NOTE_GS1 = 52;
int NOTE_A1 = 55;
int NOTE_AS1 = 58;
int NOTE_B1 = 62;
int NOTE_C2 = 65;
int NOTE_CS2 = 69;
int NOTE_D2 = 73;
int NOTE_E2 = 82;
int NOTE_F2 = 87;
int NOTE_FS2 = 93;
int NOTE_G2 = 98;
int NOTE_GS2 = 104;
int NOTE_A2 = 110;
int NOTE_AS2 = 117;
int NOTE_B2 = 123;
int NOTE_C3 = 131;
int NOTE_CS3 = 139;
int NOTE_D3 = 147;
int NOTE_DS3 = 156;
int NOTE_E3 = 165;
int NOTE_F3 = 175;
int NOTE_FS3 = 185;
int NOTE_G3 = 196;
int NOTE_GS3 = 208;
int NOTE_A3 = 220;
int NOTE_AS3 = 233;
int NOTE_B3 = 247;
int NOTE_C4 = 262;
int NOTE_CS4 = 277;
int NOTE_D4 = 294;
int NOTE_DS4 = 311;
int NOTE_E4 = 330;
int NOTE_F4 = 349;
int NOTE_FS4 = 370;
int NOTE_G4 = 392;
int NOTE_GS4 = 415;
int NOTE_A4 = 440;
int NOTE_AS4 = 466;
int NOTE_B4 = 494;
int NOTE_C5 = 523;
int NOTE_CS5 = 554;
int NOTE_D5 = 587;
int NOTE_DS5 = 622;
int NOTE_E5 = 659;
int NOTE_F5 = 698;
int NOTE_FS5 = 740;
int NOTE_G5 = 784;
int NOTE_GS5 = 831;
int NOTE_A5 = 880;
int NOTE_AS5 = 932;
int NOTE_B5 = 988;
int NOTE_C6 = 1047;
int NOTE_CS6 = 1109;
int NOTE_D6 = 1175;
int NOTE_DS6 = 1245;
int NOTE_E6 = 1319;
int NOTE_F6 = 1397;
int NOTE_FS6 = 1480;
int NOTE_G6 = 1568;
int NOTE_GS6 = 1661;
int NOTE_A6 = 1760;
int NOTE_AS6 = 1865;
int NOTE_B6 = 1976;
int NOTE_C7 = 2093;
int NOTE_CS7 = 2217;
int NOTE_D7 = 2349;
int NOTE_DS7 = 2489;
int NOTE_E7 = 2637;
int NOTE_F7 = 2794;
int NOTE_FS7 = 2960;
int NOTE_G7 = 3136;
int NOTE_GS7 = 3322;
int NOTE_A7 = 3520;
int NOTE_AS7 = 3729;
int NOTE_B7 = 3951;
int NOTE_C8 = 4186;
int NOTE_CS8 = 4435;
int NOTE_D8 = 4699;
int NOTE_DS8 = 4978;


int tempo = 500;

void setup(){

  pinMode(buzzer, OUTPUT);
  pinMode(buttonTune, INPUT_PULLUP);

}

void loop()
{

  if(digitalRead(buttonTune) == LOW){

     tone(buzzer,NOTE_G5);
  delay(tempo);

  tone(buzzer,NOTE_E5);
  delay(tempo/3);

  tone(buzzer,NOTE_C5);
  delay(tempo);

  tone(buzzer,NOTE_E5);
  delay(tempo);

  tone(buzzer,NOTE_G5);
  delay(tempo);

  tone(buzzer,NOTE_C6);
  delay(tempo*2);

  tone(buzzer,NOTE_E6);
  delay(tempo);

  tone(buzzer,NOTE_D6);
  delay(tempo/3);

  tone(buzzer,NOTE_C6);
  delay(tempo);

    tone(buzzer,NOTE_E5);
  delay(tempo);

    tone(buzzer,NOTE_FS5);
  delay(tempo);

    tone(buzzer,NOTE_G5);
  delay(tempo*2);

    tone(buzzer,NOTE_G5);
  delay(tempo/3);

  tone(buzzer,NOTE_E6);
  delay(tempo*1.5);

   tone(buzzer,NOTE_D6);
  delay(tempo/3);

    tone(buzzer,NOTE_C6);
  delay(tempo);

    tone(buzzer,NOTE_B5);
  delay(tempo);

      tone(buzzer,NOTE_A5);
  delay(tempo);

   tone(buzzer,NOTE_B5);
  delay(tempo);

      tone(buzzer,NOTE_C6);
  delay(tempo);

        tone(buzzer,NOTE_C6);
  delay(tempo);

    tone(buzzer,NOTE_G5);
  delay(tempo);

     tone(buzzer,NOTE_E5);
  delay(tempo);

    tone(buzzer,NOTE_C5);
  delay(tempo);

    tone(buzzer,NOTE_E6);
  delay(tempo);

    tone(buzzer,NOTE_E6);
  delay(tempo/3);

    tone(buzzer,NOTE_E6);
  delay(tempo);

    tone(buzzer,NOTE_F6);
  delay(tempo/3);

    tone(buzzer,NOTE_G6);
  delay(tempo);

      tone(buzzer,NOTE_G6);
  delay(tempo);

      tone(buzzer,NOTE_F6);
  delay(tempo/2);

    tone(buzzer,NOTE_E6);
  delay(tempo/2);

     tone(buzzer,NOTE_D6);
  delay(tempo*2);

      tone(buzzer,NOTE_E6);
  delay(tempo/3);

        tone(buzzer,NOTE_F6);
  delay(tempo);

        tone(buzzer,NOTE_F6);
  delay(tempo);

         tone(buzzer,NOTE_F6);
  delay(tempo);

        tone(buzzer,NOTE_E6);
  delay(tempo);

       tone(buzzer,NOTE_D6);
  delay(tempo);

         tone(buzzer,NOTE_C6);
  delay(tempo);

         tone(buzzer,NOTE_B5);
  delay(tempo);

           tone(buzzer,NOTE_A5);
  delay(tempo);

           tone(buzzer,NOTE_B5);
  delay(tempo);

           tone(buzzer,NOTE_C6);
  delay(tempo);

           tone(buzzer,NOTE_C6);
  delay(tempo);

           tone(buzzer,NOTE_G5);
  delay(tempo);

          tone(buzzer,NOTE_E5);
  delay(tempo);

            tone(buzzer,NOTE_C5);
  delay(tempo);

             tone(buzzer,NOTE_G5);
  delay(tempo);

             tone(buzzer,NOTE_C6);
  delay(tempo);

               tone(buzzer,NOTE_C6);
  delay(tempo);

               tone(buzzer,NOTE_C6);
  delay(tempo/2);

               tone(buzzer,NOTE_B5);
  delay(tempo/2);

               tone(buzzer,NOTE_A5);
  delay(tempo);
  
               tone(buzzer,NOTE_A5);
  delay(tempo);
  
               tone(buzzer,NOTE_A5);
  delay(tempo);
                 tone(buzzer,NOTE_D6);
  delay(tempo);

                 tone(buzzer,NOTE_F6);
  delay(tempo/2);
                    tone(buzzer,NOTE_E6);
  delay(tempo/2);

                   tone(buzzer,NOTE_D6);
  delay(tempo/2);

                   tone(buzzer,NOTE_C6);
  delay(tempo/2);
  
                   tone(buzzer,NOTE_C6);
  delay(tempo);
  
                   tone(buzzer,NOTE_B5);
  delay(tempo*4);

                     tone(buzzer,NOTE_G5);
  delay(tempo);

                       tone(buzzer,NOTE_G5);
  delay(tempo);
  
                       tone(buzzer,NOTE_C6);
  delay(tempo*2);

                         tone(buzzer,NOTE_D6);
  delay(tempo/2);
  
                           tone(buzzer,NOTE_E6);
  delay(tempo/2);
  
                             tone(buzzer,NOTE_F6);
  delay(tempo/2);
  
                               tone(buzzer,NOTE_G6);
  delay(tempo*6);

                                 tone(buzzer,NOTE_C6);
  delay(tempo*1.5);

                                   tone(buzzer,NOTE_D6);
  delay(tempo*1.5);

                                   tone(buzzer,NOTE_E6);
  delay(tempo*2);

                                   tone(buzzer,NOTE_F6);
  delay(tempo);

                                     tone(buzzer,NOTE_D6);
  delay(tempo*2.5);

                                     tone(buzzer,NOTE_C6);
  delay(tempo*6);
    
    
  }

  else {
     noTone(buzzer);
 
  }

}

Schematics

National Anthem Circuit Diagram
This is a diagram representing the embedded circuit in the tank. When a user presses the button, the music will begin to play from the buzzer. The entire tune must complete before it can be restarted, and it cannot be stopped midway.
Circuit diagram national anthem 01 hzcg9nkwnp

Comments

Similar projects you might like

US National Anthem with Lights & Tone

Project tutorial by Ryaebi

  • 2,097 views
  • 6 comments
  • 8 respects

Arduino Plays Indian National Anthem

Project tutorial by Boaz Lawnce

  • 1,653 views
  • 8 comments
  • 18 respects

Halloween Decoration

Project tutorial by Sarah Foster

  • 346 views
  • 0 comments
  • 3 respects

Automatizing Percussion with Solenoids: "The Sound Compass"

Project tutorial by touchmysound

  • 4,294 views
  • 4 comments
  • 13 respects

Wireless MIDI Glove

Project tutorial by PurplePunk

  • 4,089 views
  • 1 comment
  • 17 respects

Glow Pillow with Force Sensing Resistor

Project tutorial by Rachel Fagan

  • 646 views
  • 0 comments
  • 1 respect
Add projectSign up / Login