Microcontrolleras an Instrument to Play the First Notes Of O Canada.
To learn the interaction between a digital signal and an analog signal using the relevant instruments.
Study electromagnetics, sound and speakers.
To familiarize with the use of the Arduino.
Thisproject exercise requires that one use their individualmicrocontroller as an instrument to play the first notes of O Canada.The Arduino being a digital instrument can play the part ofsynthesizing this instrument through conversion of a digital signalto an analog signal. The Arduino turns the signal from discretevalues into continuous values. In this problem the Arduino acts as atransducer by converting the signal into the preferable frequency ofthe output. Varying the frequency of the output signal of our Arduinowe can tune it according to that of the instrument that we want. Thefigures below shows one such example of the experiment with theschematic diagram and the output signal. The notes of the musicalinstrument are delivered as an analog output from the speaker(Jonathan& Ramesh, 2014).
Computer to program the Arduino
7 Resistors two R (36.5ohms) and five 2R (73ohms).
Cathode ray oscilloscope,
Inthis case, we are only suing three pins from our input this is a3-Bit Digital to Analog Conversion (DAC) circuit. To get the valuesof the resistors that we need we have to calculate the values fromohms law by V/I=R and then use the resistors whose values are ratedin our calculations in our circuit. The 3-bit circuit will have thecode input as follows (001, 010, and 100). Current flowing acrossany active at any particular point is I0=Vref/ 3R).At each of the branch, the current divides itself into two I2= I1/2and I1= I0/2.Current into the lower bit divides more sine and each stage developstwo signals. For generating sound, a period interrupt is employed forthis purpose. Below is a table of periodic interrupt and that of dataso as to generate sound (Jonathan& Ramesh, 2014).
Thethree digital inputs have an output of Iout=(4b2+ 2b1+ b0)Vref/ (24R).The 3-bit microcontroller will be able to generate 8 differentcurrent outputs with a resolution of 1.25mA as presented in the tablebelow (Jonathan& Ramesh, 2014).
Q2       Q1       Q0
0    0    0
0    0    5.0
0    5.0  0
0    5.0  5.0
3.3  0    0
5.0  0    5.0
5.0  5.0  0
5.0  5.0 5.0
Thefigure below is the analog output signal of the DAC.
Tohave my own code I modifies the values of the independent variablesin the code made by others to make it perform according to what wewant. The code of the project was as below
Flowchartfor the program variables is as below
Theexperiment was a huge success in that it showed the versatility ofthe microcontrollers while at the same time drilling home the pointof DACs. These ideas might also be applied to other problems such ashaving a microcontroller that controls the voicemail message of aphone once it rings and turns out unreachable. It was thus a veryappealing and an informative experiment as it will allow me tobenefit later in the near future (Jonathan& Ramesh, 2014).
Jonathan,V., and Ramesh, Y. Digitalto Analog Conversion and Sound EmbeddedSystems – ShapeThe World.Chapter13: Retrieved 12thNov, 2015 fromhttp://users.ece.utexas.edu/~valvano/Volume1/E-Book/C13_DACSound.html