This is a simple tone generator project using Arduino Pro Mini. A part of super hit song "Jimikky Kammal " of the movie "Velipadinte Pusthakam" is developed in monotonic.
Musical notes occur in nature as smooth and rolling sinusoidal waves. In this project, instead of smooth sine waves, we will be producing sound with square waves. Square waves produce a tone but it is more crisp and metallic than a normal sine wave. A musical note can be created by generating frequency. Each frequency have unique tone. Here Arduino is used to create this frequncy.
Step 1: Hardware Setup
It is very easy to setup hardware. For developing this project we rquire
- Arduino Pro Mini
- FTDI USB to Serial Adapter (for uploading Program to Arduino Pro Mini)
Interface FTDI USB to Serial adapter to Arduino Pro Mini for Programming as shown in the circuit diagram. Connect one pin of the speaker to digital pin 11 (you can change pin number in Program) of the Arduino Pro Mini and Other one to ground.
In this circuit, we don’t add any amplifier circuit, so that the volume may very low. You can add any audio amplifier circuit thus, you will get much sound to the output or you can use PC speaker having adjustable volume control.
Step 2: Software Development
Music notes can be created by generating oscillation in Arduino. Frequency of oscillation is the pitch of the tune speed of musical notes played Beats is the period of each tune played. So, we have to make exact pitch, beats, tempo for every musical note.
In this program, we don’t generate all frequencies for all sounds. Only the sound required for the music “Jimikky Kammal” is added.Frequencies for all notes are given below link.
We have to convert these frequencies to time period so that Arduino will get duration for turn ON and OFF the digital pin. The calculation of the tones is made following the mathematical operation:
timeHigh = 1/(2 * toneFrequency) = period / 2
To generate 100 Hz oscillations,
i.e. Time Period = 1/100 S = 0.01 S = 10000 uS
So we need to make pin HIGH for 5000 uS and LOW for 5000 uS
i.e. timeHigh = 1/(2*100)
= 0.005 S
= 5000 uS
Step 3: Simulation
We have created a simulation with the help of Proteus Proffessional software installed in windows PC, thus the audio output can be verified in PC via soundcard. You need to explicitily add Arduino Library to Proteus.