Hardware Reference
In-Depth Information
to put an ordinary potentiometer in series with a speaker to adjust its volume.
Now, you use the SPI DigiPot to adjust speaker volume digitally.
NOTE Intentionally,thisprojectisdesignedasajumping-offpoint;youmake
asimpleaudiovisualdisplaythatyoucanexpandoninsoftwaretocreatemuch
moreinspiredprojects.Getthisexampleworkingfirst;then,seehowyoucan
builduponittomakesomethingtrulypersonal.Thisexerciseoffersanideal
opportunitytogetcreativewithyourArduino.
SettingUptheHardware
The setup here is similar to what you used to adjust LED brightness. In fact, to
keep things interesting, you keep three of the LEDs in place and replace one of
them with a speaker. However, for the speaker, one end of the digital potenti-
ometer connects through a resistor to an I/O pin of the Arduino that will adjust
the frequency of the speaker. The generated square wave passes through the
DigiPot, which then adds a series resistance, thus dropping the voltage to the
speaker, changing its amplitude. Remove one of the LEDs, put a speaker in its
place, and connect that DigiPot to an I/O pin on the Arduino, as shown in the
wiring diagram in FigureĀ 9-7.
Figure 9-7: Potentiometer LED setup
Search WWH ::




Custom Search