Arduino tone() Produces No Sound
DodaTech
Updated 2026-06-26
1 min read
In this tutorial, you'll learn about Arduino tone() Produces No Sound. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
The Problem
Calling tone() on a buzzer pin produces no audible output.
Quick Fix
Wrong
tone(9, 440); // No duration specified — plays forever
Buzzer plays 440 Hz continuously with no stop.
Right
int buzzerPin = 9;
void setup() {
pinMode(buzzerPin, OUTPUT);
}
void loop() {
tone(buzzerPin, 440, 500); // 440 Hz for 500 ms
delay(600);
noTone(buzzerPin);
delay(500);
}
Buzzer beeps at 440 Hz for 500 ms, pauses, repeats.
Prevention
tone() uses Timer2 on AVR, conflicting with analogWrite() on pins 3 and 11. Use a duration parameter to auto-stop the tone. Call noTone() to stop manually. Only one tone() can play at a time. tone() does not need pinMode — it sets the pin mode automatically.
DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.
FAQ
← Previous
Arduino SPI Interrupt Conflict Causes Data Corruption
Next →
Arduino tone() Keeps Playing After Expected Stop
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro