Musical Mischief: Passive Buzzer Rickroll
The Passive Buzzer Rickroll project is a lightweight, invisible prank device. It combines the tone() generation capabilities of the Arduino with a light sensor, remaining completely silent until someone opens a drawer or turns on a light switch.

Frequencies and Rhythms in C++
To make an electronic "beep" recognizable as a pop song, you need accurate math.
- The Header File: You include a
pitches.htab in your sketch, containing all the musical notes mapped to their hertz frequencies (e.g.,#define NOTE_D4 294). - The Melody Array: You compose the riff of the song
int melody[] = {NOTE_C4, NOTE_D4, NOTE_F4, NOTE_D4...};. - The Duration Array: You list the beats:
1/4notes,1/8notes, etc. - The Trigger Loop: You wait for a condition to be met (e.g.,
analogRead(lightSensor) > 500). When triggered, aforloop plays the arrays using thetone(pin, pitch, duration)function.
Concealment Hardware
- ATtiny85 Microcontroller: The smaller the better! A huge Arduino Uno is too obvious to hide. You can program an 8-pin ATtiny85 using your Uno.
- Passive Piezo Buzzer: Essential. Active buzzers can only play one terrible beep.
- LDR (Photoresistor): The trigger mechanism.
- Coin Cell Battery (CR2032).
Tape this to the bottom of your roommate's desk drawer, and wait for the hilarity to ensue when they open it!