Introduction: Lady Gaga Worm Disco

Want to make your garden the coolest joint in town? The worm disco offers free entry to all worms, along with 2 free soil shots! Meet new worm friends and party all night!

Here is a super simple guide to make a worm disco for your neighbourhood worms using Arduino. This design uses an Arduino, a Smart LED, a touch sensor and a piezzo buzzer.

Step 1: Assemble Materials

You will need:

x Arduino
x Piezzo Speaker
x Smart LED
x Touch Sensor
x Wires
x Breadboard (Optional)

Step 2: Setup

The above photos display two options for the setup of the project, one with and one without a breadboard.

The circuit should be set up as follows:

LED: Pin 13
Touch Sensor: Pin 2
Piezzo Speaker: Pin 10

Step 3: Code

Next, insert the code into the Arduino program in your computer and upload it to your Arduino.

This codes the buzzer to play a part of Lady Gaga's "Bad Romance". Feel free to change the song that plays at your disco, but remember to code the tones individually with the use of ARDUnotes.

// Uses a PIR sensor to detect movement, buzzes a buzzer
// more info here: http://blog.makezine.com/projects/pir-sensor-ardu...
// based upon:
// PIR sensor tester by Limor Fried of Adafruit
// tone code by michael@thegrebs.com
int ledPin = 13;                // choose the pin for the LED
int inputPin = 2; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
int pinSpeaker = 10; //Set up a speaker on a PWM pin (digital 9, 10, or 11)
void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(inputPin, INPUT); // declare sensor as input
pinMode(pinSpeaker, OUTPUT);
Serial.begin(9600);
}
void loop(){
val = digitalRead(inputPin); // read input value
if (val == HIGH){ // check if the input is HIGH
digitalWrite(ledPin, HIGH); //turn LED ON
playTone(400,220.00);
playTone(400,220.00);
playTone(200,329.63);
playTone(200,329.63);
playTone(200,349.23);
playTone(200,329.63);
delay(150);
playTone(200,220.00);
playTone(400,220.00);
playTone(200,329.63);
playTone(200,329.63);
playTone(200,349.23);
playTone(200,329.63);
playTone(400,220.00);
playTone(400,220.00);
playTone(200,329.63);
playTone(200,329.63);
playTone(200,349.23);
playTone(200,329.63);
delay(150);
playTone(200,261.63);
playTone(200,261.63);
playTone(200,220.00);
playTone(200,261.63);
playTone(200,220.00);
playTone(400,261.63);
    if (pirState == LOW) {                   // we have just turned on
Serial.println("Motion detected!"); // We only want to print on the output change, not state
pirState = HIGH;
}
} else {
digitalWrite(ledPin, LOW); // turn LED OFF
playTone(0, 0);
delay(300);
if (pirState == HIGH){ // we have just turned off
Serial.println("Motion ended!"); // We only want to print on the output change, not state
pirState = LOW;
}
} }
// duration in mSecs, frequency in hertz
void playTone(long duration, int freq) {
duration *= 1000;
int period = (1.0 / freq) * 1000000;
long elapsed_time= 0;
while
(elapsed_time < duration) {
digitalWrite(pinSpeaker,HIGH);
delayMicroseconds(period / 2);
digitalWrite(pinSpeaker, LOW);
delayMicroseconds(period / 2);
elapsed_time += (period);
}
}

Step 4: Have Fun at Your Worm Disco!

Let your creativity run wild at this step as your make your worm disco convincing! I added a disco ball, signage and some model worms for extra ambiance.

I had lots of fun with this project and I hope you had fun reading my first instructable. Shoutout to my groupmate Charlene Su for handcoding "Bad Romance", and our professor Dr. Andrew Quitmeyer for all his guidance.