Академический Документы
Профессиональный Документы
Культура Документы
Experiment - 5
(Audio Playback with Modulation)
Aim :- Learn to use signal conditioning, shaping and manipulation operations for interfacing
with real world appliances.
Problem Statement :-
- To reproduce the audio signal on a speaker with different modulations in terms of
amplitude and frequency using an 8-bit parallel DAC and a LM386 amplifier.
- Amplitude modulation can be achieved by using multiplication based on scaling of
potentiometer input. And Frequency modulation can be achieved by varying the delay
between samples.
Apparatus Required :-
● Arduino
● 8 bit DAC0800
● LM386 Audio amplifier
● Breadboard
● Potentiometer
● Resistors and Capacitors
● Connecting wires
● DC Supply
● Speaker
Challenges Faced :-
1. Understanding the design of the code for the experiment was the biggest challenge
2. Integrating DAC and LM386 chip with Arduino microcontroller was a complex task
3. Also capacitors present in the lab were not of correct values, and it created a lot of
confusion.
Circuit Diagram:-
Following circuit diagrams were used to make the required circuit. Arduino pins 0-7 were
applied to digital inputs of DAC.
Breadboard Circuit Picture :-
Flow Chart for Experiment :-
Observations :-
1. What would happen if we chose to digitize using 4-bits instead of 8-bits ? What if we chose
24-bits instead of 8-bits ?
Ans. If we use 4-bits instead of 8-bits, quality of audio produced will be worse, as now analog
audio signal is generated from only 4 discretization levels instead of 8, so jumping from one
level to other will not be that smooth as in case of 8-bits. Similarly if we use 24-bits instead of
8-bits, we will get a better output that represents original smooth wave as now there are more
discretization levels. But this will require increased circuitry, so we should only use it if it makes
difference to human ears in terms of sound quality.
2. How and why would you use a digital potentiometer ? More importantly, where (in which
design application) would you absolutely insist that a digital potentiometer be used ?
2) Digipots are convenient for use where environmental factors can adversely affect a
mechanical pot. Environments with vibration or particles like dirt, dust, moisture or grease that
can gum up the shaft can drive one to choose a digital potentiometer. Digipots can be better
protected from the environment since they can be encapsulated.
3) Digipots can also offer higher resolution, greater stability, and solid-state reliability. They are
smaller than mechanical potentiometers and can fit in tiny IC packages. They must be
programmed, typically with I2C or SPI communication bus protocols. Digital potentiometers can
be made with just 1% end-to-end resistance tolerance and are needed in tasks that require high
reliability and memory features.
Conclusion :-
In this experiment we reproduce the audio signal on a speaker with different modulations in
terms of amplitude and frequency using an 8-bit parallel DAC and a LM386 amplifier. We
achieved amplitude variations using multiplication based on scaling of potentiometer input and
frequency modulation was achieved by varying the delay between samples.
References :-
[1] https://drive.google.com/file/d/0B6xIF3HrSm15UGZSbllEcXVjRXM/view
[2] http://www.ti.com/lit/ds/symlink/dac0800.pdf
[3] http://www.ti.com/lit/ds/symlink/lm386.pdf
[4] https://electronics.stackexchange.com/questions/120687/how-to-correctly-connect-audio-
plug-to-lm386
[5] https://www.arduino.cc/en/tutorial/melody
[6] https://www.analogictips.com/what-is-a-digital-potentiometer/
Appendix : Code for Audio Playback with Modulation
void setup()
{
for(int i=0;i<8;i++)
pinMode(i,OUTPUT);
}
void loop()
{
for(int i = 0; i < length; i++)
{
if(notes[i] == ' ')
delay(beats[i] * tempo); // rest
else
playNote(notes[i], beats[i]*tempo);