Build it step by step
0 of 7 doneWire the button, buzzer and LED
D2, D8 and D9.
Upload and open the serial monitor at 9600
It says Press the button to light the fuse.
Press the button
Slow beeps begin.
Listen as the beeps speed up
The pitch climbs.
Wait for the long buzz
The round ends.
Play a few rounds
Fuse times are different each time.
Change the fuse range
Make it shorter or longer.
How do you build a hot potato beeper?
A small box beeps faster and faster while players pass it round, then gives a long buzz at a random moment and the player holding it is out. Press its button to start a round. A fast party game that is also a lesson in random timing. You need Arduino Nano, Tactile push button 6 mm, Passive buzzer, LED 5 mm red, Resistor 220 Ω, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 50 minutes.
- Level
- Beginner
- Time
- About 50 min
- Parts
- 7
Parts list
- Development BoardsBuyArduino Nano × 1
- SwitchesBuy
- Motors & ActuatorsBuyPassive buzzer × 1
- SemiconductorsBuyLED 5 mm red × 1
- PassivesBuyResistor 220 Ω × 1
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Button leg 1 | Nano D2 | Start and pass button |
| Button leg 2 | Nano GND | Pressing joins D2 to ground |
| Passive buzzer + | Nano D8 | Tone output |
| Passive buzzer - | Nano GND | Return path |
| LED long leg | Nano D9 through a 220 ohm resistor | Flashes with each beep |
| LED short leg | Nano GND | Return path |
Code
The game is a state machine with two states: waiting, and burning the fuse. When you press the button the Nano picks a random fuse time of 8 to 25 seconds that nobody knows. While the fuse burns, a short beep and a flash repeat, and the gap between them shrinks from nearly a second to a tenth of a second, while the pitch climbs, so the tension builds. At the end the buzzer gives a long low sound and the player holding the box is out. The button is pressed to start the round and, if you like, clicks as the box is passed. The random seed combines a floating analog pin with the microsecond clock so each game differs. The buzzer can be loud, so keep it a hand-span from your ear. Try changing the fuse range, or making the pass button shorten the fuse by a little to keep players honest.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
const uint8_t BUTTON_PIN = 2;
const uint8_t BUZZER_PIN = 8;
const uint8_t LED_PIN = 9;
enum State { IDLE, RUNNING };
State state = IDLE;
unsigned long roundStart, fuseMs, lastBeep;
bool pressed() {
if (digitalRead(BUTTON_PIN) == LOW) {
delay(30);
while (digitalRead(BUTTON_PIN) == LOW) {} // wait for release
return true;
}
return false;
}
void beep(int hz, int ms) {
tone(BUZZER_PIN, hz, ms);
digitalWrite(LED_PIN, HIGH);
delay(ms);
digitalWrite(LED_PIN, LOW);
}
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP);
pinMode(LED_PIN, OUTPUT);
randomSeed(analogRead(A0) + micros());
Serial.begin(9600);
Serial.println("Press the button to light the fuse.");
}
void loop() {
if (state == IDLE) {
if (pressed()) {
fuseMs = random(8000, 25000); // a secret fuse of 8 to 25 seconds
roundStart = millis();
lastBeep = 0;
state = RUNNING;
Serial.println("Fuse lit. Pass it on!");
}
return;
}
unsigned long elapsed = millis() - roundStart;
if (elapsed >= fuseMs) { // boom
tone(BUZZER_PIN, 220, 2000);
digitalWrite(LED_PIN, HIGH);
delay(2000);
digitalWrite(LED_PIN, LOW);
Serial.println("BUZZ! The player holding it is out. Press for another round.");
state = IDLE;
return;
}
float progress = (float)elapsed / fuseMs; // 0 to 1
unsigned long gap = 900 - (unsigned long)(progress * 800); // 900 ms slowing to 100 ms
if (millis() - lastBeep >= gap) {
lastBeep = millis();
beep(1000 + (int)(progress * 800), 40); // pitch rises as the fuse burns
}
if (pressed()) beep(2000, 20); // a little click when it is passed
}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
Press the button to light the fuse.
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Button press | Fuse lights, slow beeps start |
| During the round | Beeps get faster and higher |
| Fuse ends | Long low buzz and a lit LED |
| Another round | A different fuse time |
| Pass click | A short high click when you press mid-round |
If it does not work
No sound
Check you have a passive buzzer and it is on D8.
Round ends instantly
Check the fuse range in random().
Same fuse every time
Check the floating A0 pin is not wired to anything.
LED never flashes
Check its direction.
Button seems stuck
Check it is wired to D2 and GND.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the hot potato beeper?
Arduino Nano, Tactile push button 6 mm, Passive buzzer, LED 5 mm red, Resistor 220 Ω, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the hot potato beeper take to build?
About 50 minutes for a beginner maker, in 7 steps.
How do I know the hot potato beeper works?
Button press: Fuse lights, slow beeps start. During the round: Beeps get faster and higher. Fuse ends: Long low buzz and a lit LED.
No sound: what should I check?
Check you have a passive buzzer and it is on D8.
Round ends instantly: what should I check?
Check the fuse range in random().
Same fuse every time: what should I check?
Check the floating A0 pin is not wired to anything.
LED never flashes: what should I check?
Check its direction.
