
The Arduino Buzzer Nokia Tune project introduces one of the most exciting applications of microcontrollers: sound generation.
In this project, Arduino uses a passive buzzer to play the iconic Nokia ringtone by generating different sound frequencies. Instead of simply turning a buzzer ON or OFF, the Arduino precisely controls the frequency and duration of each note to produce a recognizable melody.
This project introduces:
tone() FunctionBy completing this project, you'll understand how Arduino can generate sounds, play melodies, and interact with audio devices in embedded systems.
Arduino Uno × 1
Breadboard × 1
Passive Buzzer × 1
Jumper Wires × 2
USB Cable × 1
Connect the Arduino GND pin to the negative rail of the breadboard.
This creates a common ground connection for the circuit.
Place the passive buzzer onto the breadboard.
Connect:
Pin 8Double-check the buzzer polarity before uploading the code.
Important: This project requires a Passive Buzzer. An Active Buzzer contains an internal oscillator and can only generate simple beeping sounds, while a passive buzzer can play melodies by varying the output frequency.
Inside setup(), Arduino configures Pin 8 as an output pin.
This pin sends frequency signals to the passive buzzer.
The Nokia ringtone is stored as two arrays:
The tone() function generates sound by sending square-wave signals of different frequencies to the buzzer.
Each frequency corresponds to a different musical note.
The program uses delay() to determine how long each note should play before moving to the next one.
After all notes have been played, the program waits for a short delay and then repeats the Nokia tune continuously.
After uploading the code:
No Sound: Verify that you are using a passive buzzer and check the wiring to Pin 8 and GND.
Incorrect Melody: Ensure the complete code has been uploaded without modifying the note or duration arrays.
Very Low Volume: Passive buzzers are naturally quiet. Move closer to the buzzer or use a small speaker module for louder sound.
Upload Errors: Verify the correct Arduino board and COM port are selected in the Arduino IDE.
By completing this project, you have learned:
tone() functionIn Day 9, you'll learn how to measure distance using an Ultrasonic Sensor (HC-SR04) and display accurate object detection with Arduino.