How Are Note Frequencies Chosen?
A musical note corresponds to a particular frequency. Frequency is measured in hertz (Hz). When you want an Arduino buzzer to play a specific pitch, you give your code the frequency for that note.
You do not need to calculate every note yourself. Find the note you want in the chart below and copy its frequency into your Arduino code.
Arduino Note Frequency Chart
Use this table to look up the frequency of the note you want to play.
| Note | Frequency (Hz) |
|---|---|
| C1 | 32.703 |
| C#1 / Db1 | 34.647 |
| D1 | 36.708 |
| D#1 / Eb1 | 38.890 |
| E1 | 41.203 |
| F1 | 43.653 |
| F#1 / Gb1 | 46.249 |
| G1 | 48.999 |
| G#1 / Ab1 | 51.913 |
| A1 | 55.000 |
| A#1 / Bb1 | 58.270 |
| B1 | 61.735 |
| C2 | 65.406 |
| C#2 / Db2 | 69.296 |
| D2 | 73.416 |
| D#2 / Eb2 | 77.782 |
| E2 | 82.407 |
| F2 | 87.307 |
| F#2 / Gb2 | 92.499 |
| G2 | 97.999 |
| G#2 / Ab2 | 103.826 |
| A2 | 110.000 |
| A#2 / Bb2 | 116.541 |
| B2 | 123.471 |
| C3 | 130.813 |
| C#3 / Db3 | 138.591 |
| D3 | 146.832 |
| D#3 / Eb3 | 155.563 |
| E3 | 164.814 |
| F3 | 174.614 |
| F#3 / Gb3 | 184.997 |
| G3 | 195.998 |
| G#3 / Ab3 | 207.652 |
| A3 | 220.000 |
| A#3 / Bb3 | 233.082 |
| B3 | 246.942 |
| C4 | 261.626 |
| C#4 / Db4 | 277.183 |
| D4 | 293.665 |
| D#4 / Eb4 | 311.127 |
| E4 | 329.628 |
| F4 | 349.228 |
| F#4 / Gb4 | 369.994 |
| G4 | 391.995 |
| G#4 / Ab4 | 415.305 |
| A4 | 440.000 |
| A#4 / Bb4 | 466.164 |
| B4 | 493.883 |
| C5 | 523.251 |
| C#5 / Db5 | 554.365 |
| D5 | 587.330 |
| D#5 / Eb5 | 622.254 |
| E5 | 659.255 |
| F5 | 698.456 |
| F#5 / Gb5 | 739.989 |
| G5 | 783.991 |
| G#5 / Ab5 | 830.609 |
| A5 | 880.000 |
| A#5 / Bb5 | 932.328 |
| B5 | 987.767 |
| C6 | 1046.502 |
| C#6 / Db6 | 1108.731 |
| D6 | 1174.659 |
| D#6 / Eb6 | 1244.508 |
| E6 | 1318.510 |
| F6 | 1396.913 |
| F#6 / Gb6 | 1479.978 |
| G6 | 1567.982 |
| G#6 / Ab6 | 1661.219 |
| A6 | 1760.000 |
| A#6 / Bb6 | 1864.655 |
| B6 | 1975.533 |
| C7 | 2093.005 |
| C#7 / Db7 | 2217.461 |
| D7 | 2349.318 |
| D#7 / Eb7 | 2489.016 |
| E7 | 2637.020 |
| F7 | 2793.826 |
| F#7 / Gb7 | 2959.955 |
| G7 | 3135.963 |
| G#7 / Ab7 | 3322.438 |
| A7 | 3520.000 |
| A#7 / Bb7 | 3729.310 |
| B7 | 3951.066 |
| C8 | 4186.009 |
| C#8 / Db8 | 4434.922 |
| D8 | 4698.636 |
| D#8 / Eb8 | 4978.032 |
| E8 | 5274.041 |
| F8 | 5587.652 |
| F#8 / Gb8 | 5919.911 |
| G8 | 6271.927 |
| G#8 / Ab8 | 6644.875 |
| A8 | 7040.000 |
| A#8 / Bb8 | 7458.620 |
| B8 | 7902.133 |
| C9 | 8372.018 |
| C#9 / Db9 | 8869.844 |
| D9 | 9397.272 |
| D#9 / Eb9 | 9956.064 |
| E9 | 10548.082 |
| F9 | 11175.304 |
| F#9 / Gb9 | 11839.822 |
| G9 | 12543.854 |
| G#9 / Ab9 | 13289.750 |
| A9 | 14080.000 |
| A#9 / Bb9 | 14917.240 |
| B9 | 15804.264 |
| C10 | 16744.036 |
| C#10 / Db10 | 17739.688 |
| D10 | 18794.544 |
| D#10 / Eb10 | 19912.128 |
| E10 | 21096.164 |
| F10 | 22350.608 |
| F#10 / Gb10 | 23679.644 |
| G10 | 25087.708 |
| G#10 / Ab10 | 26579.500 |
| A10 | 28160.000 |
| A#10 / Bb10 | 29834.480 |
| B10 | 31608.528 |
Frequency data source: Composer Instruments – Scale and Frequency
How to Use This Frequency Chart with Arduino tone()
First, find the musical note you want in the table. Then store its frequency in a variable or constant. For example, A4 is 440.000 Hz, so you can define it like this:
const unsigned int A4 = 440;
Next, pass that frequency to the second argument of
tone(). The first argument is the Arduino pin connected to the
buzzer, and the optional third argument is the duration in milliseconds.
tone(pin, frequency, duration);
Put the note frequency in argument 2.
Using a Note Frequency with Arduino tone()
Arduino tone() generates a square wave at the frequency you specify.
The basic syntax is tone(pin, frequency). You can also add a duration
in milliseconds as the third argument.
The frequency parameter used by tone() is an unsigned integer,
so use a whole-number frequency in the actual function call. For example,
440.000 Hz becomes 440.
const int buzzerPin = 7;
const unsigned int A4 = 440;
void setup() {
pinMode(buzzerPin, OUTPUT);
}
void loop() {
// pin, frequency in Hz, duration in milliseconds
tone(buzzerPin, A4, 500);
delay(1000);
}
To play another note, find its frequency in the table and replace
A4 with the value for that note.